-
Krishna Mohan Gullap
- PowerBuilder
- Tuesday, 12 August 2025 10:12 PM UTC
I have a simple tabular datawindow, that has many records in the detail band and a summary band giving just a sum of all the individual row values against each column. There are no groups in the datawindow. The client wants to know if the summary values can be exported to the excel extract when he tries to do a SaveAs() on the report
This means that I have to write code to add those values to the excel file after performing a SaveAs() on the datawindow. Here is what I am thinking to do to achieve this:
- Obtain the name of the file that was created thro SaveAs(), in the same event/function that calls SaveAs()
- Open the file thro an OLE Object
- Find the last row of data in the file. Say the report has 100 rows of data in it
- Set the cursor in row 102 (1 blank row just for clarity and less clutter)
- Loop thro the controls in the summary band and obtain the values of the computed objects in the band (There are no other computed objects other than the ones I am intending to export, in this DW summary band)
- Read their values and write those values into adjacent cells
- Save and Close the excel file
I am not sure if the above approach would be the neatest way to do this. Please suggest if you think there are better ways to achieve this without using a third party tool
Thanks,
Krishna
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.