How to handle check box and print 1 row of item

Hi All

I have a question. Before that let’s me explain, I had add in a Print Summary check box in the dialog screen. When user ticked, it will print 1 row of item otherwise it will print all the item as the current report. Now I would like to ask, How to write the code and how to generate the code? where to write that code? I’m a newbie in Dynamic AX. Someone please help me.

Hi Lursa

Which AX version?

However, the requirement is not so easy for a newbie…

For AX 2009 you can verify the standard report “VendPurchaseDistribution_NA”

For AX 2012, currently I don’t remember any standard example but according with the requirements, you can achieve this with two queries or using a data provider. The last one use a temp table that could be loaded in different way according if summary or not.

If you give me more details i will try to guide you in the right solution.

Regards

Hi Denis,

I use AX 2009. I already successfully create a check box “Print Summary” as figure1 below. But now I having a problem how to code the programming. Currently when I print the report, it will printing repeated data on monthly report as figure2 below. And now I need to do some amendment to make sure it will print 1 row of item when check box is ticked as highlighted in red rectangle, otherwise it will print all the item as the current report.

Help me how to write the code and where to write that code?

Figure1

Figure2

Hi

What’s is the report datasource ?
Is a query or a temp Table ?

Looking the picture i think is a temporary table.

So, according to the new check box you have to change the code used for initialize the temp table.
If true, you have to summarize the data by Item.

If you don’t want to modify the preload codes, you have to modify the fetch Report method and call the “super” only when change the Item.

However, the standard VendPurchaseDistribution_NA is a good startup for you.

Regards