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:
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
Answers
you can set filter in report request page in No. field like 1001..1010 or 1001|1003|1005 etc.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
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.
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.
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?
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: 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 !!