Hi
I have created a simple report with Customer table as Data Item.
Displaying in the Body section a few fields.
I have written the following code in OnAfterGetRecord() of the Customer DataItem to print 4 records per page.
LinesPerPage += 1;
IF LinesPerPage = 5 THEN BEGIN
LinesPerPage := 1;
CurrReport.NEWPAGE;
END;
Once I completed my classic report, I did choose the "Create Layout Suggestion option". I saved layout , save and compiled the report.
I ran the Classic Report ,classic report displays 4 records for each page.
When I run the RTC report, It is not displaying in the same way as classic behaves.
Do I need to write some code in RTC reports to get "CurrReport.NEWPAGE" functionality.
Can anybody help me in this.
Thanks and Regards
Ajay
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Can you give example code.
Thanks and Regards
To limit no. of lines to be displayed per page in RTC Reports is done by using the celing function in RTC.
Kindly go through its proper format while writing this function.
This will solve your query.
Thanks for the information.
Still I would like to know how do we force to new page in RTC reports.
Is there any function/property in RTC similar to CurrReport.NEWPAGE.
Thanks and Regards
Go into its expression and write the CELING function.
In the Classic client, on the Tools menu, click Object Designer.
In Object Designer, select Report, select the report in which you use the CurrReport.NEWPAGE property, and then click Design.
On the View menu, click C/AL Globals.
In the C/AL Globals window, on the Variables tab, add the following variables.
Name DataType
PageGroupNo
Integer
NextPageGroupNo
Integer
On the View menu, click C/AL Code.
In the C/AL Editor, add the following code to the OnPreDataItem trigger to create and initialize the new page number variable.
Copy Code
IF ISSERVICETIER THEN BEGIN
PageGroupNo := 1;
NextPageGroupNo := 1;
END
For each place in the code where you call the CurrReport.NEWPAGE property in the Classic client, add code to increment the PageGroupNo variable, as shown in the following example.
Copy Code
IF ISSERVICETIER THEN BEGIN
PageGroupNo += 1;
END;
Note
You cannot add the line of code to section triggers. If you use the CurrReport.NEWPAGE property in a section trigger, then you must add the line of code to increment the PageGroupNo variable to a DataItem trigger instead.
On the View menu, click Sections.
Add a text box where the SourceExpr value is PageGroupNo. Add another text box where the SourceExpr value is NextPageGroupNo. Set both text boxes to be hidden. For more information, see How to: Add and Identify Hidden Fields.
Save and compile the report. For more information, see How to: Integrate Classic Client Report Designer and Visual Studio Report Designer.