Sql server报告网页对中心的对齐

本文关键字:对齐 server 报告 网页 Sql | 更新日期: 2023-09-27 18:07:36

我正在使用SQL Server报表服务,并将其与报表查看器控件一起显示。它在页面的左侧显示报告。我想让它居中对齐

我尝试了以下方法,但没有成功。

  1. divtable中包装报表查看器控件并使其居中对齐。
  2. 报表查看器控件的缩放模式。

所以请给我一些解决方案让它居中对齐。

Sql server报告网页对中心的对齐

试试:

<div align="center">
    <rsweb:ReportViewer ID="ReportViewer1" runat="server" DocumentMapWidth="100%"
    Font-Names="Verdana" Font-Size="8pt" PromptAreaCollapsed="True"
    ShowToolBar="False" Width="1100px" Height="100%">
    </rsweb:ReportViewer>
</div>

OR With JQUERY:

$('#ReportViewer1_fixedTable tbody tr').attr("align", "center");

或服务器端:

ReportPageSettings rst = rptVwr.LocalReport.GetDefaultPageSettings();
            if (rptVwr.ParentForm.Width > rst.PaperSize.Width)
            {
                int vPad = (rptVwr.ParentForm.Width - rst.PaperSize.Width) / 2;
                rptVwr.Padding = new Padding(vPad, 1, vPad, 1);
            }

[调整高度和宽度]