Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Use multiple records in same report

(1) ShareShare
ReportReport
Posted on by 30
I am trying to use many records with my custom report but it end up creating reports as many as records are selected for example if I selected 2 records as shown I get 2 reports created not 1 report with both records.
 
any ideas to achieve this?
 
this is my controller class if needed
class CustStatementConsolidateController  extends CustAccountStatementExtController
{
    public static CustStatementConsolidateController construct()
    {
        return new CustStatementConsolidateController();
    }

    public static void main(Args _args)
    {
        SrsPrintMgmtFormLetterController controller = new CustStatementConsolidateController();

        controller.parmReportName(ssrsReportStr(CustAccountStatementConsolidate, PrecisionDesign1));

        controller.parmArgs(_args);

        CustStatementConsolidateController::startControllerOperation(controller, _args);

    }

    protected static void startControllerOperation(SrsPrintMgmtFormLetterController _controller, Args _args)
    {
        _controller.startOperation();
    }

    protected void outputReport()
    {
        SRSCatalogItemName  reportDesign;
        reportDesign = ssrsReportStr(CustAccountStatementConsolidate, PrecisionDesign1);
        this.parmReportName(reportDesign);
        this.parmReportContract().parmReportName(reportDesign);
        formletterReport.parmReportRun().settingDetail().parmReportFormatName(reportDesign);
        super();
    }
  
}
 
  • Martin Dráb Profile Picture
    Martin Dráb 230,543 Most Valuable Professional on at
    Use multiple records in same report
    Your CustStatementConsolidateController doesn't contain any code related to the problem. You inherit all the logic from ancestor classes, such as CustAccountStatementExtController and SrsPrintMgmtFormLetterController.
     
    You can use the debugger to see why the report gets executed multiple times. You can start by checking how many times outputReport() gets called.
     
    The only interesting thing in your code is that you seemed to forget to take print management into account. You should configure the report design in print management, instead of breaking print management logic by hard-coding the design name.
     
    It seems that custom controller shouldn't exist at all; the only reason for its existence is the custom design name, but that can and should be done by configuration, not code.
  • Kareem Profile Picture
    Kareem 30 on at
    Use multiple records in same report
    Yeah, I am getting a report for every customer I selected @Layan Jwei
     
    @Martin Dráb I've tried to create new query + report design but I am still getting the same issue
     
    I've provided my controller above to see if anything related to it.
  • Martin Dráb Profile Picture
    Martin Dráb 230,543 Most Valuable Professional on at
    Use multiple records in same report
    It all depends on how the report and the controller are implemented. There are several ways how it can be done.
     
    It sounds like your report can show just a single record and therefore the controller runs the report several ones, once for each customer. You need the report to accept a query with multiple customers and print all of them. The main design element of the report will be a tablix linked to a data source with all the customers and details of a particular customer will be nested in this main tablix.
  • Layan Jwei Profile Picture
    Layan Jwei 7,403 Super User 2024 Season 2 on at
    Use multiple records in same report
    Hi,
     
    Do you mean you are getting a report for each customer you filtered for? Or are you getting a duplicated report where each report contains data for the two customers you filtered?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,458 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,543 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans