1. Nick R
  2. PowerBuilder
  3. Monday, 15 June 2020 20:09 PM UTC

Hi,

I have a question with regards to "Save As" functionality. I have a report that gets generated basing on a date criteria. Recently, i choose to hide a particular field in a Design view of the Data Window(un-checking the "Visible" option). I run the same report, i do not see the field in report, which is a very happy path. However, when i choose the "Save As" option(Either from the File option or the little icon on the Menu bar) and save the report to Excel, i again see the field displayed in Ms-Excel. Can someone please help me navigating the logic behind the "Save As" functionality? I am not sure if that is a Template based or, Dynamically saved data to Excel with rows.

thanks!

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 15 June 2020 20:25 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Nick;

  The DW does not care about columns that are hidden or visible. The SaveAs() command takes everything in the DWO;s "primary" buffer. AKA - what the SQL Select has in it column wise. So the only way to resolve your hidden column challenge is ...

1) Drop the Column from the SQL Select.

2) Copy only the columns you want the Excel user to see to a 2nd DWO in a DataStore and do a SaveAs() from there.

3) Use the DC's Modify() command to remove the Column(s) you do not want the user to see just before the SaveAs() command is used. For example:

   DC.Modify ("destroy salary")

4) Same as #2 & #3 ...

A) Complete RowsCopy from DC to a DS

B) Destroy the column in the DS

C) DS.SaveAs()

D) Destroy the DS

HTH

Regards ... Chris

 

Comment
  1. Nick R
  2. Wednesday, 17 June 2020 18:40 PM UTC
Wonderful. that worked. Thanks!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 17 June 2020 19:22 PM UTC
Hi Nick .. that's Awesome! Thanks for letting us know! :-)
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 15 June 2020 20:45 PM UTC
  2. PowerBuilder
  3. # 1

i think of the standard saveas excel format as a 'raw' format - no computes and every column is in excel.  this can be useful in some situations. 

IMO, in most situations you want to see computes that are in the detail band, and you don't want to see non-visible columns. 

as chris states, the ways to do is to copy the columns and computes to a datastore.  all visible columns and computes would have a column in the datastore.    you build a datastore based on the format of your report at runtime.  this process can be a bit slow due to coping of the data from the original datawindow/datastore.

Comment
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.