A PDF report consists of number of report pages. A page is associated with following attributes - called Page Attribute.
When setting a page, default font Courier (Fixed width) is used. Based on various page attributes, AePlus Reporting System calculates the print area for the page. Based on font size, it calculates number of standard lines that can be printed on the page so that 'rpt_page_header' Report Event triggers appropriately. It also calculates number of standard characters that a print line can accommodate.
A page in the report can be a mix of any page sizes. For example, you can start the report with page size A4 - Portrait and then change it to A4 - Landscape and then to A3 - Portrait and back to A4 - Portrait.
AePlus reporting system automatically adjusts attributes of the page whenever page is altered so that print contents on the page can be adjusted using current attributes of the page thru PeopleCode.
Developers can programmatically alter the page size based on the data contents that is being reported on the page. For example, if for company code "K23", page orientation should be Landscape, following PeopleCode in the 'rpt_before_company' Report Event Function is required.
Function rpt_before_company(&AEP_RPT As AEP_RPT_DEMO:AEP_RPT_DEMO, &Rec As Record); if &Rec.GetField(Field.COMPANY).Value = "K23" then &AEP_RPT.NewPage(&Rec, "PageOrientation=L"); end-if; ... ... End-Function;
If you also want to create a new pdf file at this point, following PeopleCode is required.
Function rpt_before_company(&AEP_RPT As AEP_RPT_DEMO:AEP_RPT_DEMO, &Rec As Record); if &Rec.GetField(Field.COMPANY).Value = "K23" then &AEP_RPT.NewPage(&Rec, "PageOrientation=L, NewFile=;"); end-if; ... ... End-Function;
If you want to create an individual pdf file with this company as the filename, following PeopleCode would be required.
Function rpt_before_company(&AEP_RPT As AEP_RPT_DEMO:AEP_RPT_DEMO, &Rec As Record); Local string &filename; &filename = "company_" | &Rec.GetField(Field.COMPANY).Value; &AEP_RPT.NewPage(&Rec, "PageOrientation=L, NewFile=" | &filename | ";"); ... ... End-Function;