I have created a report and there are some different column in it.
I have used grouping to one column and it works fine.
My problem is the grouping column should be displayed only once and not in the other records. Something like this:
At present:
column1 column2 column3
-----------------------------
fruit apple red
fruit banana green
fruit mango yellow
car toyota black
car nissan silver
What I want is:
column1 column2 column3
-----------------------------
fruit apple red
banana green
mango yellow
car toyota black
nissan silver
Note: I dont want separate header for the groups. I want the group columns to be included in the normal fields only. Any suggestion?
9 Answers, 1 is accepted

I'm interested to see if Telerik has a different response, but this should work.



This works (based on Northwind ProductCategory view):
private void detail_ItemDataBound(object sender, System.EventArgs e) { // Get the detail section object from sender Processing.DetailSection section = (sender as Processing.DetailSection); // From the section object get the DataRowView DataRowView dataRowView = (DataRowView)(sender as Processing.DetailSection).DataItem; if (dataRowView["CategoryName"].ToString() != lastCategory) lastCategory = dataRowView["CategoryName"].ToString(); else { Processing.ReportItemBase[] categoryNames = (Processing.ReportItemBase[])section.Items.Find("textBox1", false); if (categoryNames.Length > 0) { Processing.TextBox categoryName = categoryNames[0] as Processing.TextBox; categoryName.Text = string.Empty; } } }

thank you very much for your reply.
I implemented your code like this:
Private
Sub DetailSection1_ItemDataBound(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DetailSection1.ItemDataBound
Dim section As Processing.DetailSection = (TryCast(sender, Processing.DetailSection))Dim dataRowView As DataRowView = DirectCast((TryCast(sender, Processing.DetailSection)).DataItem, DataRowView)
Dim lastItem As String = ""
Dim items As Processing.ReportItemBase() = DirectCast(section.Items.Find("TextBox10", False), Processing.ReportItemBase())
If items.Length > 0 Then
Dim item As Processing.TextBox = TryCast(items(0), Processing.TextBox)
'For Each item In items
If dataRowView("CODES_TITLE").ToString() <> lastItem Then
lastItem = dataRowView("CODES_TITLE").ToString()
Else
item.Text = String.Empty
End If
'Next item
End If
End Sub
Here when I intialise the lastItem with a emty string value, it goes to the if condition and the condition becomes true and its returning all the rows as usual whereas if I intialise the lastItem with the dataRowView("CODES_TITLE").ToString() value then the if condition becomes false and its returning empty values for all the rows.
Then I applied loop(not sure whether I have applied it correctly or not) , you can see the commented ones.
What is to be added to the code at this point?

The problem is with the declaration
Dim lastItem As String = ""
which you contain inside your routine - you don't see the declaration in my code because it's right after the class declaration. "lastItem" needs to be declared outside your subroutine (ie, at the module level), because as you have it right now, you're re-declaring the variable each time you enter the ItemDataBound event handler (entered once per data row), and I would expect exactly the behavior you are describing. If you declare it outside the handler, it will preserve its value.
In fact Rick has already explained all you need. I will just attach a sample solution with two reports that demonstrates the case:
- The first report (Report1) relies on DataBound event handler to modify the Text property of the TextBox.
- The second report (Report2) uses a UserFunction to filter the value.
Please try the sample and let me know if you have any other questions.
All the best,
Ivan
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

@Ivan thank you for the sample. I wish this could be made as a property(hide duplicates) like in othe reporting services. No issue though.
We are glad that you have resolved that issue. We will definitely consider your suggestion for a future version of Telerik Reporting.
Sincerely yours,
Ross
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center