Skip to content

Converting a WinPrint Report

Converting a WinPrint 1 Report

This section discusses the changes required to modify a report that uses DataFlex's old WinPrint 1 technology into a report using WinPrint 2.

The easiest WinPrint reports to convert are those which use the WinReport class. To convert these to WinPrint 2 reports requires changes to only a few lines of code.

Step 1 – Use Package

WinPrint 2 is encapsulated in a new report class called cWinReport2. The first change you need to make is to include the package file which contains cWinReport2's class definition.

Use cWinReport2.pkg

Put this use statement in the top section of your report view's Outer-Component code.

Step 2 – Report Object Declaration

Next, you need to use the cWinReport2 class in your report object declaration. For example:

Object oCustomer_WinPrint is a cWinReport2  // WinReport
    ...
End_Object

DataFlex supports applications that use both WinPrint 1 and WinPrint 2 reports.

Improved Header Command Protection

When you build a WinPrint report, the various header commands—DFHeaderFrame, DFHeaderLineCheck, DFHeaderMargin, DFHeaderPos, and DFHeaderWrap—must be defined inside a DFBeginHeaderDFEndHeader block.

WinPrint 1 did not report an error when these commands were defined outside a DFBeginHeaderDFEndHeader block; however, the commands would not perform correctly. In WinPrint 2, an error is raised when a header command is defined outside a DFBeginHeaderDFEndHeader block.