This is a migrated thread and some comments may be shown as answers.

Display data from two sources in a Single report.

5 Answers 555 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
smith spd
Top achievements
Rank 1
smith spd asked on 01 Sep 2010, 03:21 PM

 

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

5 Answers, 1 is accepted

Sort by
0
Le_Roy
Top achievements
Rank 2
answered on 02 Sep 2010, 09:33 AM
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.
0
Peter
Telerik team
answered on 02 Sep 2010, 09:39 AM
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
0
Deepak Shakya
Top achievements
Rank 1
answered on 19 Jan 2011, 03:41 AM
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!

0
Deepak Shakya
Top achievements
Rank 1
answered on 19 Jan 2011, 07:22 AM
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.
0
Steve
Telerik team
answered on 19 Jan 2011, 08:34 AM
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.
Tags
General Discussions
Asked by
smith spd
Top achievements
Rank 1
Answers by
Le_Roy
Top achievements
Rank 2
Peter
Telerik team
Deepak Shakya
Top achievements
Rank 1
Steve
Telerik team
Share this question
or