2

I have my report and data ready. The report is like i need to select a center name (Ex: Raleigh(0003) ) from the DDLB. and i will submit that. Now i will get the report for the Raleigh Center. Here, i need to see the text on the top of the report like "Weather Report for Raleigh (0003)" as a header. Whenever i select a different center, it should automatically display that particular center on the top of the report. I tried to add the table, give the column (CENTER_ID) from the data set and in the expression, i gave like --> ="Weather details:"& Fields!CENTER_ID.Value &" - " & Fields!CENTER_NAME.Value. Here is the issue, it's either displaying all of the centers row by row or displaying a particular center name irrespective of the selection. Please help me out as it is very important.

Thanks.

Gustav Bertram
  • 14,591
  • 3
  • 40
  • 65

1 Answers1

0

When you select a center from the drop down - it is populating a parameter that you must then be using either to filter the query or to filter the table. Depending on how many rows the full query returns it might be better to do one or the other, e.g. if there are 1000's of rows you should filter the query, not the tablix. If it's not many rows then it's fine to filterthe tablix.

If the parameter is called @center then you could use this formula in your header:

="Weather details: "& Parameters!center.value

This assumes that your paramater is "text" type. If it is numeric or a date then you might have to convert it to a string first using CStr().

="Weather details: "& CStr(Parameters!center.value)

The reason it was showing you a "particular center name irrespective of the selection" is because you were telling it to put a dataset column (many rows) into a single cell. That will force it to always display the value in the first row, or if you are putting it in a details row in the tablix it will output every single value.

If you filter the query rather than the tablix, you could reliably use this:

 ="Weather details:"& First(Fields!CENTER_ID.Value,"datasetname") &" - " & First(Fields!CENTER_NAME.Value,"datasetname") 

because the first() function will return a single value from the first row of the dataset.

Davos
  • 5,066
  • 42
  • 66