Hi,
I have a problem. I am passing text in FormulaFields. It passes only numeric data.
ReportDocument rptdoc = new ReportDocument(); rptdoc.Load(Server.MapPath("CrystalReport2.rpt")); rptdoc.SetDataSource(ds); this.CrystalReportViewer1.RefreshReport(); this.CrystalReportViewer1.ReportSource = rptdoc; CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None; rptdoc.DataDefinition.FormulaFields[1].Text = "12"; //this is passing to the report and showing in report "12.00" and is right aligned rptdoc.DataDefinition.FormulaFields[1].Text = "abc"; //this is not passing and showing bellow error aConnection.Close();
The remaining text does not appear to be part of the formula. Details: errorKind
Why this happening? Name of formula on index 1 in crystal report is @AdSpaces. I tried changing
rptdoc.DataDefinition.FormulaFields[1].Text = "abc";
into
rptdoc.DataDefinition.FormulaFields["AdSpaces"].Text = "abc";
but same error. Please help me I am wasted much time with this. Thanks