Derzeit verwende ich die folgende Methode, um allen Berichtsabschnitten Verbindungsinformationen zuzuweisen. Aber da ich viele Abschnitte im Bericht habe, wird der Bericht nach fast 10 Sekunden angezeigt. Das sieht wirklich langsam aus. Gibt es eine andere Methode, mit der wir Anmeldeinformationen für alle CRs festlegen können, wenn sie auf der Clientseite installiert werden?Anwendung wird langsam ausgeführt, wenn DB-Protokollierungsinformationen auf die einzelnen Crystal Reports-Abschnitte angewendet werden
JFYI: Alle CRs verbinden sich mit derselben Datenbank mit denselben Anmeldedaten. Vielen Dank im Voraus.
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();
Aus Neugier haben Sie versucht, das DB-Update des Berichts im Vergleich zu seiner Aktualisierung zu testen? – Ryan
@Ryan: Was bedeutet das Timing der Datenbankaktualisierung? – Marshal
Ich meine Zeit, wie lange es dauert, bis der Code die Datenquellen der Berichte aktualisiert, anstatt den Bericht über 'readDiamondBillReport.Refresh()' zu aktualisieren. Meine Vermutung ist, dass eine große Mehrheit der 10 Sekunden zur Aktualisierung und nicht zum Update geht. – Ryan