Wednesday, 25 November 2015

NAV 2009 Reports - Common Issue & Resolutions.. (Part 2)

Hi all,

As promised in the blog entry i will list down some common known things that we need to take care while estimating & developing RTC Reports in 2009 Versions.

* These are my faced issues and their resolutions, you may not agree with all these. If that will be case i would suggest you to share same with others.

Lets begin with RTC Report Header -
During development you might have seen that in standard reports there are basically two ways to display report Headers.

1) Using Page Header.
2) Using Header in Body.

When to use which?


Use Page Header when -
1) No conditional Data is a part of Header. (workaround exist from keeping the field as blank from classic).
2) Header is Required on all pages. ( there is not option to print page header in First Page Only).
3) Page x of y is required. (can't set this property in Body as total pages is a global variable).

Use Header in Body when-

1) conditional Data is a part of Header.
2) Header is Required on First  page only.
* IN Table Header there is a property to repeat on new page.

If you have a picture in the Page Header remember these things -

- You don't need to enlarge / size it to the size you want because the property is set to auto size.
- If you try to have a image box with the height that you want in report you will find a space between page header and body. (TESTED)
- If you have the above listed issue then reduce the height of picture box and see the difference.

Let's see RTC Report Footer -


During development you might have seen that in standard reports there are basically two ways to display report Headers.

1) Using Page Footer.
2) Using Footer in Body as Table Footer.


Use Page Footer when -
1) No conditional Data is a part of Footer. (workaround exist from keeping the field as blank from classic).
2) Footer is Required on all pages.
3) Footer Contain Less Data.

Use Footer in Body when-

1) conditional Data is a part of Footer.
2) Header is Required on Last  page only.
A common condition that occur Mostly "FOOTER ON BOTTOM OF LAST PAGE ONLY". 
This is a real business requirement. Suppose you have a sales invoice report which ends data in 2 pages but the last row of Sales Invoice Line comes in the second page 2'nd line.After that line your footer begins.
Will that invoice look likes a professional Invoice? 
No, then how can we achieve that? Have a look on the Report 1401, Cheque Report. As we remember the standard check also print the check information at the bottom of the last page.

If you see the footer is a part of Page Footer inside a rectangle (as we cannot use list / Table in Page Header and Footer) with a hidden condition =iif(CBool(ReportItems!IsLastRec.Value),False,True)
Where IsLastRec is a field in the Body of the Report and its value is set to 
=iif(CInt(CountRows()) = CInt(RowNumber("Table1_Group1")),True,False)

* I was unable to understand the condition so what i did is -
- Create a Boolean variable in classic with include in dataset to TRUE.
- Set the Boolean to True when my last record was printing. IF NEXT = 0 Then "X" = TRUE.
- Set the Boolean as visibility of the Rectangle in Report Footer.
* Remember by using the above listed method if the report is printing in more than 1 page, there will be a blank space in each page until last page. That is the space for the Page footer.

No comments:

Post a Comment