Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 566
  • Last Modified:

Opening Crystal Report 10 using dotnet

How do I Open a Crystal Report 10 thru dotnet in another server?
0
vclemos
Asked:
vclemos
  • 6
  • 5
  • 3
2 Solutions
 
janmariniCommented:
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#?
0
 
mlmccCommented:
These samples should give you enough information to get started using VB.Net

http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_web_samples.exe.asp

mlmcc
0
 
vclemosAuthor Commented:
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?
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
mlmccCommented:
>>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
0
 
janmariniCommented:
What error do you get when you run your code?
0
 
vclemosAuthor Commented:
Thank you for your quick response, but we found a way to make it work.

Best regards.
0
 
janmariniCommented:
Did you add a reference to the CrystalDecisions.ReportAppServer in your project  and have this line?

Using CrystalDecisions.ReportAppServer.DataSetConversion;

 public class SimpleRASCrystalReport
  {
...
0
 
janmariniCommented:
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.
0
 
vclemosAuthor Commented:
We added manually the refence to dll in web.config allowing reference the class CrystalDecisions.ReportAppServer.DataSetConversion in the program code.

Thanks for helping
0
 
janmariniCommented:
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...
0
 
vclemosAuthor Commented:
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?
0
 
vclemosAuthor Commented:
The grade?
0
 
janmariniCommented:

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?
0
 
mlmccCommented:
Glad i could help

mlmcc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now