hi
i would like to ask a quetion.
I saw that in report we can set more than 1 datasource.What's the porpuse of this??
Also if i set 2 datasource how will the xaml be?? (as in xaml also set the entity name in reportviewer's datasource setting).
I created an invoice report for person and adress.(to print person and his address) I did that creating a view on db and groupping the rows.
If i want to load persons and address as separate and set them as data source without using view. Is it possible somehow ???thanks
Hi,
Supporting multiple data sources allows you to combine several portions of data in the same report. For example in a DashBoard you can display several charts, each one based on a different data source. Currently each data source is independent from the others. You can’t combine them, i.e. you can’t simulate a join inside the report. Joins operations must be resolved at the data level. In order to do what you want with Persons and Address you will need to do a join, so you have to use a View or an SQL sentence.
Being able to combine data sources inside the report is a v.Future feature.
If you have several data sources in your report at the Xaml level you can specify one ig:DataSource for each Data Source. For example:
<ig:XamReportViewer Name="xamReportViewer1">
<ig:XamReportViewer.RenderSettings>
<ig:ClientRenderSettings DefinitionUri="...">
<ig:ClientRenderSettings.DataSources>
<ig:DataSource TargetDataSource="DS1" ItemsSource="{Binding DS1}" />
<ig:DataSource TargetDataSource="DS2" ItemsSource="{Binding DS2}" />
</ig:ClientRenderSettings.DataSources>
</ig:ClientRenderSettings>
</ig:XamReportViewer.RenderSettings>
</ig:XamReportViewer>
Thanks,
Leo
Hi there are also other problems with my report.
I tried creating a report with 2 datasources(without using View) and there are some field(that i want to print) with same name, in the 2 datasoucres. As i'm printing the data in 2 table(from the 2 datasouces) the printed data in the 2 table is same(8 record printed). While the first table shoud print 8 record the second table 2record.
Is this a bug ???
For example. There is a field called "ProductName" both in the two datasouces. And in the two table cell's is written : "Field.ProductName". Maybe this coulde be wrong.
Hi
thanks for the answer. I tried to create a view and group data at report level and it work fine.
I'm creating the ReportViewer,RenderSetting etc. from code behind(not XAML).
If i set 3 data sources in report (persons,addresses,shopping list). If I load only data to be printed from data context. And set it as datasource from code behind, could it work ??
In this way i don't do and fon't need to do any join, because i have only data to be printed.