Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using report viewer, how do I pull from two seperate Datasets

I have two datasets I need to pull from, A base that both reports use and then a separate one that only one report pulls from. I get the error

Error 12 The Value expression for the text box ‘Textbox9’ refers to the field ‘Name’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope.

My best guess is I have to associate them with the correct dataset but I have not been able to find any documentation on this.

edit: I am trying to access property files that I created for the fields on the report document.

Can someone please tell me where in the rdlc document I need to code something like name.value, "dataset1" or something similar?

like image 722
Robert Avatar asked Dec 19 '25 03:12

Robert


2 Answers

When you create a table in a RLDC, in the Tablix properties (selecting a row or a column) you must associate a DataSet.

After doing that, you have to write in each cell the name of the field (in the dataset) that you will use. You can do that by clicking on the "little table" in the cell, when you put the mouse over it

In images (with Visual Studio 2010)

Tablix Properties

Selecting DataSet

Setting Field to Show

If you don't see the dataset in the list, you must add it. For that, click on view menu -> report data. Then, in the DummyDataSource, click Add Dataset..

Add new DummyDataSource

And select it from the list, or create a new one instead, in the same form. enter image description here

If this doesn't work, well I don't know haha

If the two datasets has the same structure, then you could use one just, and in the code assign it to the datasource

like image 60
Gonzalo.- Avatar answered Dec 21 '25 06:12

Gonzalo.-


I ran into this same error and the only way I could resolve it was by closing and reopening BIDS and then refreshing the fields from the stored procedure (Right click the data set -> Dataset Propoerties -> Query -> Refresh Fields).

Thanks for the troubleshooting tips!

like image 23
costr Avatar answered Dec 21 '25 06:12

costr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!