Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

calling report in batch with custom print medium settings calls the report twice

(0) ShareShare
ReportReport
Posted on by 2
HI ,
 
I have requirement where in for all eligible records I have to print report individually . I have used sysoperation and in service class  process() I have made the desired changes .
When I give print medium as screen it is displaying proper reports ( number of records = number of reports )  but for custom print medium it is generating same report twice ( number of reports = 2*number of records ) ... pls help me in fixing this ..
 Adding the code in service class process method :
 
                args = new Args();                args.record(VendTable);                controller.parmReportName(ssrsReportStr(reportname, design));                controller.parmArgs(args);                            srsPrintDestinationSettings = controller.parmReportContract().parmPrintSettings();                srsPrintDestinationSettings.printMediumType(_contract.parmprintMediumType());                srsReportDataContract =  controller.parmReportContract();                dataContract = srsReportDataContract.parmRdpContract();                dataContract.parmVendAccNumber(VendTable.AccountNum);                dataContract.parmAsofDate(_contract.parmAsofDate());                controller.parmShowDialog(false);                controller.parmLoadFromSysLastValue(false);                controller.startOperation();
 
  • Community member Profile Picture
    2 on at
    calling report in batch with custom print medium settings calls the report twice
    Sorry and thanks @Martin , 
     
    So the On debugging I found it is hitting the code which belongs to a different model and it is making to call the startOperation() twice . I dont have access to those classes in my dev and also the necessary setup is missing for print destination that might be the issue so I have requested for the implementation code of custom print destination .
     
    Meanwhile now I change and set the print destination as Print archive and to my surprise what I see is ,it is printing same report over and over again for each record even on having different vendtable.accountNum .  
     
  • Martin Dráb Profile Picture
    234,656 Most Valuable Professional on at
    calling report in batch with custom print medium settings calls the report twice
    You're asking in the D365 general forum, but your question seems to be specifically about F&O. Please use an F&O forum next time.
     
    Let me try to post your code in a more readable way:
    args = new Args();
    args.record(VendTable);
    
    controller.parmReportName(ssrsReportStr(reportname, design));
    controller.parmArgs(args);
    
    srsPrintDestinationSettings = controller.parmReportContract().parmPrintSettings();
    srsPrintDestinationSettings.printMediumType(_contract.parmPrintMediumType());
    srsReportDataContract =  controller.parmReportContract();
    
    dataContract = srsReportDataContract.parmRdpContract();
    dataContract.parmVendAccNumber(VendTable.AccountNum);
    dataContract.parmAsofDate(_contract.parmAsofDate());
    
    controller.parmShowDialog(false);
    controller.parmLoadFromSysLastValue(false);
    controller.startOperation();
    What did you find when you debugged your code, before giving up and asking here?
    What can you tell us about the implementation of your custom print destination?
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans