現在、以下の方法を使用してすべてのレポートセクションに接続情報を割り当てます。しかし、レポートには多くのセクションがあるので、レポートはほぼ10秒後に表示されます。それは本当に遅く見えます。クライアント側にインストールされたときに、各CRにログオン情報を設定する方法はありますか?DBログ情報が各Crystal Reportsセクションに適用されるとアプリケーションが遅くなる
JFYI:すべてのCRは、同じログイン資格情報を使用して同じDBに接続します。前もって感謝します。
readDiamondBillReport = new RealDiamondBill();
crConnectionInfo.ServerName = db.Connection.DataSource;
crConnectionInfo.DatabaseName = db.Connection.Database;
crConnectionInfo.UserID = "client";
crConnectionInfo.Password = "client";
crConnectionInfo.IntegratedSecurity = false;
CrTables = readDiamondBillReport.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}
Sections crSections2 = readDiamondBillReport.ReportDefinition.Sections;
// loop through all the sections to find all the report objects
foreach (Section crSection in crSections2)
{
ReportObjects crReportObjects = crSection.ReportObjects;
//loop through all the report objects in there to find all subreports
foreach (ReportObject crReportObject in crReportObjects)
{
if (crReportObject.Kind == ReportObjectKind.SubreportObject)
{
SubreportObject crSubreportObject = (SubreportObject)crReportObject;
//open the subreport object and logon as for the general report
ReportDocument crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
Tables SubCrTables = crSubreportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table SubCrTable in SubCrTables)
{
crtableLogoninfo = SubCrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = crConnectionInfo;
SubCrTable.ApplyLogOnInfo(crtableLogoninfo);
}
}
}
}
readDiamondBillReport.Refresh();
好奇心の疎外さから、レポートのDB更新のタイミングをリフレッシュと比較してみましたか? – Ryan
@ Ryan:データベース更新のタイミングをどういう意味ですか? – Marshal
あなたのコードが 'readDiamondBillReport.Refresh()'でレポートをリフレッシュするのと比べてレポートのデータソースを更新するのにかかる時間を意味します。私の推測では、10秒間の大半が更新ではなく更新に行くということです。 – Ryan