i have a text box in the front end i want to display this textBox value along with my data table in CRYSTAL REPORT VIEWER. I have displayed data table value successfully , but found some hurdles to display textBox values. I am using Web Application(c#). Pls Help..
Thanks in Advance..
this is my code-
protected void btnExport_Click(object sender, EventArgs e)
{
ReportDocument rdt = new ReportDocument();
EmpDetail emp1 = new EmpDetail();
DataTable dt = new DataTable();
dt.TableName = "EmpDataTable";
dt = putEmployeeDetails();
emp1.Tables[0].Merge(dt);
rdt.Load(Server.MapPath("Emp.rpt"));
rdt.SetDataSource(emp1);
CrystalDecisions.CrystalReports.Engine.ReportDocument doc=rdt;
doc.DataDefinition.FormulaFields["display1"].Text = "sdfsdf";
CrystalReportViewer1.ReportSource = rdt;
}
for this am getting error at
doc.DataDefinition.FormulaFields[“display1”].Text = “sdfsdf”;
as “Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))”
write your query and everything and fill in Dataset.