0

只需打开一个 rpt 的简单 .NET 4.0 应用程序。我只想强制使用 Landscape 和 A4 纸,但无法正常工作。

我尝试在报告设计中从页面设置中删除打印机,但没有运气。

资源:

private void Page_Init(object sender, EventArgs e)
        {
            ConfigureCrystalReports();
        }
        private void ConfigureCrystalReports()
        {
            //
            ConnectionInfo myConnectionInfo = new ConnectionInfo();
            //
            ReportDocument rptDoc = new ReportDocument();
            rptDoc.Load(Server.MapPath(Properties.Settings.Default.rptPath));
            rptDoc.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
            rptDoc.PrintOptions.PaperSize = PaperSize.PaperA4;
            //
            myConnectionInfo.AllowCustomConnection = true;
            myConnectionInfo.UserID = "xxxxx";
            myConnectionInfo.Password = "xxxxx";
            //
            crViewer.ReportSource = rptDoc;
            //
            SetDBLogonForReport(myConnectionInfo);
        }
4

0 回答 0