1
votes

I'm new to SSRS. But I thought I had been given a simple task for my 1st request. I have a SSRS PO Report Form provided by our ERP software vendor. I only need to move the fields around to satisfy our users. I move a field from the middle of the page to an area near the top. With no other changes but when I try to run the report I get this error: The Value expression for the text box ‘TextBox1’ refers directly to the field ‘PrintAs’ without specifying a dataset aggregate. When the report contains multiple datasets, field references outside of a data region must be contained within aggregate functions which specify a dataset scope.

I have 4 datasets in this report. They were there originally and have not been modified. To move the fields I am simply clicking on them till I get the 4 pointed arrow and dragging the field to the top of the report. Is there something under the covers that I'm missing? That needs to be changed when the field position is changed?

1
Sounds like you're moving from a container that is associated with a specific dataset to another one that isn't. - Tab Alleman

1 Answers

0
votes

The object that textbox1 existed in was specifically linked to a dataset that contained the field PrintAs. I'm assuming it was a rectangle or table. You can only move textbox1 within the area of that rectangle or table or else you will see that error. If you move it outside of the bounds of that rectangle or table then you must use the LookUp function or an aggregate function in order to reference the field and get the correct value returned. What is happening in regards to the error is that the report is trying to return all the PrintAs Fields instead of just one which is causing SSRS to fail.

Is the PrintAs field exactly the same for every row in the dataset. If so you can you use this in textbox1 expression: First("Fields!PrintAs.Value,"*Dataset name*") and move the textbox anywhere you'd like. If the field is not the same you will need to use the Lookup function in the textbox to get the correct value MSDN Lookup