Link to home
Start Free TrialLog in
Avatar of xassets
xassets

asked on

Creating Crystal Reports Programmatically in .NET

Is it possible to create crystal reports programmatically using VB.NET (or anything.NET) with "Crystal Reports for .NET"

Ie I want to do some kind of CreateObject for the report, create the report sections, add the fields, datasource etc and set everything else programmatically.

I've found articles covering advanced edition but want to do it with just the .NET product if possible.

Thanks
Avatar of frodoman
frodoman
Flag of United States of America image

SOLUTION
Avatar of OverTheEdge
OverTheEdge

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 xassets
xassets

ASKER

OK this is what I typed in response to frodoman's answer....

Thanks for this.

If I'm reading this right, I need some activex component called RDC which doesn't exist in crystal .net. Do I need to buy the developer edition of crystal to get hold of the RDC ?

I'm actually not that bothered about using .NET, and would prefer to call it from vb6. I was referring to .NET just because it comes with a version of crystal. If we need to buy developer edition we will.

The article mentions that the RDC makes calls to a "Report Creation API". If this API exists in .net then I could forget the RDC and just use the API instead ? Is that possible ?

--------------------------------------------------------------------------------

Brian: This will be a web application (with vb6 mid tier) so using ASP.NET to create the reports on the web server is not a problem.

Interesting that the Crystal sales people didn't tell me about that one, wanted me to buy advanced edition instead !

If you can offer any pointers on how to create a "hello world" crystal report on the fly that would be great.

--------------------------------------------------------------------------------

Question you'd both probably know the answer to: Are there any compelling reasons for choosing vb6 + crystal dev edition over .NET, other than price ?

Avatar of xassets

ASKER

would appreciate answers to the above, sorry but the crystal product line is v difficult to understand

What I'm getting at is that I want an web app to compile reports "on the fly", and I want the minimum crystal product to achieve that.

I've been trying to find out how to compile a crystal report using asp.net and its not going well, I just don't know which objects to start with. Any ideas ?
As far as I know, you'll need either developer or advanced editions to do the dynamic reporting.  I've never used other versions so I can't be certain it's not possible but the documentation I've read indicates that it isn't part of the license (even if you do manage to get the necessary components).  So, developer/advanced would be the minimum product.

If you want some good asp.net tutorials, try this site: http://www.businessobjects.com/products/dev_zone/default.asp  and download the "Underground Office Supply" sample.
Avatar of xassets

ASKER

Thanks frodoman, I'm going to double check on the asp.net licensing stuff with crystal people, but I'll also check out those links.

Can you just answer one more thing:

Instead of creating the whole report at run time, if we had a report template with a set of fields, is it possible using developer edition to hide fields, move fields and change datasource and font etc ? That may be easier to program I reckon.

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
Avatar of xassets

ASKER

Ok thanks for the confirmation

I've found that you can indeed use RAS from ASP.NET, but haven't quite got through to the hello world stage yet. I'll raise another question about that if needed.
Hi xassets,
              I am looking for the same kind of stuff , for that you were a month back.
I have to create a web report designer that is end user will be able to create/design reports using web browser from anywhere in the world and other people can view that report.
             User interface will be in .net.
             Also I don't know about licensesing for the same ( Crystal Report )
             Any kind of help, suggestion will be a light for me.
            I look forward to hear from you.
             Thanks in advance
Hi navinkaush

Crystal licensing is pretty nasty. I think they're overly greedy and therefore leaving room for competitors to jump in. If you ask Crystal which product, they will always come back and say "advanced edition" no matter what.

For the time being crystal is a good option even so.

You can design RPT files within .NET at design time, but not at run time, and you can issue reports to aspx applications from a server. The server can PDF the reports and you can then call back the report using a url to a pdf file generated by crystal. If its a busy server then crystal will start throwing exceptions just to make you buy a server license.

If you want to design reports at run time, you have to get the advanced edition which has to be bought for you AND for each client. That can be a lot of money.

The actual export to pdf is easy :

        ''The path/location where the exported file will be saved
        Dim exportFilePath As String = Application.StartupPath + "\exported.pdf"

        ''Create an instance of the Chart report
        crReportDocument = New Chart()

        ''Set the options for saving the exported file to disk
        crDiskFileDestinationOptions = New DiskFileDestinationOptions()
        crDiskFileDestinationOptions.DiskFileName = exportFilePath

        ''Set the exporting information
        crExportOptions = crReportDocument.ExportOptions
        With crExportOptions
            .DestinationOptions = crDiskFileDestinationOptions
            .ExportDestinationType = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat
        End With

        ''Export the report
        crReportDocument.Export()

        ''Display a message letting the user know the export is complete
        MessageBox.Show("Report exported to: '" & exportFilePath & "'")

Yes, I got your point. Just tell me one thing, when we will give the creating/designing of report at run time through programming in asp.net page and finally report will run at server then why they will charge for each client. Client is just using browser and we don't know how many user can use it. it is open to world.
 
 Also , please tell me the possiblity of creating report at run-time. I got some documents that shows it is possible to create report at run time, I am going through those documents. But if you have some knowledge of creating report at run-time . please share with me.
Here's crystals licensing statement from their web site
--------------------------
For each internal application that you build, the reporting component can be deployed on a single processor. To deploy the reporting component on additional processors and increase reporting throughout, additional licenses are required.

You may not under any circumstances deploy an application to access the reporting component on more than one processor by combining additional Crystal Reports licenses. To deploy the reporting component on additional processors or servers, processor-based expansion licensing is available.

If you build web applications that will be redistributed, sold or deployed to a third party, you must purchase a copy of Crystal Reports Developer or Advanced Developer for each company you redistribute to.
--------------------------

However, if you build your app using crystal reports with .net, you dont have to pay it unless you want the "increased reporting throughput". Not many apps produce 3 reports per second. Again from the crystal web site for .net lic:

------------------------------
A customized Crystal Reports designer is fully integrated within Microsoft Visual Studio .NET and Borland C#Builder for powerful—yet easy—report design. You may use the integrated designer to create an unlimited number of reports for use within your .NET applications.

For a fully functional, stand-alone designer, as well as over 50 new features and enhancements, upgrade to Crystal Reports 10 Advanced Edition. Reports you create with Crystal Reports 10 Advanced Edition can be used within your .NET application. Best of all, a new, more scalable deployment license comes standard with Advanced Edition.

--- and ---

You may use a single instance of the bundled reporting component for as many applications as you like within a single multi-processor server. You may not increase the scalability of this component by deploying it in a web farm. To increase scalability to meet your production requirements, upgrade to Crystal Reports 10 Developer or Advanced Edition. Learn more  

To redistribute a server or web application that uses the bundled reporting component outside your own organization to third parties, written authorization from Crystal is required. You can get authorization by registering your application online at no extra cost. Register your application

------------------------------

Its all here

http://www.businessobjects.com/products/reporting/crystalreports/licensing/details.asp

------------------------------
I dont think its possible to create a report at run time without advanced edition. Please let me know if you find that I'm wrong !

thanks