Question

I have a standard report which I created in SSRS that has the correct width for the columns and it looks like this:

enter image description here

The width and height of each column for the row shows up correctly.

I created an ASPX page for the report to be shown to our end users and the page code is this:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="credential_logsheet.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>CreDash</title>
    <style> 
    #ssrs {
    margin-left: 20px;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="ssrs">

        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" ProcessingMode="Remote" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Height="" ShowBackButton="False" ShowExportControls="False" ShowFindControls="False" ShowPageNavigationControls="True" ShowPrintButton="False" ShowRefreshButton="False" ShowToolBar="True" ShowZoomControl="False" SizeToReportContent="True" Width="100%">
        <ServerReport ReportPath="/IntRep/LSheet" ReportServerUrl="http://server/rptsvr/" />
        </rsweb:ReportViewer>
    </div>
    </form>
</body>
</html>

Instead of coming out like the report showed with screenshot above, it comes out like this (zoomed out to show the entire report):

enter image description here

As you can see the report added its own spaces on the columns not in green or red.

How do I fix it?

Was it helpful?

Solution

What's happening is SSRS is being told to fit your report to the entirety of the available space in the viewer control; so columns are being stretched until the table consumes the entire page width.

You might try tweaking these values:

SizeToReportContent="True" Width="100%"

Additionally, ensure that your rendering command isn't forcing whole page width/100% fit/etc.

Lastly, it's probably not the issue you're facing, but good practice when you're concerned about maintaining specific sizes/formatting on a report would be to set the "allow growth" (and related properties) on the necessary controls in your report.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top