RenderTable page change

Originally Posted 30 January 2017, 7:47 am EST

  • Originally Posted 30 January 2017, 7:47 am EST

    Hi,
    how is it possible to get the first row of a render tabel when -since i have a lotta rows - it changes rendering over another table?
    For example if i have 46 rows, the first 32 are rendered over the first page and is is correct: but i need to point at the row number 33, which is the first at the top of the second page.

    Thanks

    Regards,
    Fabio La Vitola
  • Marked as Answer

    Reply

    Hi,

    You can retrieve the first row of the RenderTable on a page in PageAdded event as follows:

    private void _printDocument_PageAdded(C1PrintDocument sender, PageEventArgs e)
    {
    foreach (RenderFragment fragment in e.Page.Fragments)
    {
    foreach (object child in fragment.Children)
    {
    if (child.GetType() == typeof(RenderTextFragment)) {
    RenderText text = ((RenderTextFragment)child).RenderObject;
    listBox1.Items.Add("page: " + (e.Page.Index + 1) + " , starting row: " + text.TableRow);
    break;
    }
    }
    }
    }


    For getting a row corresponding to index, use :

    TableRow tr = rt.Rows[index];


    Please find the sample application attached for complete implementation.
    Note: You can modify the sample based on your requirement(s).

    Thanks,
    Sonu

    2017/02/GetFirstRowOfEachPage.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels