Saving data in an external file

While previewing, you can save the data retrieved in an external file. Note that the data and headers (if specified) are saved. Information in the footer or summary bands is not saved unless you are saving as PDF or as a PSR file.

To save the data in a report in an external file:

  1. Select File>Save Rows As from the menu bar.

    The Save As dialog box displays.

  2. Choose a format for the file from the Save As Type drop-down list.

    If you want the column headers saved in the file, select a file format that includes headers (such as Excel With Headers). When you select a with headers format, the names of the database columns (not the column labels) are also saved in the file.

    When you choose a format, InfoMaker supplies the appropriate file extension.

  3. For TEXT, CSV, SQL, HTML, and DIF formats, select an encoding for the file.

    You can select ANSI/DBCS, Unicode LE (Little-Endian), Unicode BE (Big-Endian), or UTF8.

  4. Name the file and click Save.

    InfoMaker saves all displayed rows in the file; all columns in the displayed rows are saved. Filtered rows are not saved.

The rest of this section provides more information about saving data in PDF, HTML, and PSR formats.

For more information about saving data as XML, see Exporting and Importing XML Data

Saving the data as PDF

InfoMaker provides two ways to save a report or DataStore in Portable Document Format (PDF).

Using Ghostscript

By default, when you select File>Save Rows As and select PDF as the file type, the data is printed to a PostScript file and automatically distilled to PDF using Ghostscript. This option provides a robust solution that can save most types of reports.

Installing Ghostscript and PostScript drivers

For licensing reasons, Ghostscript and the PostScript drivers required to use the distill method are not installed with InfoMaker. You (and your users) must download and install them before you can use this technique. See System requirements for the distill method.

Using PDFlib

Starting from InfoMaker 2017, an alternative method is provided to directly print data to PDF without needing to install any third-party tool or driver or make any configuration. This method relies on a light-weight software called PDFlib which is automatically installed with InfoMaker at no cost. And PDFlib is automatically packaged into the application executable as well without requiring the developer to make any configuration or selection during the building process.

Using XSL-FO and Java printing

Building on the ability to save data as XML, InfoMaker can also save the report's data and presentation to PDF by generating XSL Formatting Objects (XSL-FO). This option provides a platform-independent solution by rendering the report using a Java process rather than the Microsoft GDI. It also offers the possibility of customizing the PDF file at the XSL-FO stage.

The XSL (Extensible Stylesheet Language) W3C Recommendation has two parts, XSLT and XSL-FO. XSLT provides the transformation typically used to present XML documents as HTML in a browser. XSL-FO provides extensive formatting capabilities that are not dependent on the output format.

For more information about XSL, see the latest version of the Extensible Stylesheet Language (XSL) at http://www.w3.org/TR/xsl/.

Limitations

The Ghostscript method currently does not support OLE and RichText reports. The PDFlib method currently does not support OLE reports. The XSL-FO method currently does not support OLE, RichText, graph, and composite reports.

The PDFlib method currently does not support the background property for the report.

Saving as PDF using the distill method

If you want to save to PDF using the distill method, you do not need to change any properties. The distill method is used by default when you select Save Rows As from the File menu in the Report painter and select PDF as the file type, or when you use the SaveAs method with PDF! as the file type.

InfoMaker uses a PostScript printer driver specifically designed for distilling purposes to configure the PDF output. You can choose to use a different PostScript printer driver if you want to customize your PostScript settings for generating PDF.

In the Report painter

To use a custom PostScript printer driver, you must set some properties.

To save customized distilled PDF output in the Report painter:

  1. Select the Data Export tab in the Properties view for the report.

  2. Select PDF from the Format to Configure drop-down list, select Distill! from the Method drop-down list, and select the Distill Custom PostScript check box.

  3. Select the Print Specifications tab and specify the name of the printer whose settings you want to use in the Printer Name box.

  4. Save the report, then select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.

System requirements for the distill method

Users must have administrative privileges to create a PDF file.

To support saving as PDF using Ghostscript, you must download and install Ghostscript files on your system as described in Using the GNU Ghostscript distiller. You also need to install PostScript driver files.

If you have installed a PostScript printer on your computer, the PostScript driver files required to create PDF files, PSCRIPT5.DLL, PS5UI.DLL, and pscript.ntf, are already installed. You must use the version of these files that is appropriate to the operating system where the PDF file is created. You should copy the files to the Appeon\Shared\PowerBuilder\drivers directory.

If you have never installed a PostScript printer, use the Printers and Faxes option in the Windows control panel to install a generic PostScript printer. If the Pscript5.dll has never been installed, you may be prompted to insert the Windows install CD.

Other related files are installed in Appeon\Shared\PowerBuilder\drivers.

When you deploy applications that use the ability to save as PDF with the distill method, you must make sure your users have installed Ghostscript and have access to the drivers directory.

See Using the GNU Ghostscript distiller for more information about redistributing these files.

Saving as PDF using PDFlib

If you want to save to PDF using PDFlib, you must set one or more properties before saving.

In the Report painter

In the Report painter, you set PDF export properties on the Data Export page in the Properties view.

To save PDF output using PDFlib in the Report painter:

  1. Select the Data Export tab in the Properties view for the report.

  2. Select PDF from the Format to Configure drop-down list and select NativePDF! from the Method drop-down list.

  3. Select a standard from the PDF Conformance list.

  4. Select the paper size and orientation in two methods:

    • Method 1: select the "Use These Two Settings in Print Specifications" check box, so it uses the paper size and orientation settings in the Print Specification page;

    • Method 2: keep the "Use These Two Settings in Print Specifications" check box unselected, and select from the Paper Size list and the Orientation list in the current Data Export page;

  5. Save the report, then select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.

