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

Stylesheet styles lost on PDF render

5 Answers 144 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
terryagi
Top achievements
Rank 1
terryagi asked on 13 Oct 2008, 02:39 PM
I have a report in a report library, and this library is referenced by a windows app.  I am trying to render a report directly to PDF from code, i.e. without a report viewer.  I am able to successfully render the PDF; however, the styles in the stylesheets do not carry over to the PDF.  How can I resolve this?

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 Oct 2008, 03:16 PM
Hello terryagi,

How do you render the report to pdf manually? I've tested this on my end but could not replicate any problems with the styles. Any additional information would be highly appreciated.

All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
terryagi
Top achievements
Rank 1
answered on 13 Oct 2008, 03:23 PM
I am using the following process in Program.cs (Main()) in my windows app:

ReportLibrary.FullPage rptFullPage = new ReportLibrary.FullPage();

            string mimeType = string.Empty;
            string extension = string.Empty;
            System.Text.Encoding encoding = null;
            
            byte[] buffer = Telerik.Reporting.Processing.ReportProcessor.Render("PDF", rptFullPage, null, out mimeType, out extension, out encoding);

            using (FileStream fs = new FileStream(@"C:\FullPage.pdf", FileMode.Create))
            {
                fs.Write(buffer, 0, buffer.Length);
                fs.Flush();
                fs.Close();
            }


My styles are in an external file "\styles\FullPage.xml".  The preview works correctly.  Let me know if you need more information.
0
terryagi
Top achievements
Rank 1
answered on 13 Oct 2008, 03:25 PM
Here is my app.config from the windows app:

<configuration>
    <configSections>
        <section name="Telerik.Reporting" type="Telerik.Reporting.Processing.Config.ReportingConfigurationSection, Telerik.Reporting.Processing, Version=2.8.8.925, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
                 allowLocation="true" allowDefinition="Everywhere"/>
    </configSections>

    <Telerik.Reporting>
        <Extensions>
            <Render>
                <Extension name="PDF" type="Telerik.Reporting.ImageRendering.PdfReport, Telerik.Reporting.Processing, Version=2.8.8.925, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" description="PDF Rendering">
                    <Parameters>
                        <Parameter name="FontEmbedding" value="Subset" />
                    </Parameters>
                </Extension>
            </Render>
        </Extensions>
    </Telerik.Reporting>

</configuration>
0
terryagi
Top achievements
Rank 1
answered on 15 Oct 2008, 03:12 PM
* bump
0
Steve
Telerik team
answered on 16 Oct 2008, 12:20 PM
Hello terryagi,

We've answered your inquiry in the support ticket you've opened. Please review the project and let us know what differs in your case.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
terryagi
Top achievements
Rank 1
Answers by
Steve
Telerik team
terryagi
Top achievements
Rank 1
Share this question
or