DanTheMan
unread,Dec 15, 2016, 11:42:15 AM12/15/16You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello,
A long time ago (in a galaxy far far away), user wanted to export reports to excel. However, saving straight to excel gave us unwanted results such as hidden fields showing up and the format of it being a bit too raw for the users taste.
So, of course, we discovered the nifty little trick of saving the datawindow as an HtmlTable! but renaming the file as a .xls
This ultimately opens up in excel and maintains some of the features of the datawindow such as hidden fields and computed fields.
The user can then play with the data or add other things until ultimately printing the report.
This has been working since our app deployed with Powerbuilder 9.x It was still working when we migrated to Powerbuilder 11.x . But during the last migration, something happened. When we use this saveas htmltable feature in powerbuilder 12.5 and open it into excel, there are some things that are not working. The most important one is the hidden columns. When you hid a column on the datawindow, it just didn't show up in excel but now that data shows up. The reports we export like that are mostly financial reports with a credit and debit columns. When a value is in debit, the credit value will be 0.00 and vice versa. Instead of showing the 0.00, we hide the column and it looked better. This used to be replicated in excel but is now showing 0.00.
I nailed it down the generated html table being different between powerbuilder 9.x - 11.x and Powerbuilder 12.5
For example if a column was hidden the generated html from PB9-11 was
< TD NOWRAP COLSPAN=2>100< /TD>
< TD NOWRAP COLSPAN=3>CASH AT BANK< /TD>
< TD NOWRAP ALIGN=right COLSPAN=2>< /TD>
< TD NOWRAP ALIGN=right COLSPAN=2>10,462.73< /TD>
I Powerbuilder 12.5 it is
< TD>100</TD>
< TD COLSPAN=3>CASH AT BANK < /TD>
< TD ALIGN=right Style='visibility:hidden;'>0.00< /TD>
< TD ALIGN=right Style='visibility:hidden;'>10,462.73< /TD>
You can see how the 3rd table cell used to be empty and now it contains 0.00 but the style tag tries to hide it. Unfortunately, Excel doesn't really care for the style tag and ends up showing the 0.00
I tried to toy with the GenerateCSS property and with the HTMLGen.Browser property to no avail so far.
If i load my Powerbuilder 9, leave everything by default (Browser, generate css etc) it exports fine, if i do the same with Powerbuilder 12.5, it generates using the style tag.
Is there a way to "Force" our application made with Powerbuilder 12.5 to export html table using the "old" method?
It looks like this new way of exporting might be embedded... I hope not. My only other solution is to export this way and then parse the file to replace the Style tags by simple < TD> < /TD> tags.... but it's not the best solution