We help IT Professionals succeed at work.

.Net Crystal Reports Viewer against Crystal Reports 2011

Hi,
I have a Crystal Reports which I executed in Crystal Reports 2011 and it runs well, but when I run the same report using the Crystal Reports Viewer using a Windows Application in Visual Studio.Net 2005(Visual Basic) it takes a lot of time to come up the report after I provide the parameters.

In other words I use Crystal Reports 2011 to run a report and it takes around 45 seconds to come up, by the other way I developed a Windows Application which uses the Crystal Reports Viewer and It takes a lot of time to come up with the resulting report.  It takes around 12 minutes to come up Vs Crystal Reports which takes fewer.

My Visual Basic.net 2005 Application process a selected report by the user, apply the logon credentials to all the tables of the report, then it delegates the run process to the Crystal Reports Viewer.  The Crystal Reports Viewer asks for the parameters and after provide them is when the issue happens.

.net Crystal Reports Viewer runs very slower than Crystal Reports 2011.

Please, any help will be appreciated.
Comment
Watch Question

Mike McCrackenSenior Consultant
SILVER EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
CR2011 doesn't come with an SDK for use in VS.

SAP/Crystal recommends using VS2010 and the Crystal assemblies for CR4VS2010.

The Crystal assemblies in VS2005 are version 10.2 and as such probably have to convert the report to the older format and eliminate any CR2011 features that aren't supported.

mlmcc

Author

Commented:
Actually I did a change to the report using The Crystal Reports embedded with Visual Studio and when I preview the report using Visual Studio 2005 it runs as Crystal Reports 2011 does(regarding the time it takes), but when I run the Windows Application to use The Crystal Reports Viewer to execute the report the same is happening(It takes a lot of time to generate the report).
Mike McCrackenSenior Consultant
SILVER EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
WHen you changed the report in VS2005 it changed the report file format.

mlmcc

Author

Commented:
I think that Yes, because I save it using Visual Studio and it changed from 37.5 KB to 38 KB of size and its modified date & time change to a new one.
BRONZE EXPERT
Top Expert 2011

Commented:
Are you sure you are setting correctly the connection data in VS2005? How many subreports do you have in this report?

Author

Commented:
One SubReports.  I set well the data because it finally comes with the resulting report, but after more than 12 minutes.
BRONZE EXPERT
Top Expert 2011

Commented:
Do you have the option "verify on first refreh" ON ? You may try what will be the difference if you turn it off.
If you are setting the connection in code, check if this code works. For example if possible set the report to use Integrated security and comment your code to set the connection in VS2005. Then check if the report is running faster.

What is the version of the referenced crystal dlls ? If you are using components distributed with VS2005 there will be a conversion.
Are you running the report from the same computer in both cases ( 2011 and 2005) ?

Author

Commented:
I verified, and the report doesn't have the "Verify on First Refresh" checked.  The reference Crystal Dlls are the ones which comes with the FrameWork 2.0.

See one thing that I found right now.  I went to the Crystal Reports Viewer Control and pointed it to the Crystal Report I'm trying to run, but using the "Choose a Report" Link in Visual Studio.  In other words Instead of using the Load function in code in Visual Studio, I set  the Report Viewer to directly pointed to the Crystal Report I'm trying to execute and I run the application by initially runs the forms which has the Crystal Reports Viewer that I set, and in this way the report runs at an acceptable time(20 seconds I think).  Could this bring an idea about what is happening?
BRONZE EXPERT
Top Expert 2011

Commented:
Can you save the report in VS2005? Obviously you have issues with loading the report not running it.
If the report is saved in 2011 and you are loading it with VS2005 there may be a conversion behind the scenes each time when yoy run the report.
Commented:
O.K.  The points you told me to do guide me to apply a change in the Logon credentials in the code since there is a difference in the Crystal Logon Viewer and Crystal Logon in the Code.  Since the Database is in an AS/400 the Crystal Rreports just choose the OBCS Connection Driver and that was what I change in the Code:

I deleted the Line where I set the Database since this is not set when you set and ODBC for an AS/400 Db2 Database.  First I was using it next and the reports was taking a lot of time next I comment this line of code where I set the Database and the reports now takes 1 minute or less to present the report.

            ConInfo.ConnectionInfo.ServerName = "ODBC Name"
            'ConInfo.ConnectionInfo.DatabaseName = "S10CDE84"

If want more info fro me just let me know.

Thank You for guide me to found the solution.  
BRONZE EXPERT
Top Expert 2011
Commented:
Well, I don't know what is happenning in your scenario. When the connection is not set successfully report may be still able to connect using the last succesfull connection, but first will try the new one and this may take time. My guess is that the line where you set the server is the problem line. You may try to comment just this line and leave the line for the database active.
Commented:
O.K.  Finally as a solution I can say that if you are connecting a Crystal Report to an AS/400 Db2 Database, do not set the DatabaseName Property in the Logon Credentials for the Crystal Report; just set User ID, Password and ServerName.  You should not set the DatabaseName Property when using a Client Access ODBC Driver when connecting a Crystal Report to a DB2 Database because the Client Access ODBC Driver already provides all the settings for you(Database, Ip Address...).  That is what I can set as the solution for the problem.

Do not set the following line in the logon credentials for Crystal Reports:

ConInfo.ConnectionInfo.DatabaseName = "Databasename"

Author

Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for ialsina's comment http:/Q_27431652.html#37094628

for the following reason:

Thank You for your prompt attention and guide.
BRONZE EXPERT
Top Expert 2011

Commented:
Was any of the comments helpful ?

Author

Commented:
When you told me to use the Integrated Security to apply the Logon Credentials to the Crystal Report I began to apply changes to the Application and when I pointed the Report Viewer directly to the Report instead of using code to load the report and use it in the Report Viewer I noticed that it runs at an acceptable time, instead of using the code and apply logon credentials where I was using and applying the credentials with the DatabaseName Property that I mentioned before.  In some way that particular comment move me for the solution.  I don't know if it really is what you expect, but it really helped me since I was with this problem for more than one month ago.

Maybe you believe that your help wasn't enough but, you helped me in the sence that I was struggling with this problem weeks ago.

If you feel that I have to provide more info. Let me know and I will do so.

Author

Commented:
I agreed to object since I'm not an expert in this web site, but I could read that this question can be moved to a different forum like the Community Support.  I apologize, I delegate to you what should be made with this question.
Mike McCrackenSenior Consultant
SILVER EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
If a comment(s) was helpful in getting to the solution you can accept your comment as the solutionn and use the comments as assisted solutions awarding some or all of the points.

mlmcc

Author

Commented:
Thank You for help me to trace where the problem can be.  Your iteration and guide was help for me to analize and detect where the problem should be.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.