DataElementOutput 标记中的 RDL、IIF 语句

RDL, IIF statement in DataElementOutput tag

我在 RDL 中发现了错误,这使得带有 visible=false 的列出现在 CSV 和 XML 文件中。 我找到了修复它的解决方案

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

解决方案是使用 DataElementOutput 标记。 但我需要包含列取决于某些报告参数(布尔值)。 那么,我应该如何正确地写=IIF语句呢? 我试过了

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

但它不起作用。 错误是:

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. 

具有特定值(Output、NoOutput、Auto)的标签中 IIF 的正确变体是什么?

好吧,我不知道如何完成这项工作。 但我考虑了所有这些问题,并了解这确实按设计工作。

当您隐藏列时,Excel 报告是正常的,但它可能会导致 CSV 报告出错,因为 CSV 通常用作从一个系统到另一个系统的信息传输文件,并从 CSV 中删除一整列文件可能导致其他系统解析过程出错。

所以,最好的解决办法不仅是设置列 hidden=true,还要用空数据填充它。