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
Hardik Patel
NA
378
469.3k
crystal report not working in wpf
Oct 30 2013 1:18 AM
i try to generate crystal report based on dataset. i got the dataset but not able to display it on crystal report. i am using below code
public static ReportDS ResultDS = new ReportDS();
public winReport(DataSet ds)
{
InitializeComponent();
ReportDocument report = new ReportDocument();
ResultDS = new ReportDS();
DataRow dr;
dr = ResultDS.Tables["ResultDT"].NewRow();
ResultDS.Tables["ResultDT"].Rows.Add(dr);
for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
{
for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
{
if ((ds.Tables[0].Rows[j][i].ToString() != "") && (ds.Tables[0].Rows[j][i].ToString() != "\n\r\t") && (ds.Tables[0].Rows[j][i].ToString().Length!=0))
{
ResultDS.Tables["ResultDT"].Rows[0][i] = ds.Tables[0].Rows[j][i].ToString();
}
}
}
string reportPath = System.AppDomain.CurrentDomain.BaseDirectory + "Reports\\PRS.rpt";
report.Load(reportPath);
report.SetDataSource(ds);
CRViewer.ViewerCore.ReportSource = report;
Reply
Answers (
0
)
Binding data into datagrid in W.P.F
IMAGE BINDING TO DATAGRID