How to create Static Page Header or Static Page Footer After the transformation, Classic report headers and footers appear as RDLC report body headers and footers. However, RDLC reports have some limitations for text boxes in the report body. If Classic report header (footer) contains a text box for page number control, in RDLC report page number text box has to be moved from report body header (footer) to report header (footer) (see Figure 1). Figure 1. Connecting to development database To move page number text box from report body header (footer) to report header (footer) in RDLC report layout, follow these steps. In this article we user report 104 Customer – Detail Trial Bal. as an example on how to resolve one or another issue. 1. Opening report in Microsoft Visual Studio 1.1. Open Microsoft Dynamics NAV 2013R2 Development Environment and select database where you want to make adjustments. 1.2. On the Tools menu, click Object Designer. 1.3. Select report 104 Customer – Detail Trial Bal. and click Design. 1.4. On the View menu, click Layout (see Figure 2) and wait for Microsoft Visual Studio 2010 to start. How to create Static Page Header or Static Page Footer Figure 2. Opening report 104 Customer - Detail Trial Bal. in Microsoft Visual Studio 2. Moving report body header (footer) to report header (footer) using ReportUpgradeToolbar 2.1. Enable ReportUpgradeToolbar by clicking right mouse button on Visual Studio top menu (see Figure 3). Page 2 of 13 How to create Static Page Header or Static Page Footer Figure 3. Enable ReportUpgradeToolbar add-in 2.2. Press “To Header” button (see Figure 4). Figure 4. To Header function 2.3. In opened dialog select “Customer_Section_No_1_Header” rectangle, select mode “To Static header” and press OK (see Figure 5). Page 3 of 13 How to create Static Page Header or Static Page Footer Figure 5. Select mode 2.4. Reload the report (see Figure 6). Figure 6. Report reload 2.5. Header creation is finished (see Figure 7). Page 4 of 13 How to create Static Page Header or Static Page Footer Figure 7. The finalized report 3. Moving report body header (footer) to report header (footer) manualy 3.1. In Visual Studio, add report header by clicking Add Page Header (Add Report Footer) on the Report menu (see Figure 8). Figure 8. Adding report page header An empty report header (footer) should be inserted (see Figure 9). Page 5 of 13 How to create Static Page Header or Static Page Footer Figure 9. Empty report page header 3.2. On the Document Outline – Report pane, click on Rectangle1_1 (see under Report Body MainTablix). Now Rectangle1_1 is marked in grey border in the report layout on the right (see Figure 10). Figure 10. Selecting Rectangle1_1 in report layout 3.3. On the Edit menu, click Cut. You can also do this in the following ways: right click on selected rectangle in the report layout and click Cut; right click on Rectangle1_1 in the Document Outline – Report pane; hit Ctrl + X on the keyboard. Page 6 of 13 How to create Static Page Header or Static Page Footer 3.4. In the report layout, right click on the page header (footer) and click Paste. Rectangle1_1 will be pasted onto report header (footer) (see Figure 11). Figure 11. Pasting Rectangle1_1 in report header 3.5. To adjust Rectangle1_1 position in the report header (footer), select Rectangle1_1 in the Document Outline – Report pane. 3.6. In the Properties pane, under Position properties group, in the Location field, set Rectangle1_1 position to 0cm; 0cm (see Figure 12). Figure 12. Adjusting Rectangle1_1 position in report header 3.7. To check if Rectangle1_1 height fits report header (footer) height, select Page Header (Footer) in the Document Outline – Report pane and check the value in the Properties pane, under General Page 7 of 13 How to create Static Page Header or Static Page Footer properties group, in the Height field. This is the height of the report header (footer) (see Figure 13). Rectangle1_1 should be the same height. Figure 13. Checking report page header height 3.8. To change Rectangle1_1 height, select Rectangle1_1 in the Document Outline – Report pane and set the value in the Properties pane, under the Position properties group, in the Size field, change the second value (after semicolon) representing height to the same value as report header (footer) height (see Figure 14). You can also adjust the height by using your mouse. Figure 14. Adjusting Rectangle1_1 height 3.9. In Visual Studio, right click on the empty rows in the report layout and select Delete Rows (see Figure 15). Page 8 of 13 How to create Static Page Header or Static Page Footer Figure 15. Deleting empty rows in report layout 4. Fixing text boxes expressions in report header (footer) 4.1. In Visual Studio, right click on STRSUBSTNO_Text000_CustDateFilter_ text box and select Expression (see Figure 16). Figure 16. Opening Expressions page for text box 4.2. In the window that has opened, in the Set expression for: Value field change the value from =First(Fields!STRSUBSTNO_Text000_CustDateFilter_.Value) to =Fields!STRSUBSTNO_Text000_CustDateFilter_.Value Page 9 of 13 How to create Static Page Header or Static Page Footer and click OK (see Figure 17). Figure 17. Fixing expression value for text box (1) 4.3. Right click on COMPANYNAME text box and select Expression again. 4.4. In the window that has opened, in the Set expression for: Value field change the value from =First(Fields!COMPANYNAME.Value) to =Fields!COMPANYNAME.Value and click OK (see Figure 18). Figure 18. Fixing expression value for text box (2) 4.5. Right click on CurrReport_PAGENO text box and select Expression again. 4.6. In the window that has opened, in the Set expression for: Value field change the value from '=Globals!PageNumber Page 10 of 13 How to create Static Page Header or Static Page Footer to =Globals!PageNumber (uncomment by removing apostrophe ‘ ) and click OK (see Figure 19). If you need to reset page number when moving from one record to another (e.g. Sales Invoice or any other document) then you should do additional work for this as it is described in MSDN article “How To: Reset Report Page Numbers” Figure 19. Fixing expression value for text box (3) 5. Save report to store changes 5.1. Save the report in Visual Studio by clicking Save Report.rdlc on the File menu (see Figure 20). Page 11 of 13 How to create Static Page Header or Static Page Footer Figure 20. Saving report in Visual Studio 5.2. Select Microsoft Dynamics NAV 2013 R2 Development Environment and move to any other line. 5.3. In the dialog that has opened (see Figure 21), click Yes. Page 12 of 13 How to create Static Page Header or Static Page Footer Figure 21. Reloading transformed report in Microsoft Dynamics NAV 2013 Development Environment 5.4. Save report. Page 13 of 13
© Copyright 2024