If you want to save to PDF using XSL-FO, you must set one or more properties before saving.
In the DataWindow painter, you set PDF export properties on the Data Export page in the Properties view.
To save PDF output using XSL-FO in the DataWindow painter:
Select the Data Export tab in the Properties view for the DataWindow object.
Select PDF from the Format to Configure drop-down list and select XSLFOP! from the Method drop-down list.
(Optional) If you want simultaneously to send the output directly to a printer using the Java printing option of the Apache FOP processor, select the Print Using XSLFOP check box.
Save the DataWindow object, then select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.
PowerBuilder saves the data in the DataWindow object to the file you specified. If you selected the Print Using XSLFOP check box, it also sends the PDF file to the default printer for your system.
In a script, set the Export.PDF.Method property to XSLFOP! before saving the DataWindow object as PDF using the SaveAs method with the SaveAsType PDF!. To send the PDF file directly to the default printer, set the Export.PDF.XSLFOP.Print property to 1 or Yes before saving:
int li_ret dw_1.Modify("DataWindow.Export.PDF.Method = XSLFOP! ") dw_1.Modify("DataWindow.Export.PDF.xslfop.print='1'") li_ret = dw_1.SaveAs("printed.pdf", PDF!, true)