RDL, IIF statement in DataElementOutput tag

438 views Asked by At

I've found error in RDL, which makes columns with visible=false appear in CSV and XML files. I've found this solution to fix it

http://blogs.msdn.com/b/bimusings/archive/2007/02/07/reporting-services-why-aren-t-all-my-report-columns-exporting-to-csv-and-or-xml.aspx

The solution is to use DataElementOutput tag. But i need to include column depends on some report parameter (boolean). So, how should i write correctly =IIF statement? I tried

<DataElementOutput>=IIF(Parameters!myparam.Value,Output,NoOutput)</DataElementOutput>

but it don't work. Error is :

Deserialization failed: The 'http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition:DataElementOutput' element is invalid - The value '=IIF(true,Output,Auto)' is invalid according to its datatype 'String' - The Enumeration constraint failed. 

What is the correct variant for IIF in tags with certain values (Output,NoOutput,Auto) ?

1

There are 1 answers

0
Vitaly Senko On BEST ANSWER

Well, i didn't find any idea to get this work. But i thought about all this issue, and understood that this really work as designed.

When you hide column, it's normal for Excel reports, but it may cause errors in CSV reports, because CSV often used like information transfer files from one system to another, and removing a whole column from CSV file may cause errors in other system parsing process.

So, best solution was not only to set column hidden=true, but also to fill it with empty data.