We have quite a few reports which were developed earlier in Crystal Reports 8.5. We are now planning to use these reports in our web application developed in VS 2008 (C#).
What dlls are needed for calling 8.5 in the application and how should they be added to the application while shipping it to the client?
They are also struggling to get the code running. Would also need the code to call the report with parameters.
You should be able to use the CR .NET assemblies that come with VS 2008. As for shipping to the client, you can either add the CR DLLs to your bin subfolder or use the CR installation package that should add the DLLs to the client's GAC. Go to SAP's website
and do a search on "Crystal Reports .NET downloads".
Thanks for the info. Does the CR.net assemblies which come with VS 2008 support reports that were developed in crystal report 8.5? I see these assemblies in VS 2008:
crystaldecisions.crystalreports.engine
crystaldecisions.reportsource
crystaldecisions.shared
crystaldecisions.web
But all these say Version=10.5.3700.0 . Will this support the reports which were developed crystalreports 8.5 ?
They are using this code to call the report from C#:
The above code seems to work fine without any bug but doesnt bring up the report on the screen... are we missing something here ? Have used the printtoprinter method, but is there anything similar to bring up the report on the screen?
You should be able to use CR 8.5 reports with the CR version that comes with VS 2008.
As for your code, you need to use the CrystalReportViewer control within an ASPX page to display your report. This control comes with the ReportSource. Once you have defined your ReportDocument, then set the ReportSource of your CrystalReportViewer to
the ReportDocument object.
Thanks Careed. Sorry, guess I had not given you the full code earlier - we are using the crystalviewercontrol. The report output is fine. But the problem we have now is the report output gets displayed in the same aspx page below the main form on click of
the print button. We would like to have the report opened as a seperate pop up. How to acheive this - please advise. This is the coding we have right now:
string reportPath = Server.MapPath("webbooking.rpt");ReportDocument
oRpt = new
ReportDocument();try
Additionally, note that if your CrystalReportViewer is on the page that you are currently on, then, based on the ASP.NET postback functionality, the report will display in the CRV on that page. If you want it on a different page, then it needs to be defined
on a different.
As for pop-ups, since these, as a separate page, can be very problematic as most people have pop-up blockers functioning in their browsers, you might consider an AJAX alternative. In the AJAX Control Toolkit, there is a ModalPopup control that you could
use. In code, it works like a Panel control which will behavior like a popup, so you would only need to add the CRV to the ModalPopup control. Note that this is all on the same ASPX page.
Christopher Reed, MCT, MCPD, MCTS, Microsoft Specialist, MTA
"The oxen are slow, but the earth is patient."
Marked as answer by rnarayani on Jul 20, 2010 03:03 PM
Thanks for the info! Will surely try the AJAX alternative and obviously come back to you if I need help there!
I had already changed my code with window.open command sometime back and it does work with the pop up right now, but yes after seeing your reply, would prefer now to use the panel control as pop-ups will be an issue..
I hv developed the reports and the reports that were developed in 8.5 successfully worked with crystaldecisions dll in my local.
I am trying to upload this on the server and unfortunately it gives me this error:
Parser Error Message: Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
I understand that the specified crystaldecisions dll is missing. I guess the only other way is to copy the bin folder or add this dll to the server pc. We created this as a web site and not as a web application, so we dont have a bin folder. I searched in
my local and found that the dll is being picked up from the programfiles/businessobject/..../managed folder. Is there any way I can copy this file somewhere in the server and try to run it successfully?
I have managed to copy the required assemblies from my local to the server.
(1)But I keep getting this exception for one assembly alone:
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the
file specified.
I hv deleted and tried copying it again several times, but it doesnt seem to work..
(2) I have another problem. Even if this works, this is only a server to test within our organisation. I need to upload the same files into another server (maintained by a service provider company). I am under the impression that these crystal assemblies
would be available there. What if they arent? I cant copy files like this onto that server. Any other solution please?
For the CrystalDecisions.ReportAppServer.CommLayer assembly, remove all references to CrystalDecisions.ReportAppServer.* within your project and this should go away.
As for your service provider, they probably do not have the CR.NET assemblies installed as this would be an added expense for them. Thus, you would better off adding the CR.NET DLLs to your bin folder on your web application.
Christopher Reed, MCT, MCPD, MCTS, Microsoft Specialist, MTA
"The oxen are slow, but the earth is patient."
rnarayani
Member
1 Points
13 Posts
Calling Reports developed in crystal reports 8.5 in VS2008
Jul 16, 2010 10:08 AM|LINK
Hi,
We have quite a few reports which were developed earlier in Crystal Reports 8.5. We are now planning to use these reports in our web application developed in VS 2008 (C#).
What dlls are needed for calling 8.5 in the application and how should they be added to the application while shipping it to the client?
They are also struggling to get the code running. Would also need the code to call the report with parameters.
Please help.
Thanks in advance.
Careed
All-Star
18796 Points
3648 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 16, 2010 02:00 PM|LINK
You should be able to use the CR .NET assemblies that come with VS 2008. As for shipping to the client, you can either add the CR DLLs to your bin subfolder or use the CR installation package that should add the DLLs to the client's GAC. Go to SAP's website and do a search on "Crystal Reports .NET downloads".
As for some code help, you might take a look at the Crystal Alliance site: http://aspalliance.com/crystal/
"The oxen are slow, but the earth is patient."
rnarayani
Member
1 Points
13 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 16, 2010 03:38 PM|LINK
Thanks for the info. Does the CR.net assemblies which come with VS 2008 support reports that were developed in crystal report 8.5? I see these assemblies in VS 2008:
crystaldecisions.crystalreports.engine
crystaldecisions.reportsource
crystaldecisions.shared
crystaldecisions.web
But all these say Version=10.5.3700.0 . Will this support the reports which were developed crystalreports 8.5 ?
They are using this code to call the report from C#:
String reportPath = Server.MapPath("InterpBooking.rpt");
ReportDocument oRpt = new ReportDocument();
oRpt.Load(reportPath);
oRpt.SetParameterValue("OrderID", "229552");
oRpt.Close();
The above code seems to work fine without any bug but doesnt bring up the report on the screen... are we missing something here ? Have used the printtoprinter method, but is there anything similar to bring up the report on the screen?
Thanks in advance.
Careed
All-Star
18796 Points
3648 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 16, 2010 08:08 PM|LINK
You should be able to use CR 8.5 reports with the CR version that comes with VS 2008.
As for your code, you need to use the CrystalReportViewer control within an ASPX page to display your report. This control comes with the ReportSource. Once you have defined your ReportDocument, then set the ReportSource of your CrystalReportViewer to the ReportDocument object.
Review this for some tutorials on using Crystal Reports in .NET: http://msdn.microsoft.com/en-us/library/ms227881(v=VS.90).aspx
"The oxen are slow, but the earth is patient."
rnarayani
Member
1 Points
13 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 19, 2010 09:14 AM|LINK
Thanks Careed. Sorry, guess I had not given you the full code earlier - we are using the crystalviewercontrol. The report output is fine. But the problem we have now is the report output gets displayed in the same aspx page below the main form on click of the print button. We would like to have the report opened as a seperate pop up. How to acheive this - please advise. This is the coding we have right now:
string reportPath = Server.MapPath("webbooking.rpt");ReportDocument oRpt = new ReportDocument();try{
oRpt.Load(reportPath);
oRpt.SetParameterValue("orderID", "229604");
CRV1.ReportSource = oRpt;
}
catch (Exception ee)
{
lblMessage.Text = ee.Message;
lblMessage.ForeColor = Color.Red;
}
finally{
oRpt = null;
}
Careed
All-Star
18796 Points
3648 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 19, 2010 02:00 PM|LINK
How is your print button defined?
Additionally, note that if your CrystalReportViewer is on the page that you are currently on, then, based on the ASP.NET postback functionality, the report will display in the CRV on that page. If you want it on a different page, then it needs to be defined on a different.
As for pop-ups, since these, as a separate page, can be very problematic as most people have pop-up blockers functioning in their browsers, you might consider an AJAX alternative. In the AJAX Control Toolkit, there is a ModalPopup control that you could use. In code, it works like a Panel control which will behavior like a popup, so you would only need to add the CRV to the ModalPopup control. Note that this is all on the same ASPX page.
"The oxen are slow, but the earth is patient."
rnarayani
Member
1 Points
13 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 19, 2010 02:50 PM|LINK
Hi Careed,
Thanks for the info! Will surely try the AJAX alternative and obviously come back to you if I need help there!
I had already changed my code with window.open command sometime back and it does work with the pop up right now, but yes after seeing your reply, would prefer now to use the panel control as pop-ups will be an issue..
Thanks.
rnarayani
Member
1 Points
13 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 27, 2010 02:13 PM|LINK
Hi again!!
I hv developed the reports and the reports that were developed in 8.5 successfully worked with crystaldecisions dll in my local.
I am trying to upload this on the server and unfortunately it gives me this error:
Parser Error Message: Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
I understand that the specified crystaldecisions dll is missing. I guess the only other way is to copy the bin folder or add this dll to the server pc. We created this as a web site and not as a web application, so we dont have a bin folder. I searched in my local and found that the dll is being picked up from the programfiles/businessobject/..../managed folder. Is there any way I can copy this file somewhere in the server and try to run it successfully?
Thanks,
rnarayani
Member
1 Points
13 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Jul 27, 2010 03:35 PM|LINK
Hi,
I have managed to copy the required assemblies from my local to the server.
(1)But I keep getting this exception for one assembly alone:
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
I hv deleted and tried copying it again several times, but it doesnt seem to work..
(2) I have another problem. Even if this works, this is only a server to test within our organisation. I need to upload the same files into another server (maintained by a service provider company). I am under the impression that these crystal assemblies would be available there. What if they arent? I cant copy files like this onto that server. Any other solution please?
Please help...
Careed
All-Star
18796 Points
3648 Posts
Re: Calling Reports developed in crystal reports 8.5 in VS2008
Aug 07, 2010 03:16 PM|LINK
For the CrystalDecisions.ReportAppServer.CommLayer assembly, remove all references to CrystalDecisions.ReportAppServer.* within your project and this should go away.
As for your service provider, they probably do not have the CR.NET assemblies installed as this would be an added expense for them. Thus, you would better off adding the CR.NET DLLs to your bin folder on your web application.
"The oxen are slow, but the earth is patient."