繁体   English   中英

一段时间后,Crystal Report不显示数据

[英]Crystal Report is not showing data after some time

我已经经历过以下问题。请不要标记为我的问题重复。 https://stackoverflow.com/questions/24432683/crystal-report-is-not-showing-data-after-some-time-in-cr-version-13-0-2000-0自上次我就面临这个问题1个月。我的水晶报表正在运行良好的开发环境(windows-7 32bit,VS2010,Crystal报表V.13)。 我部署在服务器上(Windows server-2012 64bit,core i5)。 问题是一段时间后报告变得空白。我对此进行了大量搜索,并使用Dispose(),Close()方法,现在我正在使用以下代码。

public static void OpenPdfInBrowser(ReportClass RptReport)
{
        string strFilename;
        string strFolderName;
        string strFile = String.Empty;
        string strReportOutputName = String.Empty;

        HttpResponse objResponse = HttpContext.Current.Response;
        HttpSessionState objSession = HttpContext.Current.Session;
        HttpServerUtility objServer = HttpContext.Current.Server;

        strFolderName = objServer.MapPath("../ReportOutput");
        if (Directory.Exists(strFolderName) == false)
        {
            Directory.CreateDirectory(strFolderName);
        }

        //Generate the File Name
        strFilename = "";
        strFile = objSession.SessionID.ToString() + "_" + DateTime.Now.Ticks.ToString() + ".pdf";
        strFilename = strFolderName + "\\" + strFile;

        //Set the File Name
        DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
        diskOpts.DiskFileName = strFilename;

        //Set the Various Options
        ExportOptions exportOpts = new ExportOptions();
        exportOpts = RptReport.ExportOptions;
        exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
        exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
        exportOpts.DestinationOptions = diskOpts;
        //Export the Report
        RptReport.Export();
        //Stream it to the Client
        objResponse.ClearContent();
        objResponse.ClearHeaders();
        strReportOutputName = "Report";
        objResponse.ContentType = "application/pdf";
        objResponse.AddHeader("Content-Disposition", "inline;filename=Report.pdf");
        objResponse.WriteFile(strFilename);
        objResponse.Flush();
        objResponse.Close();
        //Delete the File   
        System.IO.File.Delete(strFilename);
        //Close the Report Object
        RptReport.Close();
        RptReport.Dispose();
        GC.Collect();
    }

   I am getting the following error in event viewer on deployment server.
   The description for Event ID 4353 from source Crystal Reports cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
    If the event originated on another computer, the display information had to be saved with the event.
    The following information was included with the event: 

无法加载密钥代码程序集BusinessObjects.Licensing.KeycodeDecoder.dll。 任何帮助将不胜感激。 感谢adnvace。

将您的asp.net文件夹复制到服务器虚拟目录...

不确定,但希望您的问题能解决。 好运。

该问题看起来与服务器上的Crystal报表安装有关...如果在Development Machine上运行正常,并且在Deployment Server上安装了运行Crystal Report所需的所有应用程序,请检查。 IIS中的应用程序池->选择用于Web应用程序的应用程序池->高级设置->启用32-应用程序->将此设置为“ True” ..

请尝试检查...

经过长期的研究,我通过对注册表进行以下更改解决了我的问题。实际上,此问题与打印作业限制有关,默认情况下75我只是根据自己的要求扩展其数据大小,并且对我有用。

转到->运行----->注册表编辑器1-HKEY_LOCAL_MACHINE 2-软件3-SAP业务对象4-.NET框架的晶体报告(您的版本号)5-报告应用程序服务器6-服务器

然后进入“ PrintJobLimit”属性,并将其数据大小更改为所需的大小。 感谢所有在这方面帮助我的人

您的方法正确使用.close和。 处理,但是最好的使用方法是:

 Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
    cryRpt.Close()
    cryRpt.Dispose()
End Sub

要打开PDF水晶报表,您可以使用http响应,这样会提高性能:

    cryRpt = New ReportDocument
    cryRpt.Load(Server.MapPath("Your report path"))
    cryRpt.SetDataSource(Your data source)
   cryRpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "ExportedReport")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM