I have a very strange situation with Powerbuilder 12.1. I have two issues that may be related - mainly because it's for the exact same datawindow report.
Issue #1: Somehow and somewhere, the capability to display contents of a DataWindow during Debug and Runtime has been lost. You no longer can see the contents of a datawindow during debug and runtime.
BUT when you go into the datawindow in Design mode, it prompts you for the values for the parameters it needs, the contents are displayed just fine.
EDIT: RESOLVED. This was due to a Powerbuilder using an integer instead of a long variable. The identity ID in the database exceeded the upper bound of a PowerBuilder 16 bit integer (32,767). I updated the logic to use long, and that resolved this issue #1.
ISSUE #2:
When I ran the report code using the same datawindow mentioned in Issue #1 above in debug mode to generate a new report file, it worked -- in DEBUG mode only. Runtime failed -- I was getting a -1 error during runtime for the exact same call.
Here's the code snippet using DATASTORE (I already tried DataWindow just to see and that too failed):
datastore lds_blarney_report
lds_blarney_report = CREATE datastore
iw_main_sheet.wf_write_log("Retrieving report data")
lds_blarney_report.dataobject = as_datawindow
lds_blarney_report.SetTransObject(sqlca)
ll_ret = lds_blarney_report.retrieve(al_file_no, "%")
In DEBUG mode: the last line returns some positive non-zero value and a report is generated In RUNTIME mode: the last line returns -1 (according to Sybase, Retrieve returns the number of rows displayed (that is, rows in the primary buffer) if it succeeds and -1 if it fails. If there is no DataWindow object assigned to the DataWindow control or DataStore, this method returns -1.)
So why did retrieval work in Debug time in creating a new report file, but fail in runtime?