How to create Crystal Report in vs 2008??

Posted by Laghaterohan under Regular Expressions on 9/25/2010 | Points: 10 | Views : 13121 | Status : [Member] | Replies : 2

I am really surprised not to find any proper solution as to how to create Crystal Report in VS 2008 in C# ? Can any one give me solution for the same.

I have a Default.aspx page. In that i have taken CrystalReportviewer and CrystalReportSource.

I am using SP that returns the data to be displayed in the report. My SP requires a number to be passed say..Roll No and accordingly it displays the data. I have set the connections and designed the report.

However, i am unable to proceed further. I want to know how can i pass this parameter(Roll No) ?? to the report from my aspx page. For that i have a textbox and a button. My textbox accepts the number (here: roll no) and when the user clicks on the button this roll number should be passed to my report and accordingly the report should get displayed.

Please, do let me know know how to proceed?? I am really clueless and more frustrated as i find no proper solutions. Kindly help me out. If any one of u have already tried this kind of solution before please help me to solve my problem as early as possible. Thanks a advance.

Rohan Laghate

Best Regards,
Rohan Laghate


Posted by: Sunnyjagtap11 on: 9/27/2010 [Member] Starter | Points: 25

1st create .rpt file
then use below code

ReportDocument rpt = new ReportDocument();
MySqlConnection conn = new MySqlConnection();
MySqlCommand cmdd = new MySqlCommand();
MySqlDataAdapter adpter1 = new MySqlDataAdapter();

string query= "select your Roll no ";
cmdd.CommandText = query;
cmdd.Connection = conn;
adpter1.SelectCommand = cmdd;
DataSet1 ds1= new DataSet1();
adpter1.Fill(ds1, "DataTable1");


CrystalReportViewer1.ReportSource = rpt;

if answer is YES mark it as answer

Thanx & Regards.

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response