How to pass parameter with quate to crystal reports from a C# (winform) application
-
Hello, How to pass parameter to crystal reports from a C# (winform) application when my parameter is a string type and contain quate or double quate charecter? I keep getting error "Error in formula" when it contains quate or double quate. My parameter name is Address and the address contain double quate sign Thanks in advanced
-
Hello, How to pass parameter to crystal reports from a C# (winform) application when my parameter is a string type and contain quate or double quate charecter? I keep getting error "Error in formula" when it contains quate or double quate. My parameter name is Address and the address contain double quate sign Thanks in advanced
-
Try providing ASCII values for the double quotes or precede it with escape charachters.
Regards, SPanicker.
-
Hello, How to pass parameter to crystal reports from a C# (winform) application when my parameter is a string type and contain quate or double quate charecter? I keep getting error "Error in formula" when it contains quate or double quate. My parameter name is Address and the address contain double quate sign Thanks in advanced
Use paramterized queries instead of putting SQL strings together using string concatentation.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
C# code -------
int intCopies = 1;
string strAddress = "6534 Burbank, next to the \"Amy Books\" bookstore";
string temp = orpt.DataDefinition.FormulaFields["Address1"].Text;
orpt.DataDefinition.FormulaFields["Address1"].Text = temp.Replace("Address1", strAddress1);
orpt.Refresh();
orpt.PrintToPrinter(intCopies, true, 1, 1);------------------------- Crystal Reports --------------- in crystal reports I have a formula named: @Address formula text: "Address" -------------------------- I'm using VS 2005 with Crystal reports version 8.5 Thanks!
-
C# code -------
int intCopies = 1;
string strAddress = "6534 Burbank, next to the \"Amy Books\" bookstore";
string temp = orpt.DataDefinition.FormulaFields["Address1"].Text;
orpt.DataDefinition.FormulaFields["Address1"].Text = temp.Replace("Address1", strAddress1);
orpt.Refresh();
orpt.PrintToPrinter(intCopies, true, 1, 1);------------------------- Crystal Reports --------------- in crystal reports I have a formula named: @Address formula text: "Address" -------------------------- I'm using VS 2005 with Crystal reports version 8.5 Thanks!