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
0
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.
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.
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>
<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
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.
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.