1. mathews rutto
  2. PowerBuilder
  3. Wednesday, 6 January 2021 11:49 AM UTC

Hello,

 

I need help on how to export datawindow to excel with image (Company Logo) and without loosing the formatted font?

Thank you in advance.

with kind regards,

Who is viewing this page
mathews rutto Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 13:37 PM UTC
  2. PowerBuilder
  3. # 1

The below link as work for me finally.

https://community.appeon.com/index.php/articles-blogs/tips-tricks-techniques-articles/17-powerbuilder/190-exporting-datawindows-to-excel-html-without-loosing-format

Small thing remaining how can i enable pop up where user can save to preferred location path.

What is there is the pre-defined path.

 

Comment
  1. mathews rutto
  2. Thursday, 7 January 2021 16:27 PM UTC
How do i combine GuardarAExcel2( dw_1, "c:\Report.xls") with GetFileSaveName() function so that it can work together.



For the image have manage to modify the code and that works well.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 7 January 2021 17:58 PM UTC
Instead of using the fixed string "c:\report.xls" you first call GetFileSavename(), and then use the string that you from the use of that function (see powerbuilder help) for the GuardarAExcel2() (which translated means "save_to_excel").
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 7 January 2021 18:04 PM UTC
GetFileSaveName() will give you the path and name of the chosen filename to save to. (there's 2 parameters)
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 7 January 2021 03:14 AM UTC
  2. PowerBuilder
  3. # 2

(Edited)

What do you mean "you can't get through"? The links work fine for me...

I think the last link that Govinda provided might solve your problem, though it does NOT save images, but it might solve your problem. To solve the problem of the images, you could modify the code yourself. It's not a very fast solution (Desta's dw2xls library is faster, does export images but it's not free, though not very expensive I think it's around 600 dollars or similar)(The link to Bruce's example does not manage any images).

In the past I made a sample app in PB 2017, see: https://community.appeon.com/index.php/qna/q-a/save-dw-to-excel?limitstart=0#reply-19249 In "responses (5)" you'll see a zipped attachment of my sample application which you can download.

regards.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 6 January 2021 21:36 PM UTC
  2. PowerBuilder
  3. # 3

If your goal is to provide a way to "export" multiple kinds/styles DW's into Excel spreadsheets (i.e., a general-purpose solution), then no, there's no quick and easy (and free!) answer. As Armeen has indicated, if it was trivial, everyone would just do it.

If, however, you need to do this for a single or very small number of DW's where each export is very nearly the same (limited differences in the data content), then you might consider starting with a pre-defined "template" spreadsheet that already contains the company logo, headers, fonts, formatting, etc. Use OLE/PowerScript to open the starting spreadsheet, populate the data values into their pre-determined cells in the spreadsheet, even insert & populate rows, then perform a Save As. This is still not a trivial task, but it's a lot simpler than coding a general-purpose solution from scratch.

This may not be a feasible solution for your needs, but I'll throw the idea out there in case it might help.

Best wishes, John

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 6 January 2021 15:44 PM UTC
  2. PowerBuilder
  3. # 4

Greetings, Mathews - 

Here's another option you may wish to consider:

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

Regards, John

Comment
  1. Armeen Mazda @Appeon
  2. Wednesday, 6 January 2021 18:50 PM UTC
No, this is a paid product. They have a trial version, but not sure what kind of limitations it has.
  1. Helpful
  1. mathews rutto
  2. Wednesday, 6 January 2021 19:23 PM UTC
Is there any other way i can achieve without any third party?
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Wednesday, 6 January 2021 21:12 PM UTC
I'm not aware of a free product. Govinda has provided some examples how you could do this yourself in PowerScript. But my guess is it is time consuming to really get good result, otherwise nobody would buy the product from Desta.
  1. Helpful
There are no comments made yet.
Govinda Lopez @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 6 January 2021 15:30 PM UTC
  2. PowerBuilder
  3. # 5

Hi Mathews,

 

Following are a couple of Code Samples found on CodeXchange relating to Excel:

 

Create Spreadsheet From DataWindow Using OLE

Excel through OLE Automation Demo

 

And, perhaps, this article is what you are looking for:

 

https://community.appeon.com/index.php/articles-blogs/tips-tricks-techniques-articles/17-powerbuilder/190-exporting-datawindows-to-excel-html-without-loosing-format

 

I hope this helps.

 

Regards,

Comment
  1. mathews rutto
  2. Wednesday, 6 January 2021 19:18 PM UTC
Sorry have tried to download the sample from the link provided but i can get through. Do have any alternative?
  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.