I have a standard report which I created in SSRS that has the correct width for the columns and it looks like this:
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):
As you can see the report added its own spaces on the columns not in green or red.
How do I fix it?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.