web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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();
 
I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at
    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?
     
  • Community member Profile Picture
    2 on at
    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 .  
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 47 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
Pallavi Phade Profile Picture

Pallavi Phade 32

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans