Link to home
Start Free TrialLog in
Avatar of vclemos
vclemos

asked on

Opening Crystal Report 10 using dotnet

How do I Open a Crystal Report 10 thru dotnet in another server?
Avatar of janmarini
janmarini

Need more info - unclear on what you are asking...
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#?
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vclemos

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.ReportAppServer.DataSetConversion.DataSetConverter.Convert(Dataset) (* the name space do not exist).
CrystalDecisions.ReportAppServer.DataSetConversion (* in default Visual Studio 2005 Professional installation).
 
 See below the code:
 
 public class SimpleRASCrystalReport
  {
   
   protected CrystalDecisions.Web.CrystalReportViewer ObjReportViewer = new CrystalDecisions.Web.CrystalReportViewer();
            protected string _reportLocation = "";
            protected ReportClientDocument _reportDocument;
   protected System.Data.DataSet _dataset;
   protected string _tableName;
   
     
   public void InicializaComponenteRelatorio(CrystalDecisions.Web.CrystalReportViewer reportViewer, string reportLocation, System.Data.DataSet dataset, string tableName)
   {  
    this.ObjReportViewer  = reportViewer;
    this._reportLocation = reportLocation;
    this._dataset = dataset;
    this._tableName = tableName;
    this.ObjReportViewer.DisplayGroupTree = false;
                this.ObjReportViewer.EnableDrillDown = 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.ReportAppServer = 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.DatabaseController.SetDataSource(DataSetConverter.Convert(_dataset), null, null);
       
    // Refresh Data
    _reportDocument.RefreshReportDocument();
   
    // view report
    ObjReportViewer.ReportSource = _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?
>>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
What error do you get when you run your code?
Avatar of vclemos

ASKER

Thank you for your quick response, but we found a way to make it work.

Best regards.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of vclemos

ASKER

We added manually the refence to dll in web.config allowing reference the class CrystalDecisions.ReportAppServer.DataSetConversion in the program code.

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...
Avatar of vclemos

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?
Avatar of vclemos

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