Search code examples
c#asp.netpropertiesrdlcreportviewer

Make report viewer body invisible?


I have a report viewer whose body I want to make invisible except for head where you can choose the desired format. Here's my ASP.NET code:

    <rsweb:ReportViewer runat="server" ID="report" Font-Names="Calibri" Font-Size="12pt" WaitMessageFont-Names="Calibri" WaitMessageFont-Size="14pt" Width="383px" Height="30px">
        <LocalReport ReportPath="ReportFatture.rdlc">
            <DataSources>
                <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="DataSet2" />
            </DataSources>
        </LocalReport>
    </rsweb:ReportViewer>

Is there any property I can use?


Solution

  • Use below code in Page Load to hide report body

    report.ShowReportBody = false;
    

    Again you can make it visible like below

    report.ShowReportBody = true; 
    

    Here's MSDN link for ReportViewer.ShowReportBody Property