码迷,mamicode.com
首页 > 其他好文 > 详细

XtrasReport 标签打印

时间:2014-10-25 11:45:40      阅读:463      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   ar   for   sp   div   

bubuko.com,布布扣
            var lblList = new List<product_LblPrt_tmp>();
            using (JL_MFGEntities ctx = new JL_MFGEntities())
            {
                lblList=ctx.product_LblPrt_tmp.ToList();
            }
            var list = ServiceLocator.Fetch<IMaterialService>().GetList();
            var rpt = new XtraReport3();
            rpt.DataSource = lblList;// new List<Base_Material>() { list[0], list[1] };
            rpt.RequestParameters = false;
            rpt.PrintingSystem.ShowMarginsWarning = false;

            rpt.PrintingSystem.ShowPrintStatusDialog = false;




            ReportPrintTool printTool = new ReportPrintTool(rpt);
            
                printTool.Report.CreateDocument(false);
                // Invoke the Ribbon Print Preview form modally, 
                // and load the report document into it.
                printTool.PrintingSystem.ShowMarginsWarning = false;
                printTool.PrintingSystem.AddCommandHandler(new ExportToImageCommandHandler());
                var v = printTool.PrintingSystem.GetCommandVisibility(PrintingSystemCommand.PageSetup);
                printTool.PrintingSystem.SetCommandVisibility(PrintingSystemCommand.PageSetup, CommandVisibility.None);

                printTool.PrintingSystem.ExecCommand(PrintingSystemCommand.ShowFirstPage);
                printTool.ShowPreview();
View Code

打印机属性设置页面大小后,

发现在ReportTool里的看到的打印机页面大小不一致。。

各种麻烦

XtrasReport 标签打印

标签:style   blog   http   color   os   ar   for   sp   div   

原文地址:http://www.cnblogs.com/wdfrog/p/4049829.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!