Suggestion: Merge multiple reports into one report

12 posts, 0 answers
  1. mei
    mei avatar
    8 posts
    Member since:
    May 2007

    Posted 11 Mar 2008 Link to this post

    Hello,

    This is a suggestion request. Sometimes, we need to view or print multiple reports at once. So is it possible to merge multiple report objects into one report and pass it to viewer control?

    Regards, 

    mei
  2. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 12 Mar 2008 Link to this post

    Hello mei,

    We have already received and logged a number of similar request so I hope we will soon have the chance to work on this.

    Regards,
    Svetoslav
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Steve Kaser
    Steve Kaser avatar
    10 posts
    Member since:
    Jul 2005

    Posted 28 Aug 2008 Link to this post

    Has there been any progress on this feature?  I have need of generating a report that includes (embeded within) external files to be printed as part of the master report.
  4. Steve
    Admin
    Steve avatar
    10940 posts

    Posted 28 Aug 2008 Link to this post

    Hello Steve,

    We haven't had the time to work on this functionality yet, and it is still in our TODO list.

    Sorry for the temporary inconvenience.

    All the best,
    Steve
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 07 Jun Link to this post

    Hi,
    what is the continuation of this topic?
    Jola
  6. Silviya
    Admin
    Silviya avatar
    354 posts

    Posted 07 Jun Link to this post

    Hi Jola,

    You can combine multiple reports into a single document or to combine multiple instances of the same report with different settings into a single document for preview, print and export. In both cases, the solution would be to create a ReportBook.

    For more information, please check the following articles:
    Report Book report template
    How to: Create a Report Book at run-time

    An example is provided in ReportBook.cs file located in product installation folder (C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Examples\CSharp\ReportLibrary\ReportBook).


    Best Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 07 Jun in reply to Silviya Link to this post

    Thank you for your answer, I have still not menaged to create the report book at server (I am not familiar with this topic unfortuanatelly).
    I don't have this example on my computer: (C:\Program Files (x86)\Progress\Telerik Reporting <VERSION>\Examples\CSharp\ReportLibrary\ReportBook). Is there any way to get this example?
    I have not practise in configuring ReportViewer.html. I need strict example, then I can work further. Would you help?
    Greetings,
    Jola
  8. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 08 Jun in reply to Jolanta Link to this post

    Hallo once more.
    I have finally found a place in report resolver, where I can replace report source of single report with ReportBook.
    But, what I have no idea, how to approach, is:
    how can I get parameters of report in that place?
    One of the report parameter is set to multivalue=true and I transmit int[].
    For each of this array element, I want to generate report using same report file, but just with particular int parameter.
    I hope for your help.
    Jola
  9. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 11 Jun Link to this post

    Hi, will you help me finally?
    Using your advices, I menaged this:

    01.protected override ReportSource ResolveReport(string report)
    02.        {
    03.            var massReportParams = report.Split('|');
    04.            report = massReportParams[0];
    05. 
    06.            if (report.StartsWith(_startsWithValue))
    07.            {
    08.                report = massReportParams[0].Replace(_startsWithValue, _customReportsPath);
    09.            }
    10. 
    11.            var book = new ReportBook();
    12.            for (var i = 0; i < int.Parse(massReportParams[1]); i++)
    13.            {
    14.                var resolvedReport = base.ResolveReport(report);
    15.                book.ReportSources.Add(resolvedReport);
    16.            }
    17.            return new InstanceReportSource { ReportDocument = book };
    18.        }

    And

    $("#reportViewer1")
                   .telerik_ReportViewer({
                       serviceUrl: "api/reports",
                       templateUrl: 'ReportViewer/templates/telerikReportViewerTemplate-FA.html',
                       reportSource: {
                           report: reportName + "|5"
                       },

    And, now, goint into my report, I can create 5 same reports at once.

    What I need is:
    Read somewhere, (I thought in ReportViewer.html), report parameter name = 'myParameter1_MassReporting"
    which is set (in trdx) as multiValue = true, the count of selected items of this parameter. And this value, named parameter1ItemsSelectedCount, put instead of the hardcoded 5 (report: reportName + "|5").

    Then, I get as many reports printed, as many items of this multiValue parameter I selected.
    The next, I want to put values of selected items into report parameter named myParameter1, which has multiValue set to false.
    Each of the report instance should get particular value of seleted item.

    Whould you help me this time?

    Jola


  10. Silviya
    Admin
    Silviya avatar
    354 posts

    Posted 12 Jun Link to this post

    Hello,

    Our examples are shipped with the installation of Telerik Reporting: Installing Telerik Reporting (step 2). YOu might have changed the default installation path. Please check where the Telerik Reporting is installed on your machine.

    The parameters for the report book can be passed with the report source object as a string because inside a custom report resolver you will get only a reportId argument. To make this clear let's look at an example. 
    Let say we have one Dashboard report and we need to create a report book with two instances if this report with two different parameter values. For example, to provide 2001 as a value of the first report and 2002 as a value of the second report. Then in HTML5 report viewer pass all of the information in reportSource.report like:
    <script type="text/javascript">
            $("#reportViewer1")
                .telerik_ReportViewer({
                    serviceUrl: "/api/reports/",
                    reportSource: {
                        report: "RestService1.Reports.MyReportBook, RestService1@2001@2002",
                        parameters: { }
                    }
                });
    </script>
     
    Then in the custom report resolver parse the string to retrieve the parameter values:
    if (reportId.StartsWith("RestService1.Reports.MyReportBook, RestService1"))
    {
        // parse the string to retrieve the parameter values
        String[] instring = reportId.Split('@');
        var reportName = instring[0]; // RestService1.Reports.MyReportBook, RestService1
        var param1 = instring[1]; // "2001"
        var param2 = instring[2]; // "2002"
      
        // Creating a new report book
        var reportBook = new MyReportBook();
      
        //Note: Adding the reports as UriReportSource
        //Add first report
        var firstReportSource = new UriReportSource();
        firstReportSource.Uri = "Reports\\Dashboard.trdp";
        firstReportSource.Parameters.Add("ReportYear", param1);
        reportBook.ReportSources.Add(firstReportSource);
      
        //Add second report
        var secondReportSource = new UriReportSource();
        secondReportSource.Uri = "Reports\\Dashboard.trdp";
        secondReportSource.Parameters.Add("ReportYear", param2);
        reportBook.ReportSources.Add(secondReportSource);
      
        //Return the new instance
        var result = new InstanceReportSource { ReportDocument = reportBook };
      
        return new Telerik.Reporting.InstanceReportSource { ReportDocument = reportBook };
    }
    else
    ...

    Note that the parameter values passed directly from the viewer's ReportSource are applied to the report automatically by the Reporting Engine (by matching parameters' names) and cannot be accessed in the report resolver. Therefore, when creating ReportBook in a Custom Report Resolver it is necessary to pass the parameter values as part of the viewer's reportSource.report property.

    I hope this helps.

    Best Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  11. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 12 Jun in reply to Silviya Link to this post

    Thank you for your answer. This example I understand well, and it works.
    (Although I thought, it is not necessary to pass the parameters to resolver, but only the count of parameters and then in reportViewer fill the parameters.

    But the main problem is: you have all the time static examples.
    What I need and described one by one is:

    1). I need to write a reportViewer function, in which I obtain my multiValue myParameter1 and I return the count of it. (THIS I DO NOT KNOW HOW TO APROACH)
    2). I pass this count to resolver and for this count I produce this count of report instances. (this point I can do)
    3). Again in reportViewer, parameter editor, I pass the particular multiValues to particular report instances. (this I potentially can do).

    As result, I get the count number of same report generated, each one has its own parameter.

    You static example does not solve my problem.

    Jola Krawczyk

     

  12. Neli
    Admin
    Neli avatar
    84 posts

    Posted 17 Jun Link to this post

    Hello Jola,

    Indeed, often we provide static examples as they most clearly demonstrate the functionality of the reporting tool, e.g. there is less additional logic that is not relevant to the product.

    If you would like to get the count of reports to be included in the ReportBook from the client side, I suggest to create a custom widget (e.g. dropbox with multivalue selection or input field for an integer value), and pass the number of items selected (or the value of the input field) as part of the reportSource->reports string. Then you may split and use the value in a custom report resolver as already demonstrated.

    Consider also sending a runnable project that demonstrates the scenario so that we can try to come up with a more particular example.

    Regards,
    Neli
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Back to Top