on 07-29-2015 11:32 AM
Hi Friends,
i am trying to use CrystalReport in VisualStudio 2010. for this task i have imported CrystalDecisions.CrystalReports.Engine dll(version:9.1.3300.0).
please find some question below:-
so is there any version issue?
Please suggest on the above issue.
Many Thanks in advance.
Thanks
Rohit
No you're not using the correct files for VS 2010 - that is a very old version of the SDK you're using.
You can download the correct Crystal Reports for Visual Studio from here: http://scn.sap.com/docs/DOC-7824
1. Uninstall the existing SDK - the new one does not play well when installed side-by-side with the old one.
2. Download and install the latest "Install Executable" from the link above. This will integrate the SDK into the VS 2010 IDE.
3. Also available on this link are various "runtime" installs for use when deploying your application - DO NOT install any of them on the workstation where VS is installed!
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So to validate you did use the correct installers do this:
Uninstall everything CR for VS.
Install this on your DEV PC ONLY:
http://downloads.businessobjects.com/akdlm/cr4vs2010/CRforVS_13_0_14.exe
Create a new Winform Project and select 4.0 Framework, do not use Client.
Add the Crystal reports Viewer to the Tool bar and drop the version 13.0.x.x onto your form.
Once you do that then you will see the 3 CR assemblies added to your project, Engine, Shared and Viewer.
Instantiate the Engine and the report document and then one 2 lines to open your report directly and set the report object to the viewer and run the app.
What happens?
If that works then your original project may have some references pointing to the wrong CR files.
When upgrading your app VS should simply replace all of the CR assemblies but sometimes it does not replace the viewer so open your form, delete the CR viewer and add it back in, making sure it's version 13.
Don
Keeping in mind that you were previously referencing an older assembly, make sure that you uninstall any previous versions of CR that bundled with any Visual Studio. E.g.; CR 9.1, CR 10.2 and CR 10.5.
As Dell implied, make sure you are referencing all the needed assemblies and they are all version 13.x. At minimum you will require the following references:
CrystalDecision.CrystalReports.Engine
CrystalDecisions.Shared
CrystalDecisions.ReportSource
CrystalDecisions.Windows //for win apps
CrystalDecisions.Web // for web apps
The detail view in your screenshot has CrystalDecision.ReportAppserver
This indicates that you are trying to use the InProc RAS SDK. Unless you have a real need for this, don't - not for now anyhow. To help you get started, you may want to have a look at the following doc:
Crystal Reports for Visual Studio 2005 Walkthro... | SCN
Don't let the title throw you as the doc applies fully to all versions of CR and VS .NET.
There are also a number of sample apps listed here:
Crystal Reports for .NET SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
I recommend starting with vbnet_win_simplepreviewreport.zip and then vbnet_win_dbengine.zip. After that exporting or printing or parameter passing - depending on your project requirements.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow me on Twitter
Thanks a lot for your reply.
still i am getting error related to Path.
actually i just want to export rpt file to excel files.i am using console application for the same.
ReportDocument rt = new ReportDocument();
rt.Load(@"C:\bPaid_3_TRACS_to_BankWORKS.rpt");
ExportOptions rptExportOption;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions rptFormatOption = new PdfRtfWordFormatOptions();
string reportFileName = "C:\abc.pdf";
CrDiskFileDestinationOptions.DiskFileName = reportFileName;
rptExportOption = rt.ExportOptions;
{
rptExportOption.ExportDestinationType = ExportDestinationType.DiskFile;
//if we want to generate the report as PDF, change the ExportFormatType as "ExportFormatType.PortableDocFormat"
//if we want to generate the report as Excel, change the ExportFormatType as "ExportFormatType.Excel"
rptExportOption.ExportFormatType = ExportFormatType.PortableDocFormat;
rptExportOption.ExportDestinationOptions = CrDiskFileDestinationOptions;
rptExportOption.ExportFormatOptions = rptFormatOption;
}
rt.Export();
i am using below references:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.ReportSource;
Please suggest on this and agian thanka a lot for your time.
Thanks,
Rohit
I wonder if throwing Process Monitor at this will help. The ProcMon logs may tell us what path is the issue. You'd be looking for message like Access Denied.
ProcMon is here:
- Ludek
Just wondering, do you get the same error for only 3 lines of code.
ReportDocument rt = new ReportDocument();
rt.Load(@"C:\bPaid_3_TRACS_to_BankWORKS.rpt");
CrystalReportsViewer1.ReportSource= rt;
Do you see the report loaded in rt? (breakpoint)
What happens when you directly assign the report to viewer (set ReportSource property of viewer control).
I did face this issue with SP14 web app but it was intermittent in my case and I resolved it by adding ReportDoc object to HTTP session.
Could you also try a sample web app with above code.
Thanks,
Bhushan
Hi Bhushan,
Thanks for your reply.
I hope , i am not getting error on Load.beacuse through debugger(breakpoint) i can see some data load in rt.
i am creating console Application so i am not using CrystalReportsViewer1. This application intailly will load Rpt file and then export to excel file.
You can view my piece of code above.
Thanks
Rohit
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.