0

I have a report rdlc (microsoft report viewer 2010) which is needed to print in A3 or A4,

My question are as following

1) is it possible to change Paper size (A3 or A4) in runtime?

2) According to the paper size is it possible to make Tablix Width 100% of the paper size?

4

2 回答 2

0

1.在运行时更改纸张大小:

System.Drawing.Printing.PageSettings AlmostA4 = new System.Drawing.Printing.PageSettings();
AlmostA4.PaperSize = new System.Drawing.Printing.PaperSize("CustomType", 17, 12);
ReportViewer.SetPageSettings(AlmostA4);

至于将其准确地更改为 A3 和 A4,您将不得不再四处搜索。MSDN 库信息量很大。

2.“根据纸张大小,是否可以将Tablix Width设为纸张大小的100%?”

这将是创建报告的问题。您将/应该只需要在报表设计器中将 tablix 设置为整个报表的大小。然后将报告设置为没有边距/页眉/页脚,然后 tablix(理想情况下)应该是整个工作表的大小。

于 2013-09-11T15:03:25.503 回答
0

您可以使用系统中安装的纸张尺寸

PageSettings a4 = new PageSettings();
foreach (PaperSize item in a4.PrinterSettings.PaperSizes)
{
    if (item.PaperName == "A4")
    {
        a4.PaperSize = item;
        break;
    }
}

这是为您提供纸张尺寸名称及其尺寸的 信息,请检查此图像以便清楚理解

于 2020-07-01T13:36:45.733 回答