TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kishor choure
NA
87
46.2k
Crystal Report generates error
Jul 31 2012 11:58 AM
I want to create crystal report with sql query. For that I am trying following code
inside button1_click event in C# windows application. But In this code I get an error
that "Invalid path of crystal report".
private void button1_Click(object sender, EventArgs e)
{
string str = "select s_first,s_last,s_dob,c_sem,c_year from personaltbl,coursetbl where personaltbl.r_id = coursetbl.r_id and coursetbl.c_name='MCA'";
scmd.CommandText = str;
scmd.Connection = scon;
if (scon.State == ConnectionState.Closed)
scon.Open();
sdap = new SqlDataAdapter(scmd);
sdap.Fill(ds, "personal");
ReportDocument rd = new ReportDocument();
rd.SetDataSource(ds.Tables["personal"]);
rd.Load(@"~/First_Report.rpt");//I also used @"c:\project\project_first\first_Report.rpt"
rd.SetDataSource(ds.Tables["personal"]);
crystalReportViewer1.ReportSource = rd;
crystalReportViewer1.RefreshReport();
if (scon.State == ConnectionState.Open)
scon.Close();
}
catch (Exception ex)
{
MessageBox.Show(" exce :" + ex.Message );
}
}
Please tail me the simple code to display report using sql query.
Reply
Answers (
3
)
Generate Reports in Excel without Office installed in server.
Formula field returns only 0