vclemos
asked on
Opening Crystal Report 10 using dotnet
How do I Open a Crystal Report 10 thru dotnet in another server?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
We use Visual Studio 2005 Professional and Crystal Reports 10 in different servers.
I´m receiving an error when accessing the conversion method: methodCrystalDecisions.Rep ortAppServ er.DataSet Conversion .DataSetCo nverter.Co nvert(Data set) (* the name space do not exist).
CrystalDecisions.ReportApp Server.Dat aSetConver sion (* in default Visual Studio 2005 Professional installation).
See below the code:
public class SimpleRASCrystalReport
{
protected CrystalDecisions.Web.Cryst alReportVi ewer ObjReportViewer = new CrystalDecisions.Web.Cryst alReportVi ewer();
protected string _reportLocation = "";
protected ReportClientDocument _reportDocument;
protected System.Data.DataSet _dataset;
protected string _tableName;
public void InicializaComponenteRelato rio(Crysta lDecisions .Web.Cryst alReportVi ewer reportViewer, string reportLocation, System.Data.DataSet dataset, string tableName)
{
this.ObjReportViewer = reportViewer;
this._reportLocation = reportLocation;
this._dataset = dataset;
this._tableName = tableName;
this.ObjReportViewer.Displ ayGroupTre e = false;
this.ObjReportViewer.Enabl eDrillDown = false;
}
//Conect to the report server by name
public void Open(string Server)
{
// create report client document
_reportDocument = new ReportClientDocument();
// set RAS server location
_reportDocument.ReportAppS erver = Server;
// Open report document
object path = _reportLocation;
_reportDocument.Open(ref path, 0);
}
public void Run()
{
// pass dataset to report
//Pass entire DataSet to the report. As is not passing table per table, do not need the table name.
_reportDocument.DatabaseCo ntroller.S etDataSour ce(DataSet Converter. Convert(_d ataset), null, null);
// Refresh Data
_reportDocument.RefreshRep ortDocumen t();
// view report
ObjReportViewer.ReportSour ce = _reportDocument;
}
}
Is this the correct way to made those calls in the above mentioned environment?
Is there any need to made updates in the Visual Studio 2005 regarding to Crystal Report 10?
I´m receiving an error when accessing the conversion method: methodCrystalDecisions.Rep
CrystalDecisions.ReportApp
See below the code:
public class SimpleRASCrystalReport
{
protected CrystalDecisions.Web.Cryst
protected string _reportLocation = "";
protected ReportClientDocument _reportDocument;
protected System.Data.DataSet _dataset;
protected string _tableName;
public void InicializaComponenteRelato
{
this.ObjReportViewer = reportViewer;
this._reportLocation = reportLocation;
this._dataset = dataset;
this._tableName = tableName;
this.ObjReportViewer.Displ
this.ObjReportViewer.Enabl
}
//Conect to the report server by name
public void Open(string Server)
{
// create report client document
_reportDocument = new ReportClientDocument();
// set RAS server location
_reportDocument.ReportAppS
// Open report document
object path = _reportLocation;
_reportDocument.Open(ref path, 0);
}
public void Run()
{
// pass dataset to report
//Pass entire DataSet to the report. As is not passing table per table, do not need the table name.
_reportDocument.DatabaseCo
// Refresh Data
_reportDocument.RefreshRep
// view report
ObjReportViewer.ReportSour
}
}
Is this the correct way to made those calls in the above mentioned environment?
Is there any need to made updates in the Visual Studio 2005 regarding to Crystal Report 10?
>>Is this the correct way to made those calls in the above mentioned environment?
I don't know. I don't have .Net.
I suspect you are missing one of the Crystal rferences
>>Is there any need to made updates in the Visual Studio 2005 regarding to Crystal Report 10?
None that I know of. The version of Crystal that comes with VS 2005 is CR10.
mlmcc
I don't know. I don't have .Net.
I suspect you are missing one of the Crystal rferences
>>Is there any need to made updates in the Visual Studio 2005 regarding to Crystal Report 10?
None that I know of. The version of Crystal that comes with VS 2005 is CR10.
mlmcc
What error do you get when you run your code?
ASKER
Thank you for your quick response, but we found a way to make it work.
Best regards.
Best regards.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops - timing :-) Glad you got it to work, please share your solution so this topic can be PAQ'd and can help others in the future.
ASKER
We added manually the refence to dll in web.config allowing reference the class CrystalDecisions.ReportApp Server.Dat aSetConver sion in the program code.
Thanks for helping
Thanks for helping
Why a C? Seems like I did offer pretty much the same solution as the one that you came up with. Are you familiar with the Grading Guideline fors EE? Please see Help/Closing Questions/What's the right grade to give...
ASKER
Maybe I gave the wrong grade.
The information received was usefull to led us to solve the problem, after some work done.
Is there any way to change the grave?
The information received was usefull to led us to solve the problem, after some work done.
Is there any way to change the grave?
ASKER
The grade?
That's good to know, I never got a C before :-) I'm not sure how or if it can be changed, I think mmlc might know?
Glad i could help
mlmcc
mlmcc
Do you want to change the connection info that your report uses at runtime?
Do you want to deploy your app to another server?
What version of .Net, VB or C#?