Multiable Expressions in Filter Section
Hi,
I'm trying to add this expression to the filter section :
[myTable.starttime] <= [prmDateFrom] && [myTable.endtime] >= [prmDateTo] && If ([prmSourceCall] == "External") {[myTable.is_fromoutside] == false}
It gives me an error CS1200 in Fast Report.
Does filter supports C# syntax? or with some changes?
Thanks,
I'm trying to add this expression to the filter section :
[myTable.starttime] <= [prmDateFrom] && [myTable.endtime] >= [prmDateTo] && If ([prmSourceCall] == "External") {[myTable.is_fromoutside] == false}
It gives me an error CS1200 in Fast Report.
Does filter supports C# syntax? or with some changes?
Thanks,
Comments
But I need to validate some passed values from my application to the filter, how can I do that?
For example if (some parameter = some value) display some specific records.
Thanks,
Can I set the filter to parameter value? I mean in the filter i set [myParam] then set that parameter from my application:
report1.SetParameterValue("myParam", CustomExpression);
I tried this, but it had no effect on the report result.
report1.Load("calllogs.frx"); //load the report
FastReport.Data.Parameter p = new FastReport.Data.Parameter("sqlQuery");
p.DataType = typeof(bool);
string query1 = "[callhistory3.is_fromoutside] == true";
p.Expression = query1;
report1.Parameters.Add(p);
report1.Show();
and I get this error:
Exception has been thrown by the target of an invocation.
Here is how I pass the parameter:
Two things you should be aware of:
- this code adds a parameter, but does not check if that parameter is exists already;
- check that parameter's expression is correct, i.e. you are referencing correct data columns or other items. If you make a mistake you may get the runtime error.