AllExperts > Experts 
Search      

C#

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More C# Answers
Question Library

Ask a question about C#
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Srini Nagarajan
Expertise
can answer any kind of questions in ASP.NET, C#, VB.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience
Contact me if you need any custom development on ASP.NET, ASP, Coldfusion, Powerbuilder
 
   

You are here:  Experts > Computing/Technology > C/C++ > C# > Making Reports in C#

Topic: C#



Expert: Srini Nagarajan
Date: 8/22/2005
Subject: Making Reports in C#

Question
-------------------------
Followup To
Question -
Hi
I am a beginner at C# programming.
I have a small project with a dataset connected to a sql server database.everything is good.
but I want to create some simple report, and I have installed crystal report 9.
I do this steps:
1- Add a crystal report Item to the project
2- Add a datasource to crystal report and create report in crystal report(and my report name is rpt1.rpt)
3- Add a crystal viewer control to the project
4- the problem is here:
I want to Just write the following two lines on my Forms load event handler.

private void Form1_Load(object sender, System.EventArgs e)
{
rpt1 custReport = new rpt1();
crystalReportViewer1.ReportSource = custReport;
}

but it shows these 3 errors:
1-Cannot find custom tool 'CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator' on this system.
2- The type or namespace name 'rpt1' could not be found (are you missing a using directive or an assembly reference?)
3- The custom tool 'CrystalDecisions.VSDesigner.CodeGen.ReportCodeGenerator' failed while processing the file 'BookInsurance_ReportFirst.rpt'.

what is wrong?could you help me pleas?

Thanks.



Answer -
Hi

Where did you keep your 'BookInsurance_ReportFirst.rpt' file?

Happy Programming

-Srini

**********************************************
Dear Srini
thanks for your attention,
sorry,I've typed it wrong,please ignore error number3.I could correct it.
the main problem is number2 , where it can't detect rpt1 class.
what can i do?
thanks.
**********************************************

Answer
Hi

Sorry for the delay

rpt1 custReport = new rpt1();   You can't use the rpt1 directly..  

try like this

{
ReportDocument rpt = new ReportDocument();
rpt.Load(@"C:\rp1.rpt");
rpt.Database.Tables[0].SetDataSource(ds_xml);
crystalReportViewer1.ReportSource = rpt;
}

Happy Programming!!

-srini

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.