1. Manos Miliaras
  2. PowerBuilder
  3. Wednesday, 19 December 2018 07:23 AM UTC

Hello.

Is there any (easy) way to export the presentation layer of a datawindow preferably as excel. I have searched around and haven't managed to find anything that gives you an export of "what you see" on the datawindow. My next try is probably gonna be to try to use OLE to write the data to an excel file but still unsure how that will work out.

Thanks in advance.

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 19 November 2019 15:51 PM UTC
  2. PowerBuilder
  3. # 1

And yes, I know it's not perfect but I have to show you this link. It's not bad either, especially for tabular / grid datwindows. Though Eduardo's code is really great, this one is quite a bit faster in exporting, not free, but not very expensive either:

http://desta.com.ua/dw2xls/

 

Comment
  1. Miguel Leeuwe
  2. Tuesday, 19 November 2019 15:53 PM UTC
BTW, they have a trial version for you to see first if it's fit for purpose
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Tuesday, 19 November 2019 14:33 PM UTC
  2. PowerBuilder
  3. # 2

You can construct at run time an external datawindow that matches the display fields (including the computes), and name each column whatever the header text is for each field (so excel has those names).  you will need to copy the data into the external datawindow then save that as excel.  Its a bit of work, but once done you should be able to use it for any export.  this works well for grid datawindows to excel.

Comment
There are no comments made yet.
Olaf Brungot Accepted Answer Pending Moderation
  1. Tuesday, 19 November 2019 13:41 PM UTC
  2. PowerBuilder
  3. # 3

How to avoid the 

 

Excel cannot open the tile ...... because of the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 19 December 2018 15:07 PM UTC
  2. PowerBuilder
  3. # 4

Hi Emmanouil;

  Unfortunately, the built-in PB SaveAs () command only exports the data "as is" from the DWO's "primary" buffer (aka no formatting). You can either write an OLE interface yourself (as you already mentioned) to handle this or maybe consider an "add-on" product like DW2XLS.

FYI: http://desta.com.ua/dw2xls

Regards ... Chris

Comment
  1. Manos Miliaras
  2. Thursday, 20 December 2018 10:41 AM UTC
Thanks for the info.
  1. Helpful
There are no comments made yet.
Eduardo G. Accepted Answer Pending Moderation
  1. Wednesday, 19 December 2018 07:54 AM UTC
  2. PowerBuilder
  3. # 5

Here you have my development with the complete code in a link.

The code of the link of the web url doesn't work and for but that I have warned to change it they don't let me ... already I am tired.

 

Links:

Exporting Datawindows to Excel / Html without losing Format

Here the complete code

Comment
  1. Manos Miliaras
  2. Thursday, 20 December 2018 10:44 AM UTC
I ll check your code and see if it is fitting our needs. Thanks for the links.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.