C# 水晶报表打印机设置,系统默认纵向,我想让他是横向打印,高手请进
我在制做水晶报表已经是横向的。
1.水晶报表设置
设置—>打印机设置
注意:无打印机一定要选中(此处如果选择打印,显示的时候页面数据将不能完全显示)
网上说的修改水晶报表BUG
) crystalprinthost.html
if (window.dialogArguments.pageorientation) {
objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\"";
objectTag += window.dialogArguments.pageorientation;
objectTag += "\">";
}
这是一个js方法中的代码和水晶报表的源代码不对,在这里只要对这部分代码进行修改就可以如下:
if (window.dialogArguments.paperorientation ) {
objectTag +="<PARAM NAME=\"PageOrientation\" VALUE=\"";
objectTag += window.dialogArguments.paperorientation;
objectTag += "\">";
}
后台
ReportDocument RptDoc;
string RptName = Server.MapPath("") + "\\Rpt\\AppPlan.rpt";
RptDoc = new ReportDocument();
RptDoc.Load(RptName);
RptDoc.SetDataSource(dt);
RptDoc.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
Report.ReportSource = RptDoc;
Report.DataBind();
Report是前台的CrystalReportViewer
可我在单击水晶报表的打印时,还是要重新选择打印机的选项,很麻烦,有没有直接可以代码设置的呢?
不然每次打印时,都要设置一下