Forum Discussion
RTL Matrix Expansion Issue in SSRS
Hi Ayman_Hezam,
Hope you're doing well!
By looking at your screenshots, I can clearly see the issue. Your matrix is expanding to the right and going off-page, even though you've set the Tablix direction to RTL. This is a known limitation in SSRS/Report Builder, and here's how to fix it properly.
--> Root Cause :
SQL Server 2016's Report Builder has a bug/limitation where setting LayoutDirection = RTL on the Tablix alone is not enough. The matrix columns still physically expand to the right because the report body itself doesn't have a true RTL container. The "Direction" property missing from the Report Body is also a known UI gap in version 15.0.200.
--> Solution :
You should edit the RDL XML directly by doing it step by step :
1. Close Report Builder
2. Open your .rdl file with Notepad or VS Code
3. Find the <Report> tag near the top and add this if it's missing:
<Language>ar-SA</Language> <Direction>RTL</Direction>
4. Also find your <Tablix> element and make sure it has:
<LayoutDirection>RTL</LayoutDirection>
5. Then find your <Body> tag and add:
<Style> <Direction>RTL</Direction> </Style>
6. Save and reopen in Report Builder.
Hope this helps. Feel free to ask me questions if needed, and don’t forget to give kudos (likes) & Accept as Solution if this guidance worked for you. That's motivate me to keep helping.
Best regards,
Oussama (Data Consultant & Fabric's Expert)
- Ayman_Hezam3 months agoRegular Visitor
Hi Oussama,
Thanks again for your support. I’ve followed your steps carefully and here’s the outcome:
The <Language>ar-SA</Language> tag was added successfully under <Report>.
When I tried adding <Direction>RTL</Direction> under <Report>, Report Builder refused to open the file and showed the following error: “The report definition element 'Report' contains an invalid child element 'Direction' in namespace 'http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition'. Expected elements: Description, Author, AutoRefresh, InitialPageName, DataSources, DataSets, ReportParameters, ReportParametersLayout, Code, EmbeddedImages, Language, CodeModules, Classes, CustomProperties, Variables, DeferVariableEvaluation, ConsumeContainerWhitespace, DataTransform, DataSchema, DataElementName, DataElementStyle, ReportSections.”
The <LayoutDirection>RTL</LayoutDirection> tag is already present in my Tablix (I had added it earlier).
I also added <Style><Direction>RTL</Direction></Style> under <Body>, but the matrix still expands off-page and the issue remains unresolved.
I will attach the RDL file so you can review the structure directly and advise on the correct placement or alternative properties (e.g., WritingMode/TextAlign) that are supported in this schema.
https://drive.google.com/file/d/14EO-3b4-rguPuPJbFOWus0pQEylid7vp/view?usp=sharing
Best regards, Ayman
- oussamahaimoud3 months agoMemorable Member
Hi Ayman_Hezam,
Thanks for testing each step carefully and sharing the exact error message, that's really helpful!
You're right, I apologize for that. The <Direction> tag directly under <Report> is not valid in the 2016 RDL schema, and the error message you got confirms this perfectly. That was my mistake.
Regarding your reply, we know now that the issue is not about missing RTL tag, it's about how SSRS 2016 physically renders dynamic column groups. The columns will always expand to the right regardless of direction settings, which is a rendering engine limitation.
Since your column groups are dynamic (driven by EntityTypeOrder2 and EntityDisplayName2 as seen in your screenshots), here's what you should do:
1. Fix the matrix position in the RDL :
Open your RDL file in Notepad and find your Tablix <Top> and <Left> values inside <TablixLocation> or the Style block, and move the matrix to start from the far right of the body so new columns push leftward visually.
2. Reduce the body width :
In the RDL XML, find:
<ReportSections>
<ReportSection>
<Body>
<Width>And make sure the Body width equals exactly your page width minus margins. A body wider than the printable area is often the hidden culprit.
For a standard A4 landscape with 2cm margins:
<Page>
<PageWidth>29.7cm</PageWidth>
<PageHeight>21cm</PageHeight>
<LeftMargin>2cm</LeftMargin>
<RightMargin>2cm</RightMargin>
</Page>So your body width should be 25.7cm maximum.
3. paste the relevant XML sections
I'm not able to open external URLs or download files, so I can't review your RDL directly. However, I'd suggest you paste the relevant XML sections here, specifically:
- The <Page> block
- The <Body><Width> value
- The <Tablix> opening tag with its Location/Size
- Your Column Groups structure
This way I can pinpoint exactly where the overflow is happening and give you a precise fix rather than general guidance. So, I think you're very close to solving this because the structure is right, it's just a positioning and page sizing issue at this point!
Hope this helps. Feel free to ask me questions if needed, and don’t forget to Accept as Solution if this guidance worked for you. That's motivate me to keep helping.
Best regards,
Oussama (Data Consultant & Fabric's Expert)
- Ayman_Hezam3 months agoRegular Visitor
Hi Oussama,
Thanks for the great explanation. Here are the specific XML sections you requested from my RDL file:
1. The <Tablix> Opening Tag, Location, and Size: <Tablix Name="Tablix4"> <Top>0cm</Top> <Left>18.59796cm</Left> <Height>20.48624cm</Height> <Width>7.10204cm</Width> <LayoutDirection>RTL</LayoutDirection> 2. My Column Groups Structure (<TablixColumnHierarchy>): <TablixColumnHierarchy> <TablixMembers> <TablixMember> <TablixHeader> <Size>4.59808cm</Size> </TablixHeader> </TablixMember> <TablixMember> <Group Name="EntityTypeOrder2"> <GroupExpressions> <GroupExpression>=Fields!EntityTypeOrder.Value</GroupExpression> </GroupExpressions> </Group> <SortExpressions> <SortExpression> <Value>=Fields!EntityTypeOrder.Value</Value> </SortExpression> </SortExpressions> <TablixHeader> <Size>0.7205cm</Size> </TablixHeader> <TablixMembers> <TablixMember> <Group Name="EntityDisplayName2"> <GroupExpressions> <GroupExpression>=Fields!EntityDisplayName.Value</GroupExpression> </GroupExpressions> </Group> <TablixHeader> <Size>3.87758cm</Size> </TablixHeader> <TablixMembers> <TablixMember /> </TablixMembers> </TablixMember> <TablixMember> <TablixHeader> <Size>3.87758cm</Size> </TablixHeader> </TablixMember> </TablixMembers> </TablixMember> </TablixMembers> </TablixColumnHierarchy> 3. The <Body><Width> and <Page> block: <Style> <Border> <Style>None</Style> </Border> <Direction>RTL</Direction> </Style> </Body> <Width>25.7cm</Width> <Page> <PageWidth>29.7cm</PageWidth> <PageHeight>21cm</PageHeight> <LeftMargin>2cm</LeftMargin> <RightMargin>2cm</RightMargin> <TopMargin>0.5cm</TopMargin> <BottomMargin>0.5cm</BottomMargin> <ColumnSpacing>0.13cm</ColumnSpacing> <Style /> </Page>Based on your previous guidance, I have already adjusted the Body <Width> to 25.7cm and recalculated the Tablix <Left> property to 18.59796cm (25.7cm body width minus 7.10204cm tablix width) to align it to the far right.
I am currently using SSRS 2016, and I have more than 30 other reports that rely on this exact same dynamic matrix layout mechanism. Understanding this alignment logic is a huge lifesaver for my project! Could you please double-check these properties and confirm if my math and approach are fully correct before I replicate this fix across the rest of my reports?
Best regards,