vss-pt
asked on
ReportDocument take a log time to load
If the production database is different from the development database loading the report take more then two minutes.
Is the a way to avoid this issue.
The code to print the report is the following....
Is the a way to avoid this issue.
The code to print the report is the following....
Cursor.Current = Cursors.WaitCursor;
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.ServerName = m_ServerName;
connectionInfo.DatabaseName = m_DatabaseName;
connectionInfo.UserID = m_UserID;
connectionInfo.Password = m_Password;
connectionInfo.IntegratedSecurity = false;
ReportDocument myReport = new ReportDocument();
myReport.FileName = reportPath;
myReport.SetDatabaseLogon(m_UserID, m_Password);
myReport.Load(reportPath); // takes about two minutes
SetDBConnectionForReport(connectionInfo, myReport);
SetDBConnectionForSubreports(connectionInfo, myReport);
CRPrint.ReportSource = myReport;
CRPrint.SelectionFormula = selFormula;
CRPrint.RefreshReport();
if (printerName == string.Empty)
{
Cursor.Current = Cursors.Default;
PrintDialog dlg = new PrintDialog();
dlg.ShowDialog();
Cursor.Current = Cursors.WaitCursor;
myReport.PrintOptions.PrinterName=
dlg.PrinterSettings.PrinterName;
printerName = myReport.PrintOptions.PrinterName;
}
myReport.PrintToPrinter(1,false,1,1);
Cursor.Current = Cursors.Default;
Crystal 2008 just seems to take a very long time to switch the data to different databases. We have speeded up some necessary reports by converting the data source to a command, meaning it only has one 'table' to switch databases, but there was a significant drop in loading speed between Crystal XI and Crystal 2008.
You can save the production report with the production connection and you will avoid crystal reports to verify the database each time you switch the connections. You will still need to set database connection , but this will be just to set the user and password. However loading is before SetDBConnectionForReport so your problem is somewhere else. 2 minutes is too big period . It looks like timeout to me. It can be a missing printer, mapped drive or a connection issue.
Are you running the report on the same machine where test world report is working fine?
Are you running the report on the same machine where test world report is working fine?
ASKER
By changing the database to the production on Crystal Reports solves the problem, but still if the client changes teh database name or server location the problem persists
The mais issue is that the same report is used in diferente Servers / databases. It's anoying tho produce one for each server /database.
It seem that on Load it check´s the database connection, before I have the chance to change it.
I have seen some 'load' event preapps is there the correct place to change logon parametes?
The mais issue is that the same report is used in diferente Servers / databases. It's anoying tho produce one for each server /database.
It seem that on Load it check´s the database connection, before I have the chance to change it.
I have seen some 'load' event preapps is there the correct place to change logon parametes?
Is there an OPEN method on the report document?
I believe LOAD tries to run the report where as OPEN just opens the report for modifications like you want to do?
myReport.OPEN(reportPath);
Why do you do a REFRESH?
If you are always going to do a refresh, you could simply not save the report with data and the report will automatically load the newest data.
mlmcc
I believe LOAD tries to run the report where as OPEN just opens the report for modifications like you want to do?
myReport.OPEN(reportPath);
Why do you do a REFRESH?
If you are always going to do a refresh, you could simply not save the report with data and the report will automatically load the newest data.
mlmcc
Do you have option "Save data with report" checked (in Report options) ?
ASKER
No I don't wave the option 'save data with report' and there is no 'open' method available.
I have addes thsin tow lines with no efect.
myReport.FileName = reportPath;
myReport.SetDatabaseLogon( m_UserID, m_Password, m_Database);
myReport.Load(reportPath);
There is a EnterpriseSession method, what is it for?
I have addes thsin tow lines with no efect.
myReport.FileName = reportPath;
myReport.SetDatabaseLogon(
myReport.Load(reportPath);
There is a EnterpriseSession method, what is it for?
Check this sample code
http://vb.net-informations.com/crystal-report/vb.net_crystal_report_load_dynamically.htm
mlmcc
http://vb.net-informations.com/crystal-report/vb.net_crystal_report_load_dynamically.htm
mlmcc
ASKER
That is what I'm doing.
The main isue is the load method.
It take abou 2 minut's to realize the database is not available.
The main isue is the load method.
It take abou 2 minut's to realize the database is not available.
I don't see the LOAD used in the sample
mlmcc
mlmcc
vss-pt, obviously the report is trying to connect to the database on load. Any chance to upload the report here ?
If you cannot upload then:
- What is the version of this report ? I have seen some crystal 8 -8.5 reports with integrated security which were trying to connect to the initial database no matter what you are doing. What is your login type ?
- Do you use command ?
- Do you have dynamic value list ?
If you cannot upload then:
- What is the version of this report ? I have seen some crystal 8 -8.5 reports with integrated security which were trying to connect to the initial database no matter what you are doing. What is your login type ?
- Do you use command ?
- Do you have dynamic value list ?
ASKER
mlmcc:
The load method is the line in samples...
cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
...
vasto:
I don't have the final release on hand, but this repçort prodices the same efect.
APL-Frente.rpt
The load method is the line in samples...
cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
...
vasto:
I don't have the final release on hand, but this repçort prodices the same efect.
APL-Frente.rpt
ASKER
vasto:
Do you need more info?
Do you need more info?
vss-pt, I will check the report. Thanks!
ASKER
I think the problem is not report related, but with the Crystal API for VS 2005.
But still if you have any ideas. For now I have created a copy of the report for each database,
I know it doesn´t make any sense but I cant have the use waitin 2 minutes to print a card.
But still if you have any ideas. For now I have created a copy of the report for each database,
I know it doesn´t make any sense but I cant have the use waitin 2 minutes to print a card.
vss-pt , something is messed up with the database information.
We have a tool which is changing the datasource to fix issues like this. Please check the report and let me know if it is fixed now. APL-Frente.rpt
We have a tool which is changing the datasource to fix issues like this. Please check the report and let me know if it is fixed now. APL-Frente.rpt
ASKER
vasto:
Yes in fact loadreport executes imediatly, but setting server/database/user/passw ord wont prevent login box to be displayed.
On the login box, the database is blank so we cannot even manualy logon.
But still this is the way to solve the problem
Two questions, the first one is what product do you use to 'fix' the report? Also what version is the report on?
Yes in fact loadreport executes imediatly, but setting server/database/user/passw
On the login box, the database is blank so we cannot even manualy logon.
But still this is the way to solve the problem
Two questions, the first one is what product do you use to 'fix' the report? Also what version is the report on?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Partial solution, But a very good lead.
These are reports users upload here so I don't expect to have the database.
mlmcc