Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 9 and C#

Status
Not open for further replies.

brd24gor

MIS
May 18, 2005
123
US
I am starting to look at deploying reports using Crystal in our C# ASP applications. We have a stand-alone version of C# so we don't have Crystal Reports for .NET. We do have a full version of CR9. What do I need to do to be able to use CR9 in my applications? When I go to add a reference and look through the COM objects, there are about 15 different Crystal Reports object I can enter. Do I need to add all of them?

Any help or steering in the right direction would be greatly appreciated.

--Brad

"Life is too important to be taken seriously" --Albert Einstein
 
Bump.

This can't be too hard. The Business Objects support site doesn't have anything to help me out. All I need is a way to put a report viewer control in a Windows form WITHOUT Crystal Reports for .NET.

Thanks,
Brad

"Life is too important to be taken seriously" --Albert Einstein
 
Here is what I did using C# and CR 8.5. It's probably pretty similar to doing this with CR 9.

You will need add references to ADODB, CRAXDDRT, CRAXDRT & using System.Reflection;

Hopefully this will be of some help.

Code:
ADODB.Recordset rs;
// Open Recordset
rs = GetScheduleRecordSet(true, schedDate, server);

// set up the report
CRAXDRT.Application CrxApp = new CRAXDRT.ApplicationClass();               
CRAXDRT.Report CrxRpt = new CRAXDRT.ReportClass();

// open report and set data source
CrxRpt = CrxApp.OpenReport(reportPath + @"\rptSchedule" + clientCode + reportName + ".rpt", 1);
CrxRpt.Database.SetDataSource(rs, Missing.Value, 1);

// set the parameters
CrxRpt.ParameterFields[1].AddCurrentValue(mailFileName);

// print
CrxRpt.PrintOut(false,2,true,Missing.Value,Missing.Value);
 
Excellent. At this point I'm looking for any help I can get!

I'll give this a whirl tomorrow and I'll let you know. Thanks again!

--Brad

"Life is too important to be taken seriously" --Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top