Load report failed when implementing crystal report in asp.net 3.5

被刻印的时光 ゝ 提交于 2019-12-25 03:14:53

问题


Im implementing crystal report which is builtin in visual studio 2008. When i create my crystal report and check its preview it shows me the data but when i call it on my abc.aspx page report doesnt load and gives error 'Load report failed'. This is my Code

 <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
            AutoDataBind="true" ReportSourceID="CrystalReportSource1" />
        <br />
    <br />
    <br />
        <br />
        <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
            <Report FileName="Reports/DailyPaymentStatus.rpt">
            </Report>
        </CR:CrystalReportSource>

what may be im doing wrong. This report also accept 4 parameters and im not setting them anywhere. Also one thing i want to mention if i make another simple project and do the same thing it runs perfectly and give me the output.


回答1:


Yes. I found out the answer the problem is with the path

<Report FileName="Reports/DailyPaymentStatus.rpt"> 

it has to be like

<Report FileName="~/Reports/DailyPaymentStatus.rpt">



回答2:


You can call show data on report in DataBinding and Navigate methods.

protected void CrystalReportViewer1_DataBinding(object sender, EventArgs e)
{
    this.ShowReportData();
}  

protected void CrystalReportViewer1_Navigate(object source,  CrystalDecisions.Web.NavigateEventArgs e)
{
    this.ShowReportData();
}


来源:https://stackoverflow.com/questions/3321469/load-report-failed-when-implementing-crystal-report-in-asp-net-3-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!