We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How do I write some text below a table?

Thread ID:

Created:

Updated:

Platform:

Replies:

104023 Jun 15,2012 09:10 AM Jun 20,2012 11:51 PM ASP.NET Web Forms (Classic) 3
loading
Tags: PDF
Martin Bischoff
Asked On June 15, 2012 09:10 AM

I'm using a PdfLightTable to render a table, e.g:

    var doc = new Syncfusion.Pdf.PdfDocument();
    var page = doc.Pages.Add();
    var table = new PdfLightTable();
    table.Style.HeaderSource = PdfHeaderSource.ColumnCaptions;
    table.DataSource = GetData(); // returns  a DataTable
    table.Draw(page, 0, 0);


This works fine, but now I'd like to append some text right below the table, and that's where I'm stuck:

- the table can span multiple pages
- to use page.Graphics.DrawString(text, font, brush, x, y) I have to specify the text's position
--> how do I determine the position for the text (the value for parameter 'y') ?



George Livingston [Syncfusion]
Replied On June 18, 2012 01:14 AM

Hi Martin,

Thank you for using Syncfusion Products.

It is possible to determine the position of the text in the PdfLightTable using PdfLayoutResult.

Use the below mentioned code snippet to the get bounds of the table element,

PdfLayoutResult result = table.Draw(page, PointF.Empty, format);

Please find the sample available in the link below to achieve your target,

TextBelowTable.zip

Please try this and let us know if you have any question.

Regards

George.


Martin Bischoff
Replied On June 18, 2012 02:19 AM

Thanks George, that was exactly what I was looking for.

From the samples, this wasn't obvious to me, since each sample only shows exactly one small feature, but not combinations of them.

Best regards,
Martin

George Livingston [Syncfusion]
Replied On June 20, 2012 11:51 PM

Hi Martin,

Thank you for your update.

Please find the online sample available in the link below, which consist of combination of the table features.

http://asp.syncfusion.com/demos/reporting/pdf/Product%20Showcase/Invoice/CS/Invoice.aspx

Please let us know if you have any concerns.

Regards,

George


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;