Last post Aug 29, 2012 07:05 AM by Siva_V
Aug 22, 2012 04:46 PM|C.Avci|LINK
I have Report.rdlc file and different Placeholders on it.
I also have a couple datasets with a table on each of it. The table structure is like following
I am trying to bind these names to diffent place holders.
But place holder always uses the first row.
Is there way to say display the name of the row which has the id of 2?
I need a condition but whenever I write an IIF condition , it is checking the condition on the first row.
I need something like following
IIF(Fields!ID.Value = 2, (Fields!Name.Value, "DataSetPatientInfo"), "")
or I need a search/filter condition.
If I remove the First keyword, it gives an error saying "Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope"
Any help will be appreciated.
Aug 27, 2012 05:49 AM|Siva_V|LINK
You can do like this (just copy paste the below expression code to your expression field)
=First(iif(Fields!ID.Value = 2,Fields!Name.Value,"empty value here"), "DataSetPatientInfo")
and it will work
You dont need to include the "First" if you are using "Table" design to bind the dataset, for Textbox "First" is needed along with the dataset name.
Please let me know if this doesn't works.
Aug 27, 2012 12:52 PM|C.Avci|LINK
It still does not work. It applies the if statement to the first row of the table. Since ID is 1 in the first of, iif statement renders as "Empty Value Here".
It does not scan all rows and find the right ID with = 2.
How can I retrieve the row by ID?
Aug 28, 2012 01:47 AM|Siva_V|LINK
You will have to put your expression in table(i think you are using table) and then there is no need to use FIRST, the expression should goes in the first row and desired column of the table like:
Make sure you had assigned the DatasetName for the table (table->properties->DatasetName)
=IIF(Fields!ID.Value = 2,Fields!Name.Value,"empty")
hope this works
Aug 28, 2012 08:31 PM|C.Avci|LINK
I am not using a table on the report design.
On rdls design;
1. I create a TextBox
2. Inside of textbox, I right click the mouse and select "Create Placeholder"
And I am setting this placeholder's value. Value is coming from a data table but as i said it only manipulates the first row of the table.
If I don't use First, I get the following error.
Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope.
I have 8 records in my table and I can create 8 datasets with each have 1 row only and accomplish the task but this does not look logical.
If you are not very busy, can you please just create 1 little application and email me?So that I can compare yours to mine.
Thank you very much
Aug 29, 2012 07:05 AM|Siva_V|LINK
You will have to replace the textbox with Table otherwise your required condition will not work, and in table remove the row details (right click on the row and select delete rows) and have only the header row, now you will have one row with three columns,
in the table remove the two columns(delete it) and now you have only one row and one column in the table which looks like a Textbox. Right click table and select the required Dataset Name
Now in the table click properties and select Filter
Table --> Right Click -->Tablix properties -->Filter -->Add
Now in the expression select ID and in the value provide the value as 2. Now it will work as you expected.
This should work for you, Please let me know if you have any problem.