This is a migrated thread and some comments may be shown as answers.

Problems about Datasource and ConditionalFormatting,why it doesnt work?

2 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Arthur Wu
Top achievements
Rank 1
Arthur Wu asked on 21 Mar 2011, 09:15 AM

Partial Public Class Example
    Inherits Telerik.Reporting.Report
    Public Sub New()
        InitializeComponent()

        init()
    End Sub

    Public Sub init()
        Dim dt As New DataTable
        dt.Columns.Add("index")
        dt.Columns.Add("premium")

        For i As Integer = 1 To 50
            Dim dr As DataRow
            dr = dt.NewRow
            dr.Item("index") = i.ToString
            dr.Item("premium") = i.ToString + "元"
            dt.Rows.Add(dr)
        Next

        Crosstab1.DataSource = dt

        Dim filter1 As New Telerik.Reporting.Data.Filter()
        filter1.Expression = "= RowNumber() mod 5"
        filter1.Operator = Telerik.Reporting.Data.FilterOperator.Equal
        filter1.Value = "0"

        Dim item As New FormattingRule
        item.Filters.Add(filter1)
        item.Style.BackgroundColor = Color.Yellow

        TextBox4.ConditionalFormatting.Add(item)
    End Sub
End Class

1.According to the code ,my first question is why i set the datasource of Crosstab1,it only show the first row in the datatable?the datatable has 50 rows
2.My second question is why the ConditionalFormatting doesn't work on my reporting,i have already set the FormattingRule,but it still not work
Remark:I use telerik-2010-Q1 package

Please tell me how to do under telerik reporitng?or it's bugs?thank you!

2 Answers, 1 is accepted

Sort by
0
Arthur Wu
Top achievements
Rank 1
answered on 23 Mar 2011, 02:07 AM
someone ?
0
Svetoslav
Telerik team
answered on 24 Mar 2011, 09:22 AM
Hello Arthur Wu,

Just use an expression for the filter1.Value like this:

filter1.Value = "=0"

For more information please see Telerik.Reporting.Data.Filter.Value property.

Best wishes,
Svetoslav
the Telerik team
Tags
General Discussions
Asked by
Arthur Wu
Top achievements
Rank 1
Answers by
Arthur Wu
Top achievements
Rank 1
Svetoslav
Telerik team
Share this question
or