Hi,
I am having problem with conditional formatting feature of telerik reporting for windows application.
(.net framework 2.0 language visual basic 8 and operating system windows xp pro)
I am comparing a datafield and a variable date value and based on that it should filter backcolor of particular textbox which is placed dynamically in detail section of the report.
'FormattingRule1.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("=CDate(Fields.S001)", CType(Telerik.Reporting.Data.FilterOperator.GreaterThan, Telerik.Reporting.Data.FilterOperator), "=CDate(""00:07:49"")")})
This is hardcodead things which works fine but if i write these code (below), it throws me an error "Object reference not set to an instance of an object."
Here tItem is a dynamic telerik's reporting textbox
dt.Columns(i).ColumnName is a particular ColumnName which has datetime value and datatype is varchar
Dim FormattingRule1 As Telerik.Reporting.Drawing.FormattingRule = New Telerik.Reporting.Drawing.FormattingRule
FormattingRule1.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("=CDate(""" + averageTime + """)", CType(Telerik.Reporting.Data.FilterOperator.GreaterOrEqual, Telerik.Reporting.Data.FilterOperator), "=CDate(Fields." + dt.Columns(i).ColumnName + ")")})
FormattingRule1.Style.BackgroundColor = System.Drawing.Color.Chocolate
tItem.ConditionalFormatting.AddRange(New Telerik.Reporting.Drawing.FormattingRule() {FormattingRule1})
In short if i replace dt.Columns(i).ColumnName with hardcoaded column name like =CDate(Fields.S001) is not throwing me any error.
It should not be like this.
Help me out.
Thanks
I am having problem with conditional formatting feature of telerik reporting for windows application.
(.net framework 2.0 language visual basic 8 and operating system windows xp pro)
I am comparing a datafield and a variable date value and based on that it should filter backcolor of particular textbox which is placed dynamically in detail section of the report.
'FormattingRule1.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("=CDate(Fields.S001)", CType(Telerik.Reporting.Data.FilterOperator.GreaterThan, Telerik.Reporting.Data.FilterOperator), "=CDate(""00:07:49"")")})
This is hardcodead things which works fine but if i write these code (below), it throws me an error "Object reference not set to an instance of an object."
Here tItem is a dynamic telerik's reporting textbox
dt.Columns(i).ColumnName is a particular ColumnName which has datetime value and datatype is varchar
Dim FormattingRule1 As Telerik.Reporting.Drawing.FormattingRule = New Telerik.Reporting.Drawing.FormattingRule
FormattingRule1.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("=CDate(""" + averageTime + """)", CType(Telerik.Reporting.Data.FilterOperator.GreaterOrEqual, Telerik.Reporting.Data.FilterOperator), "=CDate(Fields." + dt.Columns(i).ColumnName + ")")})
FormattingRule1.Style.BackgroundColor = System.Drawing.Color.Chocolate
tItem.ConditionalFormatting.AddRange(New Telerik.Reporting.Drawing.FormattingRule() {FormattingRule1})
In short if i replace dt.Columns(i).ColumnName with hardcoaded column name like =CDate(Fields.S001) is not throwing me any error.
It should not be like this.
Help me out.
Thanks