Running Multiple Reports

AitorEG
Member Posts: 342
Hi everyone!
This is my first time I make a question here. I am new working with NAV, so I hope I don't ask any stupid issue...
I am trying to run different reports, this reports are invoices for diferent clients. I don't have any problem to run the report from the page of one specific invoice, but the problem comes when I want to run more than one report a time.
I have a page, with the list of the different invoices to run. My idea is to select different invoices from that list, and run each invoice separately. My code for this action is:
Is it possible to run different reports separately selected from a list? Where am I making the mistake?
Than you very much
This is my first time I make a question here. I am new working with NAV, so I hope I don't ask any stupid issue...
I am trying to run different reports, this reports are invoices for diferent clients. I don't have any problem to run the report from the page of one specific invoice, but the problem comes when I want to run more than one report a time.
I have a page, with the list of the different invoices to run. My idea is to select different invoices from that list, and run each invoice separately. My code for this action is:
PackHeader.RESET; CurrPage.SETSELECTIONFILTER(PackHeader); IF PackHeader.FINDSET THEN REPEAT REPORT.RUN(50014,TRUE,FALSE,PackHeader); UNTIL PackHeader.NEXT = 0;With this code, the output is just one invoice, with the header of the first customer, and a table with the movement of all the selected invoices, but merged in just one invoice.
Is it possible to run different reports separately selected from a list? Where am I making the mistake?
Than you very much
0
Best Answer
-
PackHeader.RESET;
CurrPage.SETSELECTIONFILTER(PackHeader);
IF PackHeader.FINDSET THEN REPEAT
PackHeader2.reset;
PackHeader2.setrange(filter producing single record based from PackHeader current record)
REPORT.RUN(50014,TRUE,FALSE,PackHeader2);
UNTIL PackHeader.NEXT = 0;
where PackHeader2 has the same definition as PackHeader5
Answers
-
I didn't understand why do you want to run separately.
you can set filter in report request page in No. field like 1001..1010 or 1001|1003|1005 etc.1 -
May be I'm not explaining OK. I have a list view, where I can see a group of invoices. The issue is that, I want to select a group of invoices, 2 for example, and preview each invoice separately. Now, with the code I have wrote just above, I merge all the selected invoices in just one, taking just the header of the first customer. I hope I have explained myself better
edit: If I select 2 invoices, the output is also 2 previews, but they are both the same. The headr of the first customer, and the movement of both invoices merged in 1 table.0 -
1. Report 50014 is probably wrong, because grouping lines from multiple documents under one header is wrong.
2. Variable PackHeader sent to report has filtered all records. You should use another record variable to filter exactly document from looping record.0 -
1. Report 50014 is probably wrong, because grouping lines from multiple documents under one header is wrong.
2. Variable PackHeader sent to report has filtered all records. You should use another record variable to filter exactly document from looping record.
1-You are talking about what I've said about grouping lines from different customers, am I ok?
2- Variable PackHeader has on it the records that have been selected from the list, and that seems to work fine, because I generate the same number of invoices as the number of invoices selected on the list.0 -
1. I don't know anything about your report, but it seems to consist of header and lines. Printing lines "owned" by another header under current header is wrong.
2. Report 50014 should print all headers in filtered range and this range is same in each loop - using record variable in RUN command sets filter, not exact record.0 -
1. I don't know anything about your report, but it seems to consist of header and lines. Printing lines "owned" by another header under current header is wrong.
2. Report 50014 should print all headers in filtered range and this range is same in each loop - using record variable in RUN command sets filter, not exact record.
2-So you are saying that "PackHeader" is a range. I understand that, because it has all the ocurrences selected in the list, so it is a group of invoices. What should be the best way to take the headers one by one?0 -
PackHeader.RESET;
CurrPage.SETSELECTIONFILTER(PackHeader);
IF PackHeader.FINDSET THEN REPEAT
PackHeader2.reset;
PackHeader2.setrange(filter producing single record based from PackHeader current record)
REPORT.RUN(50014,TRUE,FALSE,PackHeader2);
UNTIL PackHeader.NEXT = 0;
where PackHeader2 has the same definition as PackHeader5 -
If report will works correctly, you shouldn't need a loop. SETSELECTIONFILTER should be enough to print documents in one report - new page per each document - see standard report 2060
-
PackHeader.RESET;
CurrPage.SETSELECTIONFILTER(PackHeader);
IF PackHeader.FINDSET THEN REPEAT
PackHeader2.reset;
PackHeader2.setrange(filter producing single record based from PackHeader current record)
REPORT.RUN(50014,TRUE,FALSE,PackHeader2);
UNTIL PackHeader.NEXT = 0;
where PackHeader2 has the same definition as PackHeader
Thank you very much!!! It works perfectly with this:PackHeader2.SETRANGE("No.",PackHeader."No.");
Thank you again, as I said before, I have only spent working with NAV a few days, and really apreciate your help, and also thanks to @mohana_cse06 !!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