question

MarvinM-7946 avatar image
0 Votes"
MarvinM-7946 asked Joyzhao-MSFT commented

Issue on setting report/body background color when export to word

Hi,

I have an RDL file which have background color on it and works fine when you click preview.

90920-2021-04-26-09-28-21-ssrs-microsoft-visual-studio.png

If I try to export it to word, it removes and set it to no color.

Is there a configuration that I'm missing?

As a workaround, I've used rectangle to force the background color into WORD but i'm getting extra page. I've removed all the margin on the report and can't get it working. Its either I have a small white space at the bottom of a 1 pager or I'll get 2 pages (with an extra blank page since the rectangle pushes the report)

91071-2021-04-26-09-44-38-rpcmain-33docx-compatibility-m.png


sql-server-reporting-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Joyzhao-MSFT avatar image
0 Votes"
Joyzhao-MSFT answered Joyzhao-MSFT commented

Hi @MarvinM-7946
The body and page background images and colors are not displayed in Word. For more information, please refer to : Exporting to Microsoft Word (Report Builder and SSRS).
Best Regards,
Joy


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The way you create a rectangle is also feasible. If you don’t want to generate additional pages, you have to make sure that the body size is not greater than paper size+margins.

91211-02.jpg


0 Votes 0 ·
02.jpg (21.9 KiB)

but i want the whole page in a different background colour (without any white margins).
91284-2021-04-26-20-33-52-6rpcmain-45docx-compatibility.png
91285-2021-04-26-20-34-42-report-properties.png


0 Votes 0 ·

When I export to PDF, there are extra blank pages, but there is no extra white space on a single page. At present, I have not found a way to remove blank pages.
92850-04.jpg


0 Votes 0 ·
04.jpg (4.5 KiB)
MarvinM-7946 avatar image
0 Votes"
MarvinM-7946 answered MarvinM-7946 edited

Here's the code for reference

 <?xml version="1.0" encoding="utf-8"?>
 <Report MustUnderstand="df" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:df="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition/defaultfontfamily">
   <df:DefaultFontFamily>Segoe UI</df:DefaultFontFamily>
   <AutoRefresh>0</AutoRefresh>
   <ReportSections>
     <ReportSection>
       <Body>
         <ReportItems>
           <Rectangle Name="Rectangle1">
             <KeepTogether>true</KeepTogether>
             <Height>29.7cm</Height>
             <Width>21cm</Width>
             <Style>
               <Border>
                 <Style>None</Style>
               </Border>
               <BackgroundColor>Black</BackgroundColor>
             </Style>
           </Rectangle>
         </ReportItems>
         <Height>29.7cm</Height>
         <Style />
       </Body>
       <Width>21cm</Width>
       <Page>
         <PageHeight>29.7cm</PageHeight>
         <PageWidth>21cm</PageWidth>
         <LeftMargin>0cm</LeftMargin>
         <RightMargin>0cm</RightMargin>
         <TopMargin>0cm</TopMargin>
         <BottomMargin>0cm</BottomMargin>
         <ColumnSpacing>0.13cm</ColumnSpacing>
         <Style />
       </Page>
     </ReportSection>
   </ReportSections>
   <ReportParametersLayout>
     <GridLayoutDefinition>
       <NumberOfColumns>4</NumberOfColumns>
       <NumberOfRows>2</NumberOfRows>
     </GridLayoutDefinition>
   </ReportParametersLayout>
   <ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
   <rd:ReportUnitType>Cm</rd:ReportUnitType>
   <rd:ReportID>7f1083b0-92bb-461a-b08d-4ca4d2dd1612</rd:ReportID>
 </Report>
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.