Saving as PDF using XSL-FO

If you want to save to PDF using XSL-FO, you must set one or more properties before saving.

In the Report painter

In the Report painter, you set PDF export properties on the Data Export page in the Properties view.

To save PDF output using XSL-FO in the Report painter:

  1. Select the Data Export tab in the Properties view for the report.

  2. Select PDF from the Format to Configure drop-down list and select XSLFOP! from the Method drop-down list.

  3. (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.

  4. Save the report, then select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.

    InfoMaker saves the data in the report 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.

Saving as XSL-FO

You can also save a report as XSL-FO, then use the processor of your choice to convert the XSL-FO string to the format you want, applying your own customizations to the conversion. Processors such as the Apache XSL Formatting Objects processor (FOP) can convert XSL-FO documents into several output formats including PDF, PCL, and AWT.

In the Report painter, select File>Save Rows As and select XSL-FO as the file type.

For a report named dwemp, the following command lines show the FOP syntax for producing a PDF, a print preview rendered on screen (-awt), and printable output rendered and sent to a printer (-print):

Fop dwemp.fo dwemp.pdf
Fop dwemp.fo -awt
Fop dwemp.fo -print

For more information about using FOP, see the FOP page of the Apache XML Project web site.

System requirements for XSL-FO

The Apache XSL Formatting Objects processor (FOP) and the Oracle JDK are installed with InfoMaker to support saving as XSL-FO, saving as PDF using XSL-FO, and Java printing. Both are installed in the Appeon\Shared\PowerBuilder directory.

When you deploy applications that use XSL-FO or Java printing, your users must have the FOP directory and the Java Runtime Environment installed on their computers. For more information, see Using the Apache FO processor.

On Windows DBCS platforms, you also need to install a file that supports DBCS characters to the Windows font directory, for example, C:\WINDOWS\fonts. To use these fonts, the userconfig.xml file in the FOP conf directory must be modified to give the full path name of the files you use, for example:

<font metrics-file="C:\Program%20Files\Appeon\Shared\PowerBuilder\fop-0.20.4\conf\cyberbit.xml" kerning="yes" embed-file="C:\WINNT\Fonts\Cyberbit.ttf">

For more information about configuring fonts, see the Apache web site.

Saving the data in HTML Table format

HTML Table format is one of the formats in which you can choose to save data. When you save in HTML Table format, InfoMaker saves a style sheet along with the data. If you use this format, you can open the saved file in a browser such as Internet Explorer. Once you have the file in HTML Table format, you can continue to enhance the file in HTML.

About the results

Some presentation styles translate better into HTML than others. The Tabular, Group, Freeform, Crosstab, and Grid presentation styles produce good results. The Composite, RichText, OLE 2.0, and Graph presentation styles and nested reports produce HTML tables based on the result set (data) only and not on the presentation style. Reports with overlapping controls in them might not produce the results you want.

To save a report as an HTML table:

  1. Open a report.

  2. Open the Preview view if it is not already open.

  3. Select File>Save Rows As from the menu bar.

  4. Choose the HTML Table format for the file from the Save As Type drop-down list.

  5. Name the file.

    InfoMaker creates a file using the name you supplied and the extension htm.

  6. Open a Web browser.

  7. Use the browser's file open command to open the HTML file.

Working with PSR files

A PSR file is a special file with the extension PSR created by PowerBuilder, InfoMaker, or DataWindow Designer.

Windows and PSR files

When InfoMaker is installed, the PSR file type is registered with Windows.

A PSR file contains a report definition (source and object) as well as the data contained in the report when the PSR file was created.

Figure: PSR file

About reports

A report is the same as a nonupdatable DataWindow object. For more information, see About reports.

You can use a PSR file to save a complete report (report design and data). This can be especially important if you need to keep a snapshot of data taken against a database that changes frequently.

How PSR files are created

InfoMaker creates a PSR file when you:

Opening a PSR file

When you open a PSR file, InfoMaker displays the report in the Report painter. If InfoMaker is not already running, opening a PSR file automatically starts InfoMaker. You can open a PSR file in File Manager or Explorer, in a mail message, and using the File menu in the Report painter.

To open a PSR file in InfoMaker using Explorer or File Manager or from a mail message:

  • Double-click the PSR file name.

    InfoMaker displays the report.

To open a PSR file from the menu bar in the Report painter:

  1. Select File>Open File from the menu bar.

    The Select a File Name dialog box displays.

  2. Select the PSR file you want. Change drives and directories if needed.

    The Report painter displays the report in the Design view.

  3. Select View>Preview to preview the report.

PSR files and retrieval

When you are previewing a PSR file, you see the data that was saved in the file when it was created. This is true until you explicitly retrieve data again using the Retrieve button or Rows>Retrieve from the menu bar.

If you attempt to retrieve data with a PSR file, you must be sure that you are properly connected to the right database. Otherwise, you will receive a database error message.

If you retrieve new data while previewing a PSR file, you cannot go back to the old data contained in the file. To go back to the old data, you must leave the PSR file without saving and then reopen the PSR file.

Mailing reports

While previewing in the Report painter, you can mail a report as a PSR file to an InfoMaker user who is using a MAPI-compliant mail system such as Microsoft Exchange. (MAPI stands for messaging application program interface and is one of the programming interfaces to mail systems.)

To mail a report:

  1. While previewing a report in the Report painter, select File>Send from the menu bar.

    If you are not logged on to your mail system, you will be prompted for your password.

  2. Enter your password and click OK.

    A form for mailing the report displays. InfoMaker creates and attaches the appropriate PSR file (which holds the report and data).

  3. Complete the form and send the message.

    InfoMaker mails the PSR file. The recipient can open the report by double-clicking it if InfoMaker is installed.