Thursday, September 25, 2014
In databases from NAV versions earlier than 2013, it was very common for Page Number Functionality to be developed as follows:
1. Text Constant was created
2. TextBox control with SourceExp STRSUBSTNO(Text005,FORMAT(CurrReport.PAGENO)) was added to Header Section
Here is the step-by-step solution to how 1ClickFactory developers re-implement this task in a new NAV database to ensure that caption “Page” is always printed in correct language:
1. Open NAV Report Designer and modify Report Dataset row with Page Number Control, leaving only Text005 as a Data Source:
2. Open the report layout in Visual Studio, and move the rectangle containing Page Number Control to Report Header (you may download 1ClickFactory Report upgrade toolbar add-in for Visual Studio2013 (or for Visual Studio 2012) to do this faster).
NOTE: This step is needed because in Visual Studio, function Globals!PageNumber can only be used in the Report Header or Report Footer, but not in the MainTablix. Ifyour report was transformed by 1ClickFactory Report Transformation Services, then the raw transformed report has all rows placed inside the MainTablix. A Report Header or Report Footer should only be added if there was a Page Number Control inside the report.
3. Open the Expression of Page Number Textbox in Visual Studio and change the code to:
=Replace(ReportItems!STRSUBSTNO_Text005_FORMAT_CurrReport_PAGENO__.Value, "%1",Globals!PageNumber)