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.
The data source from which each Table gets its data is defined by its DataSourceName property. So if you have two different data sources defined, let’s say A and B, one table should be associated to data source A and the other to B. If that is the case, each expression “=Field.ProducName” would refer to the appropriate data source. Also each table will iterate over the associated DS.
Does your report have an associated data source?
The 2 datasources names are correct. As the 2 Datasouces has the "ProductName" field, in the 2 tables(in report designer) in each table the ProductName column's content is : " =Fields.ProductName ".
Maybe it should be " =Fields.DataSourceName.ProductName ", to differentiate which table the column belongs.
bye
thanks
Can you check that the DataSourceName property is correctly set for both of the tables? It sounds like you possibly have them set to the same Data Source which would cause them to render the same data.
Brent
Hi Leonardo
thanks for the answer as you helping me a lot.
I try to describe my problem(a but changed).
i create 2 datasouces for my report each is printed in table. In these datasouces there are about 5 or 6 field with same names (that i must print). Therefore in the 2 tables there are some field with same content ("=Fields.ProductName", etc,). But the ProductName in the first DataSource is different than the second.
But the data printed in the 2 table is same.
I can’t reproduce the problem you mention. If you have two independent data sources (each with 8 records) and you create one table for each data source. Both tables should be correctly rendered. Having fields with the same name should not be a problem.
Please tell me a bit more about the structure of the data and report you are trying to create, so i can try to reproduce the problem.