Why Join
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forumguidelines
Bhavesh Vankar
1.4k
578
12.1k
print current record in crystal report without print preview
Jan 27 2021 7:53 AM
i have used below code to print current record but getting error "Report Load Faild" kindly guide me where is mistake. i am loading this method in save button after ExcecuteNonQuery.
private
void
PrintReport()
{
SqlConnection con =
new
SqlConnection(
this
.con);
SqlDataAdapter sda =
new
SqlDataAdapter(
"Select * from S_TEST Where S_ID='"
+ TxtAutovID.Text +
"'"
, con);
DataSet ds =
new
DataSet();
sda.Fill(ds);
ReportDocument rpd =
new
ReportDocument();
rpd.Load(Server.MapPath(
"~/studentpass.rpt"
));
rpd.SetDataSource(ds.Tables[0]);
CrptViewer.ReportSource = rpd;
rpd.PrintToPrinter(1,
false
, 0, 0);
}
Reply
Answers (
1
)
Comparing output of program with the sqlite database
How load and view first item from xamarin sql database in C#