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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

table-rows: different style

Thread ID:





71068 Jan 14,2008 02:48 PM UTC Jan 14,2008 08:32 PM UTC ASP.NET Web Forms (Classic) 1
Tags: PDF
Claudia Grewe-Beuttner
Asked On January 14, 2008 02:48 PM UTC

I'm using Essential PDF (VB) and I have created a report from a SQL-Server-database, as you see in the attachment. There is no problem to change the value of the fields, but is it also possible to change their format.
For example I want all negativ values in red color.
I only see a chance, if I assign the fields to different cells and then set the special format.
Please tell me if there is an easier way.

Thanks Claudia


Vinoth Kumar K [Syncfusion]
Replied On January 14, 2008 08:32 PM UTC

Hi Claudia,

I want all negaive values in red color:

One way you can change color of the negative value in PDFTableCell to Color.Red by using EndCellLayout Event. Here is a code snippet that shows this task.

void table_EndCellLayout(object sender, EndCellLayoutEventArgs args)
int iCellValue;
if (int.TryParse(args.Value, out iCellValue))
if (iCellValue < 0)

PdfGraphics g = args.Graphics;
System.Drawing.Image image = new Bitmap((int)args.Bounds.Width, (int)args.Bounds.Height);
Graphics gra = Graphics.FromImage(image);
gra.Clear(Color.White); // Set new color.
PdfImage image1 = new PdfBitmap(image);

//Clear backgroung of the cells with white color
g.DrawImage(image1, args.Bounds);

PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 8);
g.DrawString(args.Value, font, PdfBrushes.Red, args.Bounds.Location);




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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon