Display data from two sources in a Single report.

6 posts, 0 answers
  1. smith spd
    smith spd avatar
    89 posts
    Member since:
    May 2010

    Posted 01 Sep 2010 Link to this post

     

    Hello Telerik Team,

    I have a requirement to bind two data sources to a single report.I was trying some of your blogs to do that.

    The method i used to display a subreport in a main report is as follows:

    1>Created a report called "X" and put some fields in it and binded the datasource to that report and build it..its  working fine....As of now,I am not using any parameters.

    2>I created another report called "Y" and from the tool box i dropped subreport item and
    in the properties section I have selected the report source property as "x".

    When i build the report "y" i get the error "Type name x-subreport does not exist in the type "Projectname"

    I  tried using Need datasource event and it says the same error.dO i need to add anything to the project file.?

    Please let me know.

    Can you list the way step by step.
    I am unable to achieve it.

    Can you send me a sample to do that.

    Thank you,
    Smith

  2. Le_Roy
    Le_Roy avatar
    31 posts
    Member since:
    Nov 2009

    Posted 02 Sep 2010 Link to this post

    As far as I know, it is "wide-known missing feature".
    I'm using workaround for this case.
    Try to fill data in your subreport in code behind.
    It's pretty easy, especially when you are using smth like LinqToSQL classes or other entity models.
  3. DevCraft banner
  4. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 02 Sep 2010 Link to this post

    Hello Smith,

    To bind the report to multiple datasources (i.e. Tables in your case) you can use the SubReport and/or Table/Crosstab/List items which are separate data regions.

    I have attached a video and a sample project to illustrate both of the approaches.

    All the best,
    Peter
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Deepak Shakya
    Deepak Shakya avatar
    118 posts
    Member since:
    Aug 2007

    Posted 18 Jan 2011 Link to this post

    Hi Telerik Team,

    Thanks for posting the video. This is really helpfulin understanding reporting. I still have similar problem to Smilth. I am using Q3 2010 Release.

    Scenario:
    • I created a report with a chart (named: ChartReport) and set the datasource using query designer.
    • Query is parameterised and looks for a report paramater to generate the dataset
    • I have also set the DataYColumn and DataLabelsColumn by creating one series for the chart
    • Created a report parameter but I haven't set the datasource in "AvailableValues". Just a name.
    • I then created another report (named: MainReport) 
    • I then set few Report parameters
    • I added subreport control and set the ReportSource to the "ChartReport"
    • Set the Parameters equal to one of the field in a Group. Hence, this field in the MainReport should be the parameter for the SQL in ChartReport's datasource.
    • When I preview the report, it throws in a compile error: Typename "ChartReport" does not exist in 'MainReport.MainReport'

    Aim: 

    • To get chart for each group item in the group footer

    You help is highly appreciated. Thanking you in advance.

    Cheers!

  6. Deepak Shakya
    Deepak Shakya avatar
    118 posts
    Member since:
    Aug 2007

    Posted 19 Jan 2011 Link to this post

    OK, I have kind of made it work. This works until I make any changes in the desinger.

    I have found that when I assign the ReportSource to "ChartReport", the following code gets added to the InitializeComponent();

    this.subReport1 = new Telerik.Reporting.SubReport();
    this.chartReport1 = new Reporting.ChartReport();
    ((System.ComponentModel.ISupportInitialize)(this.chartReport1)).BeginInit();
    ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();

    It now gives me an error saying: "The type name 'ChartReport" does not exist in the type 'Reporting.Reporting'

    "Reporting" is the name of the class library where I have created reports.

    What I did:

    If I replace the above code with:
    this.chartReport1 = new ChartReport();

    It seems to work and I can get the charts as subreport in my main report. But I make any changes in the Design view and re-compile, the problem re-appears.

    Any help will be appreciated.
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 19 Jan 2011 Link to this post

    Hello Smith,

    Simply avoid using Telerik or Reporting as names of your namespaces/classes and you should be fine.

    Regards,
    Steve
    the Telerik team
    Get started with Telerik Reporting with numerous videos and detailed documentation.
Back to Top
DevCraft banner