[DevExpress]GridControl中的GridView内容打印

        private void btnPrint_Click(object sender, EventArgs e)
        {
            
            PrintableComponentLink link = new PrintableComponentLink(new PrintingSystem());
            link.Component = this.gridUser;
            link.Landscape = true;
            link.PaperKind = System.Drawing.Printing.PaperKind.A3;
            link.CreateMarginalHeaderArea += new CreateAreaEventHandler(Link_CreateMarginalHeaderArea);
            link.CreateDocument();
            link.ShowPreview();
        }
        private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e)
        {
            string title = string.Format("用户表-({0}年度)","2016");
            PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.None, title, Color.DarkBlue,
               new RectangleF(0, 0, 100, 21), BorderSide.None);

            brick.LineAlignment = BrickAlignment.Center;
            brick.Alignment = BrickAlignment.Center;
            brick.AutoWidth = true;
            brick.Font = new System.Drawing.Font("宋体", 11f, FontStyle.Bold);
        }

[DevExpress]GridControl中的GridView内容打印_第1张图片

你可能感兴趣的:([DevExpress]GridControl中的GridView内容打印)