Hello,
I have a report (picking list) which prints out all rows on the picking list. But if I want to print just a single row on the picking list. For example, I just want to print the row which is currently selected/highlighted. Can this be done?
Regards
Tomas
0
Comments
If your "selection/highlight" is a field in the line table and you have that rec available to be filtered on your report request form then you can always place a filter and enable only the recs you want...
If not, then what do you mean by "selected/highlighted"? the user has selected a few recs in the lines of a pcking list and wants to print only them?
In that case you can run your report thru code but before you can perfomr something line vPLline.SETRECFILTER and then pass it as a parameter on your report run... Than way the record that is used in the report is already filter with the selected recs...
I hope this helps a bit...
Arhontis
https://forum.mibuso.com/search
What do you mean vPLine.SETRECFILTER? Can you show me with an example?
Regards Tomas
I meant SETSELECTIONFILTER. I copy/paste from C/SIDE help:
Then in your code you can copy that rec of the form to another record variable and pass it as a parameter to a REPORT.RUN, i.e. a report that has a list of customers and runs a report for the selected customers only:
Arhontis
https://forum.mibuso.com/search
// Tomas
You can also look at the Posted Purchase Receipt Form in the OnPush of the Print button which does a similar thing: and the printrecords procedure of the Return Receipt Header table follows: It is a little more complicated, but you can see how it works...
Arhontis
https://forum.mibuso.com/search
why calling REPORT.RUNMODAL with ReturnRcptHeader instead of with Rec variable directly?
You perfrom the: To make the PurchRcptHeader to be filtered with the records that the user has selected on the form, and then call the report to run with that filtered variable (PurchRcptHeader) to display the recs that are within the filter...
You could always use the Rec variable instead of the additional variable (PurchRcptHeader) but that way the form will be filterd also and you will see (on the form) only the filtered records.
By using the addiiton variable you leave the Rec record unfiltered and you filter the PurchRcptHeader... So the only code you actually need (but with your own vatiable, like the picking list line) is:
I hope it is more clear now...
Arhontis
https://forum.mibuso.com/search
if SETSELECTIONFILTER and REPORT.RUNMODAL commands are in the same object (e.g. form) then yes...I has no doubt that we should use additional variable instead of Rec
BUT my question was why navision default code (i.e. TB 6660 PrintRecords() ) has to use additional variable?
IMO the Rec var inside PrintRecords is already pointing to filtered records from calling object (form) so using it directly with REPORT.RUNMODAL will not affect records displayed on the form.
I hope you can explain more...
The "PrintRecords" procedure exists in many header tables, almost in all the posted...
Each procedure is almost alike the others, others have a parameter and called with that parameter, others use an additional var (like the question you asked)...
Some of them are also buggy and need modification to work properly...
That local variable in the procedure is not nessecary, if you check other PrintRecords procedures there is not there... and others have parameters...
Remember "If you see it in standard navision code it is not nessecary to be correct..."!!!
Have you solved your earlier issue about printing the user selected recs? :?:
Arhontis
https://forum.mibuso.com/search
This is gmorken's portion to answer...