Moved to new question : importdatawindow-using-pdfdocument-is-returning-1-for-composite-report
PDFdocument lpdf_doc
lpdf_doc = create PDFdocument
.....
.......
dw_1.settransobject( sqlca )
dw_1.retrieve( report_number )
dw_1.object.DataWindow.Export.PDF.Method = NativePDF!
dw_1.Object.DataWindow.Export.PDF.NativePDF.PDFStandard ='1'
dw_1.Object.DataWindow.Export.PDF.NativePDF.CustomSize = '5'
ll_return = lpdf_doc.importdatawindow( dw_1 )
[THIS IS THE CALL THAT THROWS THE ERROR]
We have had a user experiencing this issue for some time now.
The previous code used a simple dw_1.SaveAs ( ls_network_path, PDF!, TRUE) with no issues.
Prior to switching over to using PDFDocument, I had published a question regarding if GhostScript was still required if we were switching over to using PDFDocment. I believe the response was that one didn't necessarily have anything to do with the other.
So we have moved forward with the 2022R3 migration, using the PDFDocument to build the PDF and save to a network location.
However, we are not using a stored procedure as datasource, but we are building a composite report (comprised of 15 separate datawindows)
However, most of the headers say "release 12.5;" and a couple say "release 19;"
Another thing that is peculiar in diagnosing this bug, from my development machine, while running the executable, I have no issues completing the process which calls IMPORTDATAWINDOW (which is triggering the error message above for one of our users), followed by calling SAVE using PDFDocument. Not sure if other users are also experiencing the same issue, but clearly it is has been an issue for this one user.
Last thing, the error is fired the first time through the code, the next time the user runs it saves without issue.
The problem is caused because the DWO's source is *not* migrated to PB 2022 Rx from PB 2019 R3 and thus that old syntax is not processed properly when performing the ImportDatawindow() command.
The fix would be to edit the PB 2019Rx DWO's source in PB 2022 R3 and change the 1st lin3 from "release=19;" to "release=22;" & then save the DWO source back to its PBL to have the DWO properly migrated to the 2022 R3 standard . Then the ImportDatawindow() command should now work OK.
Regards .. Chris
Actually, what I say is that I don't have a problem even when using a datawindow created with older PB release (in this case 2019 R3). It also works with a datawindow created from PB 2022 R3 using a stored procedure as datasource.
Andreas.