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
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) ?
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.