Print Page | Close Window

Report Creation using SDK

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=417
Printed Date: 02 May 2024 at 7:27am


Topic: Report Creation using SDK
Posted By: avnkkishore
Subject: Report Creation using SDK
Date Posted: 28 Mar 2007 at 3:25am
Hi,
 
I am a newbie and i am using CR XI to create my first report. And here is my requirement.
 
I am having a XML file(s) which contains data. And i will have to select one XML file based on the logic (this is not known at design time).
 
Is it possible to create report using SDK.
 
I have searched net and got some references but all of them are saying that i need to set dataset (from the xml) to rpt at the design time which is not possible for me Confused
 
any help is highly apprecited.
 
Thanks,
Kishore
 



Replies:
Posted By: avnkkishore
Date Posted: 28 Mar 2007 at 3:41am
BTW can any one please clarify me regarding the following...
 
1. Is there any advatage in using CR XI RAS version Vs CR XI Developer edition in terms of report creation using SDK.
 
2. Is it possible to create dynamic report (report design is not known at design time) with embedded RPT file?
 
Thanks in advance,
Kishore


Posted By: BrianBischof
Date Posted: 28 Mar 2007 at 9:44am
I'm pretty sure that RAS and Developer use the same API. VS 2005 is what uses a functionally reduced API.

You can create dynamic reports with CR Developer. Download a free 30 day trial to test out what you need to do.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: avnkkishore
Date Posted: 01 Apr 2007 at 10:21pm
Hi Brian,

Thanks for the update. I have tried to create Crystal report using the developer edition. But i couldn't find the way to do that. Can you please help how to create it using .NET SDK developer edition with a few lines of code.

This is the way that i have created using RAS version.

            ReportClientDocument rcDoc = new ReportClientDocument();
            rcDoc.ReportAppServer = "localhost";
            rcDoc.New();

            // create table "Customer"
            Table tbl = new Table();
            tbl.Name = "Customer";

            // add this Customer table
            rcDoc.DatabaseController.AddTable(tbl, null);

            // create a field object, "{Customer.Customer Name}"          
            field = CreateFieldObject("Customer Name", "Customer", 0, 0, 2880, 200);

            sec = rcDoc.ReportDefinition.DetailArea.Sections[0];
            this.crystalReportViewer1.ReportSource = rcDoc;

Thanks in advance.
Kishore


Posted By: s.frigger
Date Posted: 04 Jun 2007 at 6:45am
I'm interested in this, too. For weeks I've tried it, but nothing works Cry


Posted By: BrianBischof
Date Posted: 04 Jun 2007 at 11:19am
Sorry, but I haven't used the report creation API either. Doesn't CR come with documentation in the help files or on their website about this API?

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: s.frigger
Date Posted: 04 Jun 2007 at 12:55pm
Now I am a little confused. Just to make things a little bit clearer. My intention is to program an complete report from scratch.
The company which I'm working with said something about using the Report Document class to create new reports. From what I've experienced this doesn't seem to be right? Or have I gotten it wrong?
I just wanted to know which is the right SDK for writing a report from the scratch.

Greetings
Stephan


Posted By: BrianBischof
Date Posted: 04 Jun 2007 at 2:33pm
The SDK that comes with CR.NET does NOT support RCAPI (Report Modification and Creation API). The ReportDocument class does not support creating a new report from scratch. It only supports loading an existing report into memory so that it can be printed or previewed. You have to use the report designer in CR.NET to create a new report.

If you want to create a report from scratch, you need to buy a license for RAS (Report Application Server) and then you have access to the RCAPI for CR.NET.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: avnkkishore
Date Posted: 05 Jun 2007 at 1:41am
Yes, Its true. As Brian said you need to have RAS installed on your machine with version XI R2. I am using this and able to create new crystal report from scratch using ReportClientDocument.

Thanks,
Kishore


Posted By: s.frigger
Date Posted: 05 Jun 2007 at 10:04am
I just installed the 30 days trial version to get an overview of the features and I'd like to thank both of you for your kind support.

Greetings,
Stephan


Posted By: BrianBischof
Date Posted: 05 Jun 2007 at 10:53am
Thanks for the follow up avnkkishore. Glad to hear that you got it working! s.frigger I hope it works out for you.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window