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

PDF Export ignores border color?

2 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael Bakker
Top achievements
Rank 2
Michael Bakker asked on 07 Oct 2013, 01:45 PM
I have a requirement where the exported pdf file has to have a totally different layout from the grid on the web page.
Therefore, in codebehind in the PdfExporting event i manually create the html that is used to generate the pdf file.
This works fine except for the border color. No matter what i do, i can't seem to change the color from its default black.
I tried many variations of export settings (BorderType, BorderStyle and BorderColor) and styles on the (nested) tables themselves.
Below is the generated html for one item.
<table style='background-color:#fff4d8;border:1pt solid #cccccc;padding:4px;font-family:Segoe UI;width:100%;margin:0px'><colgroup><col /></colgroup><tr><td><table style='width:100%;page-break-inside:avoid' cellpadding='0' cellspacing='0'><colgroup><col style='width:50px' /><col /><col style='width:40px' /><col style='width:6px' /><col style='width:150px' /></colgroup>
<
tr style='height:26px'><td style='font-size:0.8em;font-weight:bold;color:#92107b'>Risico:</td><td style='border-right:1pt solid #cccccc;font-weight:bold;font-size:0.8em;color:#92107b'>Schade door een slechte of onjuiste betonkwaliteit.</td><td style='background-color:#CCFF11;border-top:1pt solid #cccccc;border-right:1pt solid #cccccc;font-size:0.6em;text-align:center;vertical-align:middle'>prioriteit:<br /><b>4</b></td><td></td><td></td></tr>
<
tr style='height:10px'><td></td><td style='background-color:#fff;border-top:1pt solid #cccccc;border-left:1pt solid #cccccc;border-right:1pt solid #cccccc'></td><td style='background-color:#fff;border-top:1pt solid #cccccc;border-right:1pt solid #cccccc'></td><td></td><td rowspan='4' style='overflow:hidden'><img src='http://localhost:1545/ResultImages\7\314.png' style='width:150pxpx;height:150pxpx' /></td></tr>
<
tr style='height:24px'><td style='font-size:0.8em;font-weight:bold;color:#92107b'>Vraag:</td><td style='background-color:#fff;border-left:1pt solid #cccccc;border-right:1pt solid #cccccc;color:#000088;font-size:0.8em;font-weight:bold;padding-left:4px'>21 Het beton leveren met een KOMO-productcertificaat</td><td style='background-color:#008800;border-right:1pt solid #cccccc;border-top:1pt solid #cccccc;border-bottom:1pt solid #cccccc;font-size:0.7em;text-align:center;vertical-align:middle'>Goed</td><td></td></tr>
<
tr style='height:20px'><td style='font-size:0.8em;font-weight:bold;color:#92107b'>Antwoord:</td><td style='background-color:#fff;border-left:1pt solid #cccccc;border-right:1pt solid #cccccc;color:#000088;font-size:0.8em;font-weight:bold;padding-left:4px'>Er is een KOMO-pruductcertificaat afgegeven.</td><td style='background-color:#fff;border-right:1pt solid #cccccc'></td><td></td></tr>
<
tr><td></td><td style='background-color:#fff;border-bottom:1pt solid #cccccc;border-right:1pt solid #cccccc;border-left:1pt solid #cccccc;font-size:0.7em;padding-left:4px;padding-top:4px;padding-bottom:6px'>De kwaliteit van het beton ten behoeve van de druklaag / opstortlaag van de begane grond vloer voldoet aan de in het bestek gestelde voorwaarden en eisen. Conform het bestek is het beton geleverd met een KOMO-productcertificaat. Een kopie van het KOMO-productcertificaat is echter nog niet ter bevestiging afgegeven.</td><td style='background-color:#fff;border-right:1pt solid #cccccc;border-bottom:1pt solid #cccccc'></td><td></td></tr>
</
table>
All items are wrapped inside a table that also has the same borderstyle as the inner table.
Below are the exportsettings:
<Pdf BorderType="AllBorders" BorderStyle="Thin" BorderColor="#cccccc"

What am i doing wrong here?

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 08 Oct 2013, 08:42 AM
Hello Michael,

Please try specifying the border settings like this:
border-top-color: #cccccc; border-top-width: 1pt; border-top-top-style...

Let me know whether this helps.

Regards,
Daniel
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Michael Bakker
Top achievements
Rank 2
answered on 08 Oct 2013, 09:51 AM
This works exactly the way i want it. Thanks for your fast response!
Tags
Grid
Asked by
Michael Bakker
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Michael Bakker
Top achievements
Rank 2
Share this question
or