C# Crystal reports ExportToDisk占用大量时间

C# Crystal reports ExportToDisk占用大量时间,c#,performance,crystal-reports,C#,Performance,Crystal Reports,我在C#中有一个控制台应用程序,可用于crystal reports。我使用以下方式加载报告(仅一次): 然后,我使用以下方法将此报告导出为pdf文件: //Export pdf file static void ExportToPdf(string destianationPath) { cryReportDocument.SetDatabaseLogon("userName", "password", "Dat

我在C#中有一个控制台应用程序,可用于crystal reports。我使用以下方式加载报告(仅一次):

然后,我使用以下方法将此报告导出为pdf文件:

    //Export pdf file
    static void ExportToPdf(string destianationPath)
    {                     
        cryReportDocument.SetDatabaseLogon("userName", "password", "Database", "");
        //Adding paremeters to report
        cryReportDocument.SetParameterValue(.., ..);    
        //This line consumes a lot of time now  
        cryReportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, destianationPath);
    }

我以前使用过这个程序(大约两三天前)导出了大约15000个.pdf文件,效果非常好。在大约不到一秒钟的时间内导出了一个.pdf文件。我没有修改代码中的任何内容,但导出一个.pdf文件需要大约5秒钟的时间。这是什么原因造成的?电脑是一样的,我什么也没变。但它不能正常工作。有人能帮忙吗?

是数据库速度慢吗?(根据Adil的要求)


其他信息(希望您不介意):


ExportToDisk方法使crystal实际执行数据库查询。在这种情况下,最好的测试是直接执行查询,看看需要多长时间。根据需要进行调整。

可能是数据库速度慢吗?(根据Adil的要求)


其他信息(希望您不介意):


ExportToDisk方法使crystal实际执行数据库查询。在这种情况下,最好的测试是直接执行查询,看看需要多长时间。根据需要进行调整。

可能是数据库速度慢吗?不,只是这一行占用了大量时间。磁盘是否接近容量或高度碎片化?这是由于报告过程中的database one“or”语句导致的。写下你的第一条评论作为答案。我会接受它:)可能是数据库速度慢吗?不,只是那一行占用了很多时间。磁盘接近容量还是高度碎片化?这是由于报告过程中的数据库“或”语句导致的。写下你的第一条评论作为答案。我会接受的:)
    //Export pdf file
    static void ExportToPdf(string destianationPath)
    {                     
        cryReportDocument.SetDatabaseLogon("userName", "password", "Database", "");
        //Adding paremeters to report
        cryReportDocument.SetParameterValue(.., ..);    
        //This line consumes a lot of time now  
        cryReportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, destianationPath);
    }