Creating the Order Report (WinPrint)
Order Report (using WinPrint)
You will now create an Order report using the WinPrint2 Report wizard, based on the specifications below.
This diverges from the Order sample that ships with DataFlex, because this uses DataFlex Reports, which you may or may not have purchased. Therefore, we will use WinPrint here, so that everyone can complete this tutorial.
Creating the User Interface
Our first report sample will be a customer listing based on the cWinReport2 class. This report you are going to build is going to be very similar to the WinPrint report that you built using the WinPrint2 Report wizard in the Creating a WinPrint Report section, but we will make some changes while running the wizard and some more changes in the Studio after the wizard has completed.
-
Click on the Create New button on the Studio’s toolbar. Click on the View / Report tab of the Create New... dialog. Double-click the WinPrint2 Report Wizard icon.
-
Read the explanations on the first wizard page about what this wizard will do and click Next.
-
On the Names wizard page, enter
OrderReportas the object name,OrderReportas the filename, andOrder Reportas the description, then click Next. -
On the "Main Data Dictionary" wizard page, click on
OrderDetail - OrderDetail_DataDictionaryto select it as the data dictionary to be used, then click Next. -
On the "Reporting Order and Breakpoints" wizard page, select
index1: Order_Number, Detail Numberas the index to be used. -
Still on the "Reporting Order and Breakpoints" wizard page, check the checkbox in the Break column next to
OrderDetail.Order_Number, then click Next. -
On the "Header Style for Subheader 1" wizard page, select 'Allows the sub-header to display a list of fields which are selected below. Good for parent breaks' in the Header Style radio group. Add the fields
OrderHeader.Order_Number,OrderHeader.Order_Date,OrderHeader.Order_Total, andSalesPerson.Nameby clicking on the Add button. Click Next. -
On the "Body Section Fields" wizard page, add the fields
Vendor.Name,Inventory.Item_ID,Inventory.Description, andInventory.Unit_Priceby clicking on the Add button. Click Next. -
On the "Report Styles and Totals" wizard page, change the name of the Name field to
Vendorand adjust the Font Size from10to8. Test run the report.
Click the X button in the upper right-hand corner of the preview to close the WinPrint report viewer.
-
Back on the "Report Styles and Totals" wizard page, click Next.
-
On the "Filter Fields" wizard page, add the field
OrderHeader.Order_Numberby clicking on the Add button. Click Next. -
Click Finish on the last wizard page.
You should now be back in the Studio, with the newly created report view open in the visual designer.
- Click on the Run button on the Studio's toolbar. The Studio will compile and then run your project. When the application runs, you will notice that the running application has a Report menu next to the View menu, and it lists your newly created Report View.