Export Tablix with No Date

ron barlow 411 Reputation points
2021-02-10T21:17:26.26+00:00

Hello

I’ve got a number of Tablix line by line reports as subreports . If there is no data on any report the page is blank . To try get around this I’ve tried 2 things

I’ve added an additional row on the end of Tablix and in the row visibility expression I’ve added =IIF(CountRows("DataSet1")>0,true,false) to display the row if there id 0 rows in the dataset

I’ve also tried adding a value in the Tablix ‘NoRowsMessage’ property, on the report and also on the sub report. This works okay until I export the sub reports to Excel and then I don’t get the tab name of the empty report

e.g. if the report tab before the empty report is StudentDetails, the empty is report tab is StudentDetails(2) (but it does have the NoRowsMessage’)

Can anyone recommend a solution, as I’ve got a number of sub reports to export to excel and if there is no data in any of them, I still need to get the Excel tabs in place.

Thanks in advance
Ron

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,853 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 34,591 Reputation points
    2021-02-11T07:14:06.837+00:00

    Hi @ron barlow ,

    Do you mean that when you export the report to excel, the ‘NoRowsMessage’ doesn't work in the excel?

    If I have something misunderstood, please point out.

    The “NoRowsMessage” element is not rendered when we export a report to a CSV format.

    To work around this issue, we can add a textbox to display the custom message.

    If the dataset return null records, the report will display the custom message. Otherwise, the textbox displays nothing. Then, we can determine whether the textbox element outputs when exporting the report. Please refer to the steps below:

    Drag a “Text Box” to the subreports. Right-click on the text box and set the expression to:

    =IIF(CountRows("DataSetName")=0, "No data", nothing)  
    

    Select the added text box, in the “Properties” pane, set the “DataElementOutput” to “Output”.

    Regards,

    Zoe


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Hot issues October