Can multiple data source be used in the same report?

3 posts, 0 answers
  1. .net dev
    .net dev avatar
    5 posts
    Member since:
    Jun 2014

    Posted 06 May 2015 Link to this post

    I want to use two different record sets in the same report.  They will be in their own details section, assuming two details sections can be used. 

    I've created two data sources in my report project, tested both connections and verified they do return the data I need.  I don't understand how to use them though.  I expected to see both of them listed in the Date Explorer, but only one is shown there.  They both show up at design time in the pane below the report designer though.  

    Please see the attached file with screen shots.  One is of the two data sources in the project while the other shows only one data source in the data explorer.

    Can two data sources be used in the same project as described?

    How should this be done?

     

     

  2. Nasko
    Admin
    Nasko avatar
    1050 posts

    Posted 08 May 2015 Link to this post

    Hello,

    There can be only a single detail section inside the report. The report can only have a single data source. In order to use the second data source created in the report you will need to add a new data item and assign the data source to its DataSource property. For more information on the topic, please refer to the Data Items and Binding a Data item to Data help articles.

    The data fields from the second data source will be shown in the Data Explorer when you select the data item bound to that data source in the report designer.

    Regards,
    Nasko
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. Mehrdad Aboudizadeh
    Mehrdad Aboudizadeh avatar
    2 posts
    Member since:
    Feb 2018

    Posted 24 Jun in reply to Nasko Link to this post

    Hi,

    I was developing a report that needed 2 sqldatasources one for buy transaction and another for sell

    I successfully added both data sources to the report and this is how I set in the back

     

                Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender;
                //dataSource1.CommandTimeout = 0;
                this.sqlDataSourceBuy.Parameters[0].Value = report.Parameters["emp_id"].Value;
                this.sqlDataSourceSell.Parameters[0].Value = report.Parameters["emp_id"].Value;
                this.sqlDataSourceBuy.Parameters[1].Value = report.Parameters["dateFrom"].Value;
                this.sqlDataSourceSell.Parameters[1].Value = report.Parameters["dateFrom"].Value;
                this.sqlDataSourceBuy.Parameters[2].Value = report.Parameters["dateTo"].Value;
               this.sqlDataSourceSell.Parameters[2].Value = report.Parameters["dateTo"].Value;
               // report.DataSource = sqlDataSourceBuy; uncommenting these 2 line did not break the report but did not need them
               // report.DataSource = sqlDataSourceSell;

     

     

     

Back to Top