简体   繁体   English

VS2010的Crystal Report加载缓慢

[英]Slow Loading of Crystal Report for VS2010

I have a problem in loading of Crystal Report in VS2010. 我在VS2010中加载Crystal Report时遇到问题。 Please see the code below: 请参见下面的代码:

 report_sched cr = new report_sched();
 TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
 TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
 ConnectionInfo crConnectionInfo = new ConnectionInfo();
 Tables CrTables;

 crConnectionInfo.ServerName = "serverName";
 crConnectionInfo.DatabaseName = "MyDataBase";
 crConnectionInfo.UserID = "User";
 crConnectionInfo.Password = "Password";
 CrTables = cr.Database.Tables;
 foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
 {
      crtableLogoninfo = CrTable.LogOnInfo;
      crtableLogoninfo.ConnectionInfo = crConnectionInfo;
      CrTable.ApplyLogOnInfo(crtableLogoninfo);
 }

I already try the "No Printer" set-up as they said. 正如他们所说,我已经尝试过“无打印机”设置。

What is the best way to less the loading of Crystal Report? 减少Crystal Report加载的最佳方法是什么?

To resolve slow loading in crystal report, remove all tables and good to use a single stored procedure which only get the data which you want to show. 要解决Crystal报表加载缓慢的问题,请删除所有表,最好使用一个仅获取要显示的数据的存储过程。

In procedure, you can use where, joins etc. as condition to filter data and after that you use procedure in crystal report same as table you are using right now. 在程序中,您可以使用where,join等作为条件来过滤数据,然后在Crystal Report中使用与当前使用的表相同的程序。

This strategy will give you faster result, the reason is crystal report have only work to show data. 此策略将为您提供更快的结果,原因是水晶报表仅能显示数据。

Right now at crystal report, there is first fetch all tables data, then join the condition if you given in selection formula, then filter the data if you given a parameter and finally show the data. 现在,在Crystal报表中,首先获取所有表数据,然后如果在选择公式中指定了条件,则加入条件,如果指定了参数,则过滤数据,最后显示数据。

There is so many link you find for this approach. 您可以找到很多这种方法的链接。 These are some of those: 这些是其中一些:

http://dotnetmentors.com/reporting/crystal-report-with-stored-procedure-parameter-and-visual-studio.aspx http://dotnetmentors.com/reporting/crystal-report-with-stored-procedure-parameter-and-visual-studio.aspx

http://www.pdssoftware.com/newsletter/mar07/page6.htm http://www.pdssoftware.com/newsletter/mar07/page6.htm

http://www.codeproject.com/Articles/10173/Loading-Crystal-Report-reports-which-use-Stored-Pr http://www.codeproject.com/Articles/10173/Loading-Crystal-Report-reports-which-use-Stored-Pr

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

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