Use a function in CrystalreportViewer.SelectionFormula
-
I have an application in Vb.net. There is a crystalreport that displays records from an access Database.But i want to filter records that report displays.Each records has 6 fields and one of this is LisTR. I have a function VerifyS(...) as boolean , this function get as argument the value of this field and return true if the record that have this filed should display in the report or no. But i have problem using this function. I use : CrystalReportViewers1.SelectionFormula=("VerifyS{Table1.LisTr}=True") But i get an error So , How to use a function inside SelectionFormula? Thank You !
-
I have an application in Vb.net. There is a crystalreport that displays records from an access Database.But i want to filter records that report displays.Each records has 6 fields and one of this is LisTR. I have a function VerifyS(...) as boolean , this function get as argument the value of this field and return true if the record that have this filed should display in the report or no. But i have problem using this function. I use : CrystalReportViewers1.SelectionFormula=("VerifyS{Table1.LisTr}=True") But i get an error So , How to use a function inside SelectionFormula? Thank You !
If this
VerifyS
function is defined in your VB.NET code, you can NOT use it in the SelectionFormula filter. Last I knew, CrystalReports cannot call back into your code to call functions. The way around this would be to add a field to your table that your code can modify based upon your rules, then you can use that field in the SelectionFormula to filter the records.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
If this
VerifyS
function is defined in your VB.NET code, you can NOT use it in the SelectionFormula filter. Last I knew, CrystalReports cannot call back into your code to call functions. The way around this would be to add a field to your table that your code can modify based upon your rules, then you can use that field in the SelectionFormula to filter the records.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Thank You. Ok , i change my code and now i want to display in My crystal report only those records that have the maximum value in the filed LisTR. Can i use the function Max or something else to do this. ( so is possible to use in SelectionFormula a standart function of vb.net ?) Thank You
-
Thank You. Ok , i change my code and now i want to display in My crystal report only those records that have the maximum value in the filed LisTR. Can i use the function Max or something else to do this. ( so is possible to use in SelectionFormula a standart function of vb.net ?) Thank You
mysybet123 wrote:
so is possible to use in SelectionFormula a standart function of vb.net
Didn't I just get done telling, "No, it's not possible."?? Stop thinking in terms of VB code in the SelectionFormula and start thinking in terms of either SQL or CrystalReports syntax.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007