1. Danish Ahamed LiakathAli
  2. PowerBuilder
  3. Friday, 4 December 2020 00:07 AM UTC

Hi,

     We have migrated from 10.2 to 2019 R2 and We have added a new '.XLSX' extension in our existing SaveAs option.

We are able to export the all datawindows with this extension  expect the reports that has designed using crosstab datawindow. 

To export the Crosstab DW we have the below code and  to render the actual presentation we are using ('HTMLTable!') .

ls_path = C:\Users\Username\Downloads\Filename.xlsx.

lds.SaveAs(ls_Path, HTMLTable!, lb_Hdr)

When we open the file we are getting the below error. 

 

Do we have any known issue in PB to export a crosstab dw to xlsx? Is there any solution to fix. 

 

The code works if we export the dw with .xls extension .

 

 

 

Danish Ahamed LiakathAli Accepted Answer Pending Moderation
  1. Friday, 4 December 2020 01:14 AM UTC
  2. PowerBuilder
  3. # 1
Comment
  1. Chris Pollach @Appeon
  2. Friday, 4 December 2020 14:45 PM UTC
Hi Danish;

My guess is that this recent change in behaviour is due to an Excel update / upgrade where Excel now checks the file first before opening it, that it matches a specfic binary format. Just my $0.02

Regards ... Chris
  1. Helpful
There are no comments made yet.
Danish Ahamed LiakathAli Accepted Answer Pending Moderation
  1. Friday, 4 December 2020 00:51 AM UTC
  2. PowerBuilder
  3. # 2

In this crosstab datawindow export, I am using 'HTMLTable!' parameter and  for other datawindows I am using 'XLSX!' parameter to save the file with .xlsx extension .

For Saving the file with .xls extension :- dw.SaveAs( ls_Path, Excel8!, lb_Hdr )
For Saving the file with .xlsx extension :- dw.SaveAs( ls_Path, XLSX!, lb_Hdr )

For Saving the file with .xls extension for Crosstab DW :- dw.SaveAs(ls_Path, HTMLTable!, lb_Hdr)
For Saving the file with .xlsx extension for Crosstab DW :- dw.SaveAs(ls_Path, HTMLTable!, lb_Hdr) - I am getting error when open the file.

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 4 December 2020 00:56 AM UTC
If you are using HTMLTable! that is not an Excel file. Not sure why Excel will accept this if it is .XLS extension, but surely .HTM format is not .XLSX format.
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 4 December 2020 00:43 AM UTC
  2. PowerBuilder
  3. # 3

For the SaveAs method are you using XLSX! parameter instead of Excel! parameter?  https://docs.appeon.com/pb2019r2/datawindow_reference/ch06s21.html

Comment
  1. Chris Pollach @Appeon
  2. Friday, 4 December 2020 00:49 AM UTC
Hi Armeen;

The problem could stem from the fact that Danish should be using the XLSX! parameter but instead, is requesting an HTML format.

Regards... Chris
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Friday, 4 December 2020 00:56 AM UTC
I missed in the original post that Danish is using .HTM format. But anyway, my guess is right that the incorrect parameter time is being used.
  1. Helpful
  1. Danish Ahamed LiakathAli
  2. Friday, 4 December 2020 01:14 AM UTC
This is an existing code and for exporting in .xls format it was working fine but when open the file it does show the attached message .(sorry I missed in my post) . If we choose YES the file is getting open.



  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.