Print a different header depending on the page no.

Alisha
Member Posts: 217
Hi,
I have a report that i need a different header depending on the page no., but i can't use pageno because this needs to be done for every different record on the headers, for example an Invoice that uses 2 pages to show all the lines, I want a different header in each page. Using PAGENO would work if I only print 1 invoice, but not if I print 2 invoices...
How can I do this?
Many thanks!
I have a report that i need a different header depending on the page no., but i can't use pageno because this needs to be done for every different record on the headers, for example an Invoice that uses 2 pages to show all the lines, I want a different header in each page. Using PAGENO would work if I only print 1 invoice, but not if I print 2 invoices...
How can I do this?
Many thanks!
0
Comments
-
Hi,
Have you tried using a TransHeader? Maybe that could help :-k0 -
Yes, i've tried it but it does not work, for the transheader to work it has to belong to the dataitem that shows in more than one page, and that's not the dataitem that the header belongs too... lets say that the header is from "Sales Header", and the transheader should be from the "sales lines", but i cannot use it because it wouldn't be in the appropiate position in the report..
Thanks for the idea though.0 -
Thats not the easiest of report structures to get working but I find those kind of things can be done if you use an integer dataitem as a "master" or "parent" dataitem. Just have it set to show 1 record or apply a filter of:
SETRANGE(NUMBER,1);
Then insert 2 headers that have the "print on every page" property set to true. Then in the OnPreSection (check trigger name) of each of those header sections check if the current page number matches what you want to show and hide or show the section with:CURRREPORT.SHOWOUTPUT(true/false);
Just rough idea of something to try.0 -
That does not work either, because if I print 2 invoices (each one with two pages), the page numbers would be 1,2,3,4, and I need one type of header in pages 1 and 3 (first page of every invoice) and the other type in pages 2 and 4 (rest of pages of every invoice).
That solution would work if PAGENO would be reseted every new document no., but that's not how Navision works...0 -
The PAGENO is reset for each document no. - or should be at least!
Do you want to print Header Type 1 for the first page of every invoice, then Header Type 2 for each subsequent page of that inoice?
You can do this quite simply:
Have two header sections in your report
e.g. PageLoop, Header (1)
PageLoop, header (2)
Then control the visibility by placing this code OnPreSection() of PageLoop, Header(1):CurrReport.SHOWOUTPUT(CurrReport.PAGENO = 1);
And this code OnInPreSection of PageLopp, Header(2):CurrReport.SHOWOUTPUT(CurrReport.PAGENO > 1);
0 -
Actually my report is not "Sales Header"/"Sales lines", but the main dataitem is Job, and then there are other dataitems below.
However the PAGENO is not reset every new job no.... that's why I thought i didn't happen, but you are right, I've checked the Sales invoice, and in that case it is reset... do you know why it happens with one report and not the other? Is there any property to get this to work?
Thanks a lot0 -
Alisha wrote:Actually my report is not "Sales Header"/"Sales lines", but the main dataitem is Job, and then there are other dataitems below.
However the PAGENO is not reset every new job no.... that's why I thought i didn't happen, but you are right, I've checked the Sales invoice, and in that case it is reset... do you know why it happens with one report and not the other? Is there any property to get this to work?
Thanks a lot
The PAGENO is normally handled automatically by the report engine itself.
Maybe you have some code in there which programatically handles page numbering? Is this a custom report or is it based on a standard NAV report?0 -
No, there's no code messing with the PAGENO, I think it's a custom report (I didn't do it originally, I'm just modifying it!). The structure is this:
Job
Integer (for the header with Job data in everypage..)
Extended Line Text
Contact Budget
Job Budget
I need the job header in very page (different for pages >1), but it is not reset after every different job no...
Any idea?0 -
Mmmhh, I think the indentation of the dataitems didn't show properly :oops:
Anycase, I solved the problem by reseting the PAGENO myself! (I think I should have thought of this before #-o #-o ).
Thanks all for your help!!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions