简体   繁体   中英

Add new lines if necessary at the bottom of a tablix control using SSRS

I'm using SSRS to build reports. The design is being done using VS2015 and the database server is SQl Server2014. Here is my issue:

The report I'm building uses a tablix control to display records hold in a dataset. There will be only a max of 5 lines displayed in the tablix. However if the dataset has 3 records in it I would like to add 2 blank lines in the bottom of the tablix in order to always display 5 lines. I could this at a database level by adding blank records but I would like to do it at a report level using properties/ expressions of the tablix control.

Any help?

Thanks

Regards

You will have to add 5 blank rows in the tablix outside the details group, since you won't know how many rows are supposed to be in the dataset initially. You will then want to change the Visibility property of each blank row to an expression. The first row will have an expression that looks at the count of the dataset and if its = 1, then False. That code looks like =IIF(CountRows() = 1, False, True) . You will put that as the expression in each of the blank rows, but increasing the number for the subsequent row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM