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

Conditional Format on Report Export to Word

1 Answer 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 17 May 2012, 11:26 PM
Hello,

I am using Telerik Reporting Q1 2012.

I have run into an issue that when several of my Telerik reports are exported to a Word Document (docx), the page margins in the resulting work doc are different from the ones specified in the report. This can cause a margin print error for several users (including a very unhappy company VP).

I had the report footer set to .25 inches within the report (Layout - Page Settings - Margins). However, it gets reset to .14 inches after export to Word. When certain users try to print the report from Word, they receive an error message telling them that the margins are outside their printer margins. (Note that this was not a problem with the previous version of Telerik we were using.)

My work around has been to set the bottom margin of the report to .38 inches so it falls within their printer margins when the report is exported to Word. However, this means that when the report is pulled up in the viewer or exported to a different extension (PDF for example), the bottom margin remains at .38. Which not only looks sloppy, but also can cause the report to use extra pages when there is lots of data.

Is there a way to programatically set the bottom page margin to .38, but ONLY when exporting to Word?

Thanks,

Tina

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 May 2012, 03:50 PM
Hello Tina,

This is a known problem described in the Design Considerations for Word Rendering help article: Microsoft Word does not support the concept of hard pages. Instead, when the exported document is opened in Word, Word repaginates it again based on the page size. The rendering extension tries to preserve closely the original pages of the report, inserting additional page breaks when necessary. However in some rare cases the repagination performed by Word might interfere with this behavior, resulting in a document with page breaks on unexpected places or blank pages. To correct this, you can try changing the Word’s pagination by adjusting the page margins.

To answer your question directly, you would have to render the report programmatically in order to set different margins depending on the format. If you have a requirement to show the report in a viewer, then you can hide the export dropdown and provide your own UI for the export which would handle the different margins prior export.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Tina
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or