Crystal Report Viewer非常慢 [英] Crystal Report Viewer very slow

查看:103
本文介绍了Crystal Report Viewer非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Crystal Reports将永远加载到我的应用程序中 - 至少2分钟:这是我的代码。我做错了什么?

My Crystal Reports take forever to load in my application - at least 2 minutes: This is my code. What do I do wrong?

private void button1p_Click(object sender, RoutedEventArgs e)
        {
            Windows.CrystalReportViewerWindow wnd = new ePAM.Windows.CrystalReportViewerWindow();

            // Change 'OperationalUnitTableAdapter' to appropriate adapter.
            ePAM.Reports.StrategyDataSetTableAdapters.OperationalUnitTableAdapter adapter = new ePAM.Reports.StrategyDataSetTableAdapters.OperationalUnitTableAdapter();
            adapter.Connection.ConnectionString = BusinessLayer.BusinessLayer.GetConnectionString();
            adapter.Fill(dataSet.OperationalUnit);

            // Change 'Operational_Units' to appropriate report.
            Reports.Print.Operational_Units objReport = new Reports.Print.Operational_Units();

            // Change 'dataSet.OperationalUnit' to 'dataSet.***'.
            objReport.SetDataSource(dataSet);

            wnd.MyReportViewer.ReportSource = objReport;
            wnd.MyReportViewer.RefreshReport();
            wnd.ShowDialog();

        }





预付结转



Suzie



Thanks in Advance

Suzie

推荐答案

基本上你只是创建一个空的报告并打开它(不需要设置数据源或你刚发起的任何东西)

这会将水晶报告框架加载到内存中,并且应该大幅减少加载时间。
Basically you just create a empty report and open it (no need to set data source or anything you just initiate it)
This will load the crystal reports framework into memory and should cut down loading time drastically.


检查第二次打开水晶报告是否仍然加载缓慢。



Crystal报表第一次加载非常慢,但在第二次加载报表(或不同的报表)时应该很快(不关闭应用程序)



如果只是第一次出现这种情况,那么我建议您在加载应用程序时加载虚拟报告(在后台的不同线程中),显示当然的报告。
Check if the second time you open a crystal report is still loading as slow.

Crystal reports is very very slow on the loading for the first time but should be fast when loading the report (or a different one) for a second time (without closing the application)

If it's the case that it is only for the first time then I suggest that you load a dummy report (in the background on a different thread) when loading your application, without showing the report of course.


您是否在调试器下运行此命令以查看exac它的哪一部分很慢?哪条线花费的时间最多?
Have you run this under the debugger to see exactly what part of it is slow? Which line is taking the most time?


这篇关于Crystal Report Viewer非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