I have a scenario,
I created a simple SSRS report using only SalesLine as data source with one parameter as SalesId.
For SalesId = XXX01 is having two lines
so if I pass XXX01 as parameter then two separate report should open on screen. It mean separate report for each line. If that SO is having 4 lines then 4 report should open for each line.
How to get this in AX 2012 R2 (CU7).
Of course you can execute four reports instead of one report, if it makes any sense to you.
What’s the problem? I would think that if you know how to do it once, you would know how to do it three more times.
Hi Martin.
In controller class if I used while loop then the 4 reports are getting opened but one by one. I mean to say the next report will open only when I closed the firs report.
Any guess what I am missing here?
You can use ReliableAsynchronous execution mode to print reports. But I guess you want to show them on screen, i.e. opening several report viewer forms. Am I right?
Yes Martin,
I want to show this all reports on screen.
Can you please give me short brief, how to use ReliableAsynchronous execution method. I am not aware of this.
Setting an execution mode is very simple. Example:
SrsReportRunController c = new SrsReportRunController();
c.parmReportName(ssrsReportStr(HcmDepartmentReport, DepartmentDesign));
c.parmExecutionMode(SysOperationExecutionMode::ReliableAsynchronous);
c.run();
You can learn more about execution modes in Introduction to the SysOperation Framework.
I think you would have to change how the controller shows the form, which probably is possible but it doesn’t have to be easy.
If I was you, I would try to avoid it. What would make much better sense to me is having a single report which gets SalesId and prints all lines.
Hi Martin,
Thanks for the reply.
Let me try this.
For easy understanding about the scenario I mentioned the SalesLine as a example. The actual scenario is different, similar to CustAccountStatement 
Hi Martin,
Can you please help me which I have same above requirement , If possible can you please give sample code .
Thanks in advance.
Thanks ,
Ravindar D
Rav, my answers above are full of speculations about Akshay’s situation. And I know even less about yours. Please explain what exactly you’re doing and what problem you have with it.
Hi Martin,
Thanks for earlier reply, I have one report with two designs , I need to open both reports with one click
Example: Report A
Design x
Design Y
Parameter : Cust account : 1001 when I click ok , I need to open both design in different windows.
Can you please advice me how to achieve this issue .
Thanks and Regards,
Ravindar Reddy D.
So what’s the problem? Maybe you don’t know how to print different designs. Maybe you can successfully print the reports and your only problem opening multiple report viewer forms at once. Or maybe something else that I can’t guess…
Issue opening multiple report viewer at once .
Thanks .
You have to detach the form. It’s already done in VendEUVatInvoiceController.dialogShow(), for example, so you can see it there.
Hi Martin,
Sorry for taking your time, I looking to open both designs parallel with one click.
Thanks .
Thanks Martin, Issue resolved.
Hi Rav,
How did you manage to print both the report design parallel, Can you let me know the solution.
1 Like
Well another solution would be to add some code in the main method of your Controller class let’s say for ReportA with ( DesignX and DesignY ) you have :
public static client void main(Args args)
{
ReportAController reportAController;
//define the new object for controller class
reportAController = new reportAController() ;
//pass the caller args to the controller
reportAController.parmArgs(args);
//set the report name and report design to run
reportAController.parmReportName(ssrsReportStr( ReportA , DesignX));
reportAController.parmDialogCaption(‘Report A’ );
//execute the report
reportAController.startOperation();
}
Then you simply add :
//set the report name and report design to run
reportAController.parmReportName(ssrsReportStr( ReportA , DesignY));
reportAController.parmDialogCaption(‘Report A’ );
//execute the report
reportAController.startOperation();
and you’ll have your 2nd design opening at the same time!
Hi Rouissi,
The above code work - first Report A - Design X opens, after the closing the report, then Report A - Design Y open.
But in my case both reports should open at the same time.
1 Like
Oh then you want both sets of code running simultaneously as 2 separate threads. A nice way to do that would be using batch jobs. This is the only way I know for now on doing mutli-threading in AX, here’s a good walkthrough :
www.artofcreation.be/…/
The thing is, in this case your users have to run the report as a batch job instead of running it as they do usually.