0
Votes
Undo
  1. Bjarne Anker
  2. PowerBuilder
  3. Thursday, 26 March 2020

Hi.

We have a function that saves the content of a datawindow to Excel using this code:

try

     ll_return = dw_saveas.SaveAs(ls_xls, XLSX!, true)

catch (Throwable th)
    messagebox("",th.GetMessage())

end try

The datawindow has about 180.000 rows, which results in the following exception:

It works just fine with 90.000 rows.

I have the latest version of Excel (32 bit) on my computer.

64 bit is not an option.

 

Any suggetions?

 

br,

 

Bjarne Anker

Maritech Systems AS

Who is viewing this page
Accepted Answer
René Ullrich Accepted Answer Pending Moderation
3
Votes
Undo

Hi Bjarne,

PowerBuilder uses .NET to export the data to XLSX. I guess it is a limitation of this exporter. You should create a support ticket.

As workaround you could export using CSV. If you need it as Excel you can open Excel using OLEObject, import the CSV and save it to XLSX.

HTH,

René

Comment
There are no comments made yet.
  1. Thursday, 26 March 2020
  2. PowerBuilder
  3. # Permalink
Bjarne Anker Accepted Answer Pending Moderation
1
Votes
Undo

I've tried a lot of things, but the best solution for now is to use dw_data.saveas(file,TXT!,true) if more than 100.000 rows (which is rare anyways). And dw_data.SaveAS(file,XLSX!,true) if less.

Works just fine.

 

A workaround is to compile 64 bit version, but that will probably introduce other unforseen issues in our application.

 

Thanks all :)

Comment
There are no comments made yet.
  1. Thursday, 26 March 2020
  2. PowerBuilder
  3. # 1
Miguel Leeuwe Accepted Answer Pending Moderation
2
Votes
Undo

Since you say that Excel 64 bit is not an option, maybe you could set some kind of filter on your datawindow (like rowid < 90000 or something similar?) and then export. After that set the filter to rowid >= 90.000 and do the second export?

I've read that for "later" versions the limits for maximum rows and columns are:

1,048,576 rows by 16,384 columns, unless you're on an older version of Excel.

So maybe this is just a bug that should be reported to Appeon.

 Cheers

Comment
Then on the other hand, could you monitor your memory usage while exporting. You might know that powerbuilder can consume at the most 2GB (3GB if you trick the executable), but even before reaching those limits, you might run into memory problems, as powerbuilders puts memory an a stack that it uses and no one - that I know - knows how that stack is managed. It seems pretty random to me.
  1. Miguel Leeuwe
  2. Thursday, 26 March 2020
There are no comments made yet.
  1. Thursday, 26 March 2020
  2. PowerBuilder
  3. # 2
  • Page :
  • 1


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