cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report Viewer inside UpdatePanel displays only toolbar, report content missing

ARAVIND3001
Explorer
0 Kudos
350

Hi,

Crystal Report Viewer does not display the report content when placed inside an UpdatePanel in ASP.NET Web Forms.

ARAVIND3001_1-1739367158816.png

Please refer the below code.

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="ReportViewerContainer" style="width: 100%; height: 95vh;">
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" HasRefreshButton="True" HasCrystalLogo="False" HasToggleParameterPanelButton="False" ToolPanelView="None" EnableDatabaseLogonPrompt="False" HasDrillUpButton="False" HasExportButton="False" HasPrintButton="False" BestFitPage="False" Width="100%" Height="100%" />
</div>
<asp:Button ID="ApplyFormula" runat="server" Text="Button" style="display:none" OnClick="ApplyFormula_Click" />
</ContentTemplate>
</asp:UpdatePanel>

If I move the div (ReportViewerContainer) and CRViewer outside UpdatePanel, report is displayed properly.

Can someone help me on this?

Thanks in advance!!

View Entire Topic
DonWilliams
Active Contributor
0 Kudos

Hello, did you manually change the code or did you let VS generate it?

R&D tested this and noted there is a difference.

"I tried VS2019 with SP39 and it did work.  (note: SP 39 is in testing)

But my aspx showed a little different code:"

    <form id="form1" runat="server">
        <div>
        </div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True" GroupTreeImagesFolderUrl="" Height="1200px" ReportSourceID="CrystalReportSource1" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Width="1104px" />
                <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
                    <Report FileName="Grouping and Sorting.rpt">
                    </Report>
                </CR:CrystalReportSource>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>

for clarity your code, it is quite different:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="ReportViewerContainer" style="width: 100%; height: 95vh;">
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" HasRefreshButton="True" HasCrystalLogo="False" HasToggleParameterPanelButton="False" ToolPanelView="None" EnableDatabaseLogonPrompt="False" HasDrillUpButton="False" HasExportButton="False" HasPrintButton="False" BestFitPage="False" Width="100%" Height="100%" />
</div>
<asp:Button ID="ApplyFormula" runat="server" Text="Button" style="display:none" OnClick="ApplyFormula_Click" />
</ContentTemplate>
</asp:UpdatePanel>

 

ARAVIND3001
Explorer
0 Kudos

Hi,

Yes, I did manually change the Crystal Report Viewer properties as per our requirement.

I am facing this issue only when I have BestFitPage property as false and Crystal Report Viewer is inside an Update Panel. If I set BestFitPage to true, report is displayed successfully. However, report alignment gets changed and it does not match with our UI requirement. So we had to set - BestFitPage="False" Width="100%" Height="100%".