Filter a data source and only show the first item?

1 Answer 33 Views
Report Designer (standalone)
Joe
Top achievements
Rank 1
Joe asked on 07 Oct 2021, 05:09 PM

I have a data source that contains dimension data. This data contains Width, Diameter, Weight, and other data.

I can filter the list to just show the Width, but I only want it to show the first Width (since they all happen to be the same). The Report Designer still creates a blank row in the report for every row after the first. I tried using 

= IIf(RowNumber()=1, Fields.DimensionInfo.Dimension, "")

How can I only show the first item? Or, how can I force the blank rows to not take any space?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 12 Oct 2021, 08:45 AM

Hello Joe,

Thank you for the provided information.

In order to hide the unnecessary rows, you may use Conditional Formatting or a Binding to the Visible property of the row/report item.

For the expression itself, you are on the correct path using the RowNumber(scope) function to differentiate between and the first row and the rest. However, I assume that this expression that you have provided is used as a Value in a table cell or somewhere on the report as a value of a TextBox item. Instead, it should be used as an expression returning true or false to control the visibility of the table row/report item. 

For an example, please have a look at the attached images. It is an example of a conditional formatting rule that will invisible the rows of the table after the first row. Note that you should select the rows themselves if you wish to make the whole row invisible and not only the content of the table cell.

Note that if possible, it would be best to filter the data at the data source level so that only one record is returned of the DimensionInfo field, how you can do that depends on the type of data source component that you are using - Data Source Components.

Please let me know if you have any other questions or need further assistance. Thank you for using Telerik Reporting! 

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Designer (standalone)
Asked by
Joe
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or