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
Bhavesh Vankar
753
1.2k
89.4k
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#