1. Thomas Rolseth
  2. PowerServer 2020 or older (Obsolete)
  3. Friday, 10 April 2020 16:26 PM UTC

We are trying to export a report to .xlsx format with a PB 2019 application using PowerServer 2020. Here is the GetFileSaveName call we are using for the dialog.

GetFileSaveName ( "Save As", ls_path, ls_file, "", "Excel with headers (*.xls),*.xls,Excel12 with headers (*.xlsx),*.xlsx,Text with headers (*.txt),*.txt, CSV with headers (*.csv),*.csv" , "", 32770)

If the extension is xlsx we then call dw.SaveAs(s_path,EXCEL!,True, EncodingANSI!).  We have also tried EXCEL5!.  The export seems to work but when you open the file you get the attached error.  Is the xlsx extension not supported in PowerServer?  If not, are there any known workarounds?

Thanks, Tom

 

Attachments (1)
Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 10 April 2020 20:48 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # Permalink

Hi Thomas;

   PowerServer has it's own SaveAs() internal support that does not use the same mechanism as native PB. The only option supported is EXCEL and the older .XLS format.

Note: For the EXCEL format in PS, only up to 256 characters are supported and anything larger will be automatically truncated.

FWIW: For my PS Web & Mobile Apps, I use a PB built Web Service that calls a native PB App .exe which then gives me a lot more control over Excel and PDF generation.  ;-)

Regards ... Chris

Comment
  1. Thomas Rolseth
  2. Sunday, 12 April 2020 16:41 PM UTC
Thanks Chris. The format EXCEL8! works with xls so we will just use that. It would be good to have xlsx supported in PowerServer down the road as it has been industry standard for a while now.
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Sunday, 12 April 2020 19:25 PM UTC
PowerServer 2021 should support all the same formats as PowerBuilder 2019 R2.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Friday, 10 April 2020 17:18 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

You need to specify the excel format that you want

https://docs.appeon.com/appeon_online_help/pb2017r2/datawindow_reference/ch06s21.html

 

XLSX!

24

Microsoft Excel 2007 format for XML data (requires .NET Framework 3.0 or later)

XLSB!

Comment
  1. Thomas Rolseth
  2. Friday, 10 April 2020 18:05 PM UTC
Thanks. However, if I use XLSX! or XLSB! then nothing is saved at all. If I use EXCEL! the export works in that it creates a file but trying to open the file causes the error that was attached to my original post. Both the client and server have .netcore installed.
  1. Helpful
  1. mike S
  2. Saturday, 11 April 2020 13:54 PM UTC
oops, i didn't notice that you posted this in powerserver. chris is correct, that is not supported in powerserver.



"The value of a saveastype argument can be TEXT, HTMLTable, XML, PDF*, EXCEL, or EXCEL5. For the EXCEL format, only up to 256 characters are supported and anything larger will be automatically truncated."



https://docs.appeon.com/appeon_online_help/ps2020/features_help_for_appeon_web/functions_of_datawindow_control.html
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.