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.
5 Answers, 1 is accepted
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.
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.
the 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.
- 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'
- To get chart for each group item in the group footer
You help is highly appreciated. Thanking you in advance.
I have found that when I assign the ReportSource to "ChartReport", the following code gets added to the InitializeComponent();
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:
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.
Simply avoid using Telerik or Reporting as names of your namespaces/classes and you should be fine.
the Telerik team