Call different Reports from different menuitems having one class

Hi,

I want to generate PROFORMA CONFIRMATION of two types INTERNAL and EXTERNAL (both of these reports are having different modification). Both the menu items Internal or External Confirmation should call the same class with each menu opening different reports.

In short I need to call different reports from the same class via differnt menuitems .

MenuFunction menuFunction;

Args args = new Args();

;

args.record(Tablename);

if(Condition1)

menuFunction = new MenuFunction(menuitemoutputstr(MenuItem1), MenuItemType::Output); //call to 1 report

else

menuFunction = new MenuFunction(menuitemoutputstr(MenuItem2), MenuItemType::Output); //call to other report

menuFunction.run(args);

Thanks Monika,

Does this method needs to be called from the class or should I write code on the clicked method of the menuitems.

If both the reports uses the same data source and have same logic but only differs in their design, then you can have a single report with multiple design rather than having two different reports…

Kranthi is right. If logic is same then modify the same report accordingly.

You can call this method from a form button click. Depending on the condition, call specific menuitem.

I cannot call this method from the form buton click as I want to print the report after the posting confirmation form.

I even tried to make two report designs but am not getiitng where to place the code for checking whether the called menu item is internal confirmation or only comfirmation.

Can u please let me know where shall I code the condition for differnt designs based on menu items .

Thanks and Regards.

you can write this in init method the report after super().

like if (element.args().menuItemName() == menuItemOutputStr(Internal))

element.design(“Design Name”);

else

//////

Thanks Kanti and Monica,

What I have done is created a new document status called Internal Confirmation and passed it accordingly from the print Journal method of respective classes to the Print Journal of CustJournal (table) which selects the menuType Reports on the basis of document Status .

I guess your solutions would have worked it there was a call to the report from the Class Itself but since the report gets called from the method of the Table in which we dont have control of the called menuitem .

Thanks again for your idea.

Hi kranthi,

in my case i have to create a form with 3 fields.i have to open that form through navigation pane as well as menu item button in list page.

while opening up the form in navigation pane one particular field should be in edit mode.

while opening up the form through list page menu item button the same field should not be in edit mode.

if i set the property allow edit on : no,it get reflected in both the forms.

send me the solution as earlier.

Hi All,

In my case, i have two different designs of report. If the purchase type is “Puchase order”, the first design called “A1 Report” as to be executed. And if the purchase type is “Returned order”, the second design called “B1 Report” as to be executed. How do we call this in a report?? Any idea… Please update me the status ASAP.

Regards,

Zahir

Hi Monika,

How you will initiate to call different report designs using menu items. In my case, i need to call two different reports from same Copy/Original print management locations. How to do that? any idea

Regards,

Zahir