Options

CurrReport.NEWPAGE function in RTC reports

ajaybabuChajaybabuCh Member Posts: 208
edited 2010-04-22 in NAV Three Tier
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

Comments

  • Options
    kinekine Member Posts: 12,562
    Yes, this part of classic client report is not transformed into the RDLC. You need to solve it in RDLC... the classic report is only data source for the RTC reporting.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    ajaybabuChajaybabuCh Member Posts: 208
    Hi Kine

    Can you give example code.

    Thanks and Regards
    Ajay
  • Options
    amol_dj_007amol_dj_007 Member Posts: 14
    hi,

    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.
  • Options
    ajaybabuChajaybabuCh Member Posts: 208
    Hi Amol

    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
    Ajay
  • Options
    amol_dj_007amol_dj_007 Member Posts: 14
    Kindly select the body whose line you want to restrict on a perticular page.

    Go into its expression and write the CELING function.
  • Options
    ajaybabuChajaybabuCh Member Posts: 208
    Can anybody give some example code to get CurrReport.NEWPAGE feature in RTC reports
    Ajay
  • Options
    liu19801109liu19801109 Member Posts: 8
    To create a new page number variable to replace the CurrReport.NEWPAGE property
    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.
Sign In or Register to comment.