1. Miguel Leeuwe
  2. PowerBuilder
  3. Wednesday, 17 January 2024 18:01 PM UTC

Hi and happy new year,

We use dw2xls (Desta) for exporting dws to Excel. There's a specific dw that failed to generate an xlsx that could be opened by Excel. (Ironically, LibreOffice has no problems with it).

So after spending quite some time, I fixed the problem by making a specific field invisible before the export. This field had the "Password" attribute checked. So before the export, I set the field to invisile and after, I set it to visible again. However, that last Modify() doesn't seem to work. The execution of the Modify() returns no error, but the column does no show.

Now I know that grid datawindows are a bit special, but has anyone found the same problem and maybe have a solution?

For now, I've solved the problem by doing a GetFullState before setting the field invisible and a SetFullState after the export to excel.

regards,

MiguelL

Accepted Answer
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 18 January 2024 01:59 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi, Miguel -

Because of the way the grid continually displays columns adjacent to one another, the normal technique of toggling a column object's visible status doesn't work. If you are using the PFC, the Grid DataWindow service object (n_cst_dwsrv_grid/pfc_n_cst_dwsrv_grid) contains some methods you can use to record and later restore the column layout, such as of_Populate() and of_RestoreOriginalLayout().

Best regards, John

Comment
  1. Miguel Leeuwe
  2. Thursday, 18 January 2024 10:30 AM UTC
Hi Sivaprakash, thanks, but that's not as easy as simply using GetFullState and SetFullState.
  1. Helpful
  1. Miguel Leeuwe
  2. Thursday, 18 January 2024 10:48 AM UTC
@René

Hi, yes it DOES work I just tested it. The only thing is that it would leave a blank column in my export, so I'm sticking to the Get- and SetFullState solution.

regards
  1. Helpful 1
  1. René Ullrich
  2. Thursday, 18 January 2024 11:04 AM UTC
@Miguel

Interesting. In documentation the property is not marked as modifyable.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from 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.