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

Telerik Report Table - Fill to pagesize with empty rows

1 Answer 219 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bruce
Top achievements
Rank 1
Bruce asked on 21 Aug 2012, 10:47 AM
My table has a datasource that returns a resultset of 0 rows. When the resultset is empty i would like to fill the first page with empty rows

Is there any solution to do this?

Thanks!

Kind Regards

1 Answer, 1 is accepted

Sort by
0
gunter
Top achievements
Rank 1
answered on 26 Feb 2013, 11:24 AM
I had to solve same issue - here is what I did:
Calculate manually how many rows fits into empty page space, then calculate how many empty rows need to be added to table to fill page, and finally populate table with empty rows -
private const int TableRowsCount = 21; //You have to calculate how many rows fits into empty page space
 
private void table2_NeedDataSource_1(object sender, EventArgs e)
{
    var rows = ObjectSet.ToList();
    var emptyRows = new List<string>();
    var rowsCount = rows.Count();
    var rowsToBeAdded = 0;
    if (TableRowsCount > rowsCount)
        rowsToBeAdded = TableRowsCount - rowsCount;
    else
        rowsToBeAdded = rowsCount%TableRowsCount;
    for (int i = 0; i < rowsToBeAdded; i++)
    {
        emptyRows.Add(string.Empty);
    }
     
    //Here you can add empty collection to existing object list and bind that to table
    //Or insert into the footer of existing table child table with same column layout
    //as in parent table (you will have to merge cells)
     //and bind empty colection to it - in my case I used this child table
}
Tags
General Discussions
Asked by
Bruce
Top achievements
Rank 1
Answers by
gunter
Top achievements
Rank 1
Share this question
or