简单的.NET 4.0应用程序,只需打开一个rpt。我只想强制使用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);
}