Question Status

Verified
Jared Colton asked a question on 14 Nov 2013 4:59 PM

Our receiving team in the warehouse wants to print a simple part label when they are receiving items. I would like to add a button on the form Accounts Payable > Common > Purchase Orders > All Purchase Orders in the Generate group of the Receive Tab. When pressed, this button would print out a simple label report, printing one label for every line item on the selected purchase order in the form grid. I don't know how to pass the active grid selection of the form as a filter for the report. Simple examples would be greatly appreciated!

Reply
Verified Answer
angelsbadillos responded on 15 Nov 2013 10:58 AM

Simple code for passing a record as an arg to a report. Same as passing a record to a form

       Args                args = new Args();

       ;    

       args.name(reportStr(<reportname>));

       rr = classFactory.reportRunClass(args);

       args.record(<your table>);

       //Run report

       rr.init();

       rr.run();

Angel

Reply
Suggested Answer
Dominic Lee responded on 14 Nov 2013 11:48 PM

Hi Jared,

Firstly, you can gather the records selected in the grid by using MultiSelectionHelper class. You can find an example of it in the SalesCancelOrderDropDialog form (closeOk method).

Then, you will pass the selected records to a report. One way is to pass the selected recId's as a comma separated string to the RDP class and do the filtering there.

Kind regards,

Dominic

kind regards,

Dominic Lee

My blog | PBC

This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Reply
Suggested Answer
Dominic Lee responded on 14 Nov 2013 11:48 PM

Hi Jared,

Firstly, you can gather the records selected in the grid by using MultiSelectionHelper class. You can find an example of it in the SalesCancelOrderDropDialog form (closeOk method).

Then, you will pass the selected records to a report. One way is to pass the selected recId's as a comma separated string to the RDP class and do the filtering there.

Kind regards,

Dominic

kind regards,

Dominic Lee

My blog | PBC

This forum post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Reply
Verified Answer
angelsbadillos responded on 15 Nov 2013 10:58 AM

Simple code for passing a record as an arg to a report. Same as passing a record to a form

       Args                args = new Args();

       ;    

       args.name(reportStr(<reportname>));

       rr = classFactory.reportRunClass(args);

       args.record(<your table>);

       //Run report

       rr.init();

       rr.run();

Angel

Reply