ASP.net中Crystal Report中的自定义页面打印

时间:2012-06-26 09:24:21

标签: asp.net crystal-reports-2008

我创建了一个水晶报告,其中我使用了我的默认打印机中创建的自定义页面(例如宽度为8.50英寸和高度为5.84英寸的凭证)。

问题在于,当我从代码运行应用程序时,它设置了我在Crystal Report的默认设置中提供的页面。但是在IIS上发布之后,它将被打印在A4页面而非页面定义上。

寻找有价值的解决方案

提前致谢,

Supriya

1 个答案:

答案 0 :(得分:0)

最有可能打印机采用打印机的默认设置。 尝试从代码本身设置页边距。

            PageMargins pgMargins = this.CrystalReportDoc.PrintOptions.PageMargins;
            pgMargins.topMargin = <top margin here>;
            pgMargins.bottomMargin = <bottom margin here>;
            this.CrystalReportDoc.PrintOptions.ApplyPageMargins(pgMargins);

此外,您必须提供的测量值应为缇,您可以使用this之类的在线测量