locked
Export empty table to csv RRS feed

  • Question

  • I have a daily subscription that needs to be emailed out in CSV format.  The report could not be simpler - just one table of results from the prior day.  It works great if results exist - column headers and rows are present in the CSV file.  However, if no results exist, the CSV file doesn't contain one row of just column headers as you'd
    expect - it contains the name of the table (i.e. tblResults).  How can I get an empty table to render in CSV as one row of column headers?

    I am using SSRS 2005.

    Thanks,

    Vijay

    Tuesday, April 6, 2010 9:09 AM

Answers

  • Hi Vijay,

    We can use the "Hidden" property to hide the whole table if the dataset is null. Below is a sample expression for the "Hidden" property:

    =IIF( CountRows("DataSet") > 0, false, true)

    If you have any more questions, please feel free to ask.

    Jin Chen

     


    Jin Chen - MSFT
    Wednesday, April 7, 2010 11:54 AM

All replies

  • Hi Vijay,

    We can use the "Hidden" property to hide the whole table if the dataset is null. Below is a sample expression for the "Hidden" property:

    =IIF( CountRows("DataSet") > 0, false, true)

    If you have any more questions, please feel free to ask.

    Jin Chen

     


    Jin Chen - MSFT
    Wednesday, April 7, 2010 11:54 AM
  • Hi I tried this to the table and it works great when viewing it in the report onscreen, but when I export it to CSV, the report is blank even though I have data.

    What am I doing wrong?

    Thank you for your help.

    Jason

    Thursday, June 7, 2012 4:54 PM