there is no easy/reliable way of converting HTML and CSS to Excel (except of course going into the HTML rendering engine business). So in a less ambitious approach, for custom HTML forms, the system look for a well-formed HTML table and parses that into a grid which is subsequently rendered as Excel / PDF.
So the current approach is to use a valid, well-formed HTML table as the basis of your custom forms. You can validate your HTML here:
----Forwarded using Multi-Forward Chrome Extension—
From: Knut Staring
Date: Mon Apr 11 2016 16:00:35 GMT+0530 (IST)
Subject: Re: [Dhis2-devs] Possible bug? Saving a Dataset Report in Excel or PDF format
To: David Hagan
Cc: dhis2-devs
Hi David,
It seems the issue is with CUSTOM forms - it works well with the standard forms, is hard to realise for arbitrary custom forms. However, it may be possible if the forms are very well defined (however, they may then have to look very much like the generated forms).
I’ve tested it on https://play.dhis2.org/demo and there is no problem, but we have a major country rolling out this month with the version below and this is one of their outstanding issues.
For ANY dataset report, downloading the PDF or Excel versions of the report displays the raw HTML. It’s like no conversion stylesheet has been applied.
I’ve attached to downloads for reference. Is this a known issue? (I haven’t gone and checked it on demo … will go there next.
Yes, I’ve been looking at the HTML and throwing it at validators and ‘HTML Tidy’. There are lot’s of nasty nested SPANs everywhere - would be good (from our perspective) to factor these out as custom style elements … I seem to remember we can load custom style sheets … so need to take a peek at how to load those, and eliminate the errors that were in the forms.
----Forwarded using Multi-Forward Chrome Extension—
From: Knut Staring
Date: Mon Apr 11 2016 16:00:35 GMT+0530 (IST)
Subject: Re: [Dhis2-devs] Possible bug? Saving a Dataset Report in Excel or PDF format
To: David Hagan
Cc: dhis2-devs
Hi David,
It seems the issue is with CUSTOM forms - it works well with the standard forms, is hard to realise for arbitrary custom forms. However, it may be possible if the forms are very well defined (however, they may then have to look very much like the generated forms).
I’ve tested it on https://play.dhis2.org/demo and there is no problem, but we have a major country rolling out this month with the version below and this is one of their outstanding issues.
For ANY dataset report, downloading the PDF or Excel versions of the report displays the raw HTML. It’s like no conversion stylesheet has been applied.
I’ve attached to downloads for reference. Is this a known issue? (I haven’t gone and checked it on demo … will go there next.
Yes, I’ve been looking at the HTML and throwing it at validators and ‘HTML Tidy’. There are lot’s of nasty nested SPANs everywhere - would be good (from our perspective) to factor these out as custom style elements … I seem to remember we can load custom style sheets … so need to take a peek at how to load those, and eliminate the errors that were in the forms.
Cheers
David
On Tue, Apr 12, 2016 at 5:51 PM Lars Helge Øverland lars@dhis2.org wrote:
Hi David,
there is no easy/reliable way of converting HTML and CSS to Excel (except of course going into the HTML rendering engine business). So in a less ambitious approach, for custom HTML forms, the system look for a well-formed HTML table and parses that into a grid which is subsequently rendered as Excel / PDF.
So the current approach is to use a valid, well-formed HTML table as the basis of your custom forms. You can validate your HTML here:
----Forwarded using Multi-Forward Chrome Extension—
From: Knut Staring
Date: Mon Apr 11 2016 16:00:35 GMT+0530 (IST)
Subject: Re: [Dhis2-devs] Possible bug? Saving a Dataset Report in Excel or PDF format
To: David Hagan
Cc: dhis2-devs
Hi David,
It seems the issue is with CUSTOM forms - it works well with the standard forms, is hard to realise for arbitrary custom forms. However, it may be possible if the forms are very well defined (however, they may then have to look very much like the generated forms).
I’ve tested it on https://play.dhis2.org/demo and there is no problem, but we have a major country rolling out this month with the version below and this is one of their outstanding issues.
For ANY dataset report, downloading the PDF or Excel versions of the report displays the raw HTML. It’s like no conversion stylesheet has been applied.
I’ve attached to downloads for reference. Is this a known issue? (I haven’t gone and checked it on demo … will go there next.