Page Repor and DataSource

Tagged: 

  • ricagmcr 1 year ago

    I have a MVC Project with a Report type “PageReport”.
    Load Data follows …
    Report = new pageReport (new FileInfo (Server.MapPath ( “~ / Areas / Catalog / Views / MyReports / Report1.rdlx”)));
    ((PageReport) (report)) Document.LocateDataSource + = Document_LocateDataSource .;

    The “Document_LocateDataSource” event contains the following.

    Document_LocateDataSource empty (object sender, args LocateDataSourceEventArgs)
    {

    try
    {
    args.Data = LstDat1; (It’s a query that is stored in a generic List )

    }
    catch (Exception err)
    {
    if (args.Report! = null)
    {
    args.Report.PageReport.Document.Dispose ();
    args.Report.Dispose ();
    }
    throw new Exception ( “Error”, err);
    }

    }

    In the design I have a DataSource Report Data called “DataSource1″ with “DataSet1″.
    Everything works fine but the question is .

    You can have 2 DataSources in my report?? ” DataSource1 ” and ” DataSource2 ” and fill each data source with a different query ?
    Something like that…

    Document_LocateDataSource void ( object sender, args LocateDataSourceEventArgs )
    {

    try
    {
    args.Data = LstDat1 ; ( How I assign data in DataSource1? )
    args.Data = LstDat2 ; ( How I assign data in DataSource2? )

    }
    catch (Exception err)
    {
    if ( args.Report ! = null)
    {
    args.Report.PageReport.Document.Dispose ( ) ;
    args.Report.Dispose ( ) ;
    }
    throw new Exception ( “Error” , err) ;
    }

    }

  • 597p
    Reema597p 1 year ago

    Hello,

    I would like to inform you that it is possible to have two or more data-regions on a PageReport (each bound to different dataset).
    However, please note that only CPL supports multiple datasets. FPL does not support multiple datasets.

    Refer to the following links wherein similar issues have been answered :

    http://our.componentone.com/groups/topic/unable-to-bind-to-multiple-datasources/

    http://arhelp.grapecity.com/groups/topic/putting-multiple-data-regions-on-page-report/

    http://stackoverflow.com/questions/20555438/active-reports-page-reports-multiple-tables

    http://arhelp.grapecity.com/groups/topic/multiple-datasets-in-a-fpl/

    Hope this helps.

    Regards,
    Reema

  • ricagmcr 1 year ago

    Thank you.
    What is a CPL report? You could share a sample project of a report with multiple tables and datasources ? I use subreports ? A sample project please .
    My proyect is web/mvc.

  • 597p
    Reema597p 1 year ago

    Hello,

    CPL refers to Continous PageLayout -> RDLReports with respect to AR10.
    FPL refers to Fixed Page Layout -> PageReports with respect to AR10.

    In earlier versions of AR, they were reffered to as CPL and FPL and since you posted the issue on AR7 forum, I thought you were working on AR7. I will proceed the reply with respect to AR10 terminologies from here on….

    Next, Page Reports do not allow for multiple data sets/data sources, so if you’re working with this type, it is not doable.

    If you’re working with RDL reports, it is possible. Attached is a report that connects to the northwind database in two different ways – one connects through sql server and one connects to an .mdb file. One pulls data from the customers table and one pulls data from the employees table.

    Another take on using multiple datasources in PageReport type is that you can design a page report with datasource as “DataSet provider”.

    When you do that, you will need to specify the dataset at runtime using LocateDataSource api. At runtime, you can connect to multiple datasources and then get data into one dataset and then pass that one dataset to the PageReport.

    So, essentially the limitation with PageReport is that it only uses one dataset, however that dataset can have data from multiple datasources, which can be accomplished at runtime as mentioned above.

    Here is a link on how to go about doing it. See the dataset provider section here :

    http://arhelp.grapecity.com/webhelp/AR10/index.html#Bind%20Page%20Reports%20to%20a%20Data%20Source.html

    In order to use multiple datasources, you will need to use subreport control. Please check the following link for more information on this:

    http://arhelp.grapecity.com/webhelp/AR10/index.html#SubreportReportItem.html

    http://arhelp.grapecity.com/webhelp/AR10/SubreportinRDLReport.html

    However, if you create multiple datasets from the same datasource, you should be able to use them using different data regions? Please make sure that you are currently using RDLReports since PageReports do not support multiple datasets.

    After creating the report, you can refer to our installed ‘ActiveReportsWithMVC’ sample that is shipped with the Product and include this report in that.

    Let me know if you still face any issues.

    Regards,
    Reema

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.