private void btn_NonPrintableBrick_Click(object sender, EventArgs e) { BrickGraphics graph = printingSystem1.Graph; // Start the report generation. printingSystem1.Begin(); // Set the modifier - specify the page area. graph.Modifier = BrickModifier.MarginalHeader; string format = "Page {0} of {1}"; graph.Font = graph.DefaultFont; graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 0, 0, graph.Font.Height); // Create a brick. PageInfoBrick brick = graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; // Create another brick with different alignment. brick = graph.DrawPageInfo(PageInfo.DateTime, "{0:MMMM dd}", Color.Black, r, BorderSide.None); // Change the page area - set the modifier. printingSystem1.Graph.Modifier = BrickModifier.DetailHeader; graph.BackColor = Color.Silver; // Create a brick, which will be hidden in the printout. TextBrick tBrick = new TextBrick(BorderSide.None, 1, Color.Black, Color.Khaki, Color.Blue); tBrick.Url = "http://www.devexpress.com"; tBrick.Text = "Click here to visit our web site"; tBrick.CanPublish = false; printingSystem1.Graph.DrawBrick(tBrick, new RectangleF(0, 0, 200, 20)); // Create a brick - a column header. printingSystem1.Graph.DrawString("Report Items", Color.Black, new RectangleF(0, 20, 200, 20), BorderSide.All); // Change the page area - set the modifier. printingSystem1.Graph.Modifier = BrickModifier.Detail; graph.BackColor = Color.White; // Create bricks. for (int i = 0; i < 100; i++) { printingSystem1.Graph.DrawString("Item N" + Convert.ToString(i + 1), Color.Black, new RectangleF(0, 20 * i, 200, 20), BorderSide.All); } // Finish the report generation. printingSystem1.End(); // Preview the report. printingSystem1.PreviewFormEx.Show(); }
private void printableComponentLink1_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { PageInfoBrick pib = new PageInfoBrick(); pib.Format = "Page {0}/{1}"; string Suppliername = "Supplied By: " + dtRec.AsDataView()[0]["SupplierName"] as string; string Receivername = "Received By: " + dtRec.AsDataView()[0]["ReceivedBy"] as string; //RectangleF r = RectangleF.Empty; //r.Height = 20; //r.X = 800; pib = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, pib.Format, Color.Black, new RectangleF(100, 0, 200, 20), BorderSide.None); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, pib.Format + "\n Print Date " + DateTime.Now.ToShortDateString() + " G.C", Color.Black, new RectangleF(100, 0, 200, 40), BorderSide.None); brick.Alignment = BrickAlignment.Far; TextBrick brickleft = e.Graph.DrawString(Suppliername, Color.Navy, new RectangleF(0, 0, 200, 20), DevExpress.XtraPrinting.BorderSide.None); brickleft.Font = new Font("Tahoma", 10); brickleft.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Near); TextBrick brickrb = e.Graph.DrawString(Receivername, Color.Navy, new RectangleF(0, 20, 200, 20), DevExpress.XtraPrinting.BorderSide.None); brickrb.Font = new Font("Tahoma", 10); brickrb.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Near); }
private void printableComponentLink1_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { PageInfoBrick pib = new PageInfoBrick(); pib.Format = "Page {0}/{1}"; DataTable dt = (DataTable)gridIssues.DataSource; DataView dv = new DataView(dt); string Issuedto = "Issued To: " + dv[0]["IssuedTo"] as string; string Issuedby = "Issued By: " + dv[0]["IssuedBy"] as string; //RectangleF r = RectangleF.Empty; //r.Height = 20; //pib = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, pib.Format, Color.Black, r, BorderSide.None); //PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, "Print Date " +DateTime.Now.ToShortDateString() + " G.C", // Color.Black, r, BorderSide.None); //brick.Alignment = BrickAlignment.Far; pib = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, pib.Format, Color.Black, new RectangleF(100, 0, 200, 20), BorderSide.None); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, pib.Format + "\n Print Date " + DateTime.Now.ToShortDateString() + " G.C", Color.Black, new RectangleF(100, 0, 200, 40), BorderSide.None); brick.Alignment = BrickAlignment.Far; TextBrick brickleft = e.Graph.DrawString(Issuedto, Color.Navy, new RectangleF(0, 0, 600, 40), DevExpress.XtraPrinting.BorderSide.None); brickleft.Font = new Font("Tahoma", 10); brickleft.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Near); TextBrick brickrb = e.Graph.DrawString(Issuedby, Color.Navy, new RectangleF(0, 20, 600, 40), DevExpress.XtraPrinting.BorderSide.None); brickrb.Font = new Font("Tahoma", 10); brickrb.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Near); }
protected override void CreateMarginalHeader(BrickGraphics graph) { // Set the format string for a page info brick. string format = "Page {0} of {1}"; // Set font to the default font. graph.Font = graph.DefaultFont; // Set the background color to Transparent. graph.BackColor = Color.Transparent; // Set the rectangle for drawing. RectangleF r = new RectangleF(0, 0, 0, graph.Font.Height); // Add a page info brick without borders that displays // the current page number from the total number of pages. PageInfoBrick brick = graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); // Set brick alignment. brick.Alignment = BrickAlignment.Far; // Enable auto width for a brick. brick.AutoWidth = true; // Add a page info brick without borders // that displays date and time. brick = graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None); // Set brick alignment. brick.Alignment = BrickAlignment.Near; // Enable auto width for a brick. brick.AutoWidth = true; }
// Create the Marginal Header section. private void link1_CreateMarginalHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e) { // Specify font and color settings for the brick graphics. e.Graph.Font = e.Graph.DefaultFont; e.Graph.BackColor = Color.Transparent; // Set the format string for a page info brick. string format = "Page {0} of {1}"; // Set the rectangle for a page info brick. RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height); // Draw a page info brick, which displays page numbers. PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); // Set brick alignment. brick.Alignment = BrickAlignment.Far; // Enable the auto width option for a brick. brick.AutoWidth = true; // Draw a page info brick, which displays current date and time. brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None); // Set a brick's alignment. brick.Alignment = BrickAlignment.Near; // Enable the auto width option for a brick. brick.AutoWidth = true; }
private void Link_CreateMarginalHeaderAreaRetur(object sender, CreateAreaEventArgs e) { PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.None, "KERTAS PADALARANG", Color.Black, new RectangleF(0, 0, 500, 40), BorderSide.None); brick.Alignment = BrickAlignment.Near; brick.AutoWidth = true; brick.Font = new Font("Time News Roman", 16, FontStyle.Bold); }
private void Link_CreateMarginalFooterAreaPendapatan(object sender, CreateAreaEventArgs e) { PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.None, "KERTAS PADALARSNG", Color.Black, new RectangleF(0, 0, 500, 40), BorderSide.None); brick.LineAlignment = BrickAlignment.Center; brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; brick.Font = new Font("Time News Roman", 10); }
void Link_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { PageInfoBrick pib = new PageInfoBrick() { PageInfo = PageInfo.Number, Rect = new RectangleF(0, 0, 300, 20), Alignment = BrickAlignment.Far, BorderWidth = 0, HorzAlignment = DevExpress.Utils.HorzAlignment.Far, Font = new Font("Arial", 8, FontStyle.Italic), Format = "Page : {0}" }; e.Graph.DrawBrick(pib); }
private void button1_Click(object sender, EventArgs e) { BrickGraphics graph = printingSystem1.Graph; // Start the report generation. printingSystem1.Begin(); // Set the modifier - specify the page area. graph.Modifier = BrickModifier.MarginalHeader; string format = "Page {0} of {1}"; graph.Font = graph.DefaultFont; graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 0, 0, graph.Font.Height); // Create a brick. PageInfoBrick brick = graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; // Create another brick with different alignment. brick = graph.DrawPageInfo(PageInfo.DateTime, "{0:MMMM dd}", Color.Black, r, BorderSide.None); // Change the page area - set the modifier. printingSystem1.Graph.Modifier = BrickModifier.DetailHeader; graph.BackColor = Color.Silver; // Create a brick. printingSystem1.Graph.DrawString("Report Items", Color.Black, new RectangleF(0, 0, 200, 20), BorderSide.All); // Change the page area - set the modifier. printingSystem1.Graph.Modifier = BrickModifier.Detail; graph.BackColor = Color.White; // Create bricks. for (int i = 0; i < 100; i++) { printingSystem1.Graph.DrawString("Item N" + Convert.ToString(i + 1), Color.Black, new RectangleF(0, 20 * i, 200, 20), BorderSide.All); } printingSystem1.End(); printingSystem1.PreviewFormEx.Show(); }
protected override void CreateMarginalHeader(BrickGraphics gr) { gr.Modifier = BrickModifier.MarginalHeader; string format = "Printed on {0:MMMM, dd}"; PageInfoBrick brick = gr.DrawPageInfo(PageInfo.DateTime, format, Color.Black, new RectangleF(0, 0, 0, 20), BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; }
protected override void CreateMarginalFooter(BrickGraphics gr) { gr.Modifier = BrickModifier.MarginalFooter; string format = "Page {0} of {1}"; PageInfoBrick brick = gr.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, new RectangleF(0, 0, 0, 20), BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; }
private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { string title = string.Format("断电关系查询", DateTime.Now.ToString("yyyy-MM-dd")); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.None, title, Color.Black, new RectangleF(0, 0, 100, 35), BorderSide.None); brick.LineAlignment = BrickAlignment.Center; brick.Alignment = BrickAlignment.Center; brick.AutoWidth = true; brick.Font = new System.Drawing.Font("宋体", 12f, FontStyle.Regular); }
private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { string title = this.AppInfo.AppUnit + " -- " + "备件信息报表"; 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); }
void link_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, "", Color.DarkBlue, new RectangleF(0, 0, 100, 20), BorderSide.None); brick.LineAlignment = BrickAlignment.Far; brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; }
void link_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { PageInfoBrick pib = new PageInfoBrick(); pib.PageInfo = PageInfo.NumberOfTotal; pib.Rect = new RectangleF(0, 0, 300, 20); pib.Alignment = BrickAlignment.Far; pib.BorderWidth = 0; pib.HorzAlignment = DevExpress.Utils.HorzAlignment.Far; pib.Font = new Font("Arial", 8, FontStyle.Italic); pib.Format = "Pages {0} of {1}"; e.Graph.DrawBrick(pib); }
void link_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { if (_IsBill) { PageInfoBrick vPageInfoBrick1 = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, "第{0}页,共{1}页", Color.Black, new RectangleF(0, 0, 100, 15), BorderSide.None); vPageInfoBrick1.LineAlignment = BrickAlignment.Far; vPageInfoBrick1.Alignment = BrickAlignment.Far; vPageInfoBrick1.AutoWidth = true; vPageInfoBrick1.Font = new System.Drawing.Font("宋体", 11f); //string pageInfo = string.Empty; //if (_IsBill) // pageInfo = "第{0}页,共{1}页" + "\r\n" + "①白存根 ②红客户 ③黄回单"; //else // pageInfo = "第{0}页,共{1}页"; PageInfoBrick vPageInfoBrick2 = e.Graph.DrawPageInfo(PageInfo.None, "①白存根 ②红客户 ③黄回单", Color.Black, new RectangleF(0, 0, 100, 18), BorderSide.None); vPageInfoBrick2.LineAlignment = BrickAlignment.Far; vPageInfoBrick2.Alignment = BrickAlignment.Near; vPageInfoBrick2.AutoWidth = true; } //if (_IsBill) //{ // PageInfoBrick vPageInfoBrick1 = e.Graph.DrawPageInfo(PageInfo.None, "①白存根 ②红客户 ③黄回单", Color.Black, // new RectangleF(0, 0, 100, 15), BorderSide.None); // vPageInfoBrick1.LineAlignment = BrickAlignment.Far; // vPageInfoBrick1.Alignment = BrickAlignment.Far; // vPageInfoBrick1.AutoWidth = true; // vPageInfoBrick1.Font = new System.Drawing.Font("宋体", 9f); //} ////string pageInfo = string.Empty; ////if (_IsBill) //// pageInfo = "第{0}页,共{1}页" + "\r\n" + "①白存根 ②红客户 ③黄回单"; ////else //// pageInfo = "第{0}页,共{1}页"; //PageInfoBrick vPageInfoBrick2 = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, "第{0}页,共{1}页", Color.Black, // new RectangleF(0, 0, 100, 18), BorderSide.None); // vPageInfoBrick2.LineAlignment = BrickAlignment.Center; // vPageInfoBrick2.Alignment = BrickAlignment.Far; // vPageInfoBrick2.AutoWidth = true; // vPageInfoBrick2.Font = new System.Drawing.Font("宋体", 10f); //vPageInfoBrick2.Font = new System.Drawing.Font("宋体", 9f, FontStyle.Bold); PageInfoBrick logo = e.Graph.DrawPageInfo(PageInfo.None, "【开发公司:冰雪软件】", Color.Gray, new RectangleF(0, 0, 100, 15), BorderSide.None); logo.LineAlignment = BrickAlignment.Far; logo.Alignment = BrickAlignment.Center; logo.AutoWidth = true; logo.Font = new System.Drawing.Font("宋体", 9f); }
void link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { //纯文本信息块,设置一些文字性说明信息,一般设置:简单的说明信息 //TextBrick text = e.Graph.DrawString("纯文字信息块", Color.Black, new RectangleF(100, 10, 100, 15), BorderSide.Bottom); ////BrickGraphics bg = e.Graph; ////bg.Font = new System.Drawing.Font("宋体", 18, FontStyle.Bold); //////TextBrick text = bg.DrawString(_PrintHeader, Color.Black, new RectangleF(450, 0, (_IsBill ? _PrintHeader.Length * 15 : 120), 21), BorderSide.Bottom); ////TextBrick text = bg.DrawString(_PrintHeader, Color.Black, new RectangleF(200, 0, 250, 21), BorderSide.None); //页信息块,可以设置页相关信息,一般设置:打印的页码信息 //if (_IsBill) //{ PageInfoBrick vPageInfoBrick1 = e.Graph.DrawPageInfo(PageInfo.None, _PrintCompany, Color.Black, new RectangleF(0, 0, 100, 40), BorderSide.None); vPageInfoBrick1.LineAlignment = BrickAlignment.None; vPageInfoBrick1.Alignment = BrickAlignment.Center; vPageInfoBrick1.AutoWidth = true; vPageInfoBrick1.Font = new System.Drawing.Font("宋体", 30, FontStyle.Bold); PageInfoBrick vPageInfoBrick2 = e.Graph.DrawPageInfo(PageInfo.None, _PrintHeader, Color.Black, new RectangleF(0, 0, 200, _IsBill ? 60 : 20), BorderSide.None); vPageInfoBrick2.LineAlignment = BrickAlignment.Center; vPageInfoBrick2.Alignment = BrickAlignment.Center; vPageInfoBrick2.AutoWidth = true; vPageInfoBrick2.Font = new System.Drawing.Font("宋体", 14, FontStyle.Bold); //vPageInfoBrick2.Font = new System.Drawing.Font("宋体", _IsBill ? 22 : 14, FontStyle.Bold); //} ////if (_IsBill) ////{ //页信息块,可以设置页相关信息,一般设置:打印的页码信息 PageInfoBrick vPageInfoBrick3 = e.Graph.DrawPageInfo(PageInfo.None, _PrintSubTitle, Color.Black, new RectangleF(0, 0, 100, _IsBill ? 18 : (_PrintHeader.Contains("对账单") && MainForm.Company.Contains("镇阳") ? 48 : 35)), BorderSide.None); if (_IsBill) { vPageInfoBrick3.LineAlignment = BrickAlignment.Center; } else { vPageInfoBrick3.LineAlignment = BrickAlignment.Far; } vPageInfoBrick3.Alignment = BrickAlignment.Center; vPageInfoBrick3.AutoWidth = true; vPageInfoBrick3.Font = new System.Drawing.Font("宋体", 11, FontStyle.Bold); vPageInfoBrick3.BackColor = Color.Transparent; ////} }
private void CreatePageFooter(BrickGraphics gr) { gr.Font = new Font("Arial", 8, FontStyle.Underline); gr.BackColor = Color.Transparent; gr.Modifier = BrickModifier.MarginalFooter; RectangleF r = new RectangleF(0, 0, 0, gr.Font.Height); PageInfoBrick brick = gr.DrawPageInfo(PageInfo.Number, "XtraPrintingSystem by Developer Express inc.", Color.Blue, r, BorderSide.None); brick.Hint = brick.Url = "www.devexpress.com"; brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; }
private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { PageInfoBrick baslikBrick = e.Graph.DrawPageInfo(PageInfo.UserName, "DENSİ ENDÜSTRİYEL TARTI SİSTEMLERİ ", Color.Black, new RectangleF(20, 20, 100, 20), BorderSide.None); baslikBrick.LineAlignment = BrickAlignment.Center; baslikBrick.Alignment = BrickAlignment.Center; baslikBrick.AutoWidth = true; // rapor önizleme sayfasında tarih aralığı yazdırmak için kullanılıyor PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.DateTime, raporFirstDate + " / " + raporLastDate, Color.Black, new RectangleF(0, 0, 100, 20), BorderSide.None); brick.LineAlignment = BrickAlignment.Far; brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; }
private static void CustomPrintHeader(GridControl gridControl, PrintableComponentLink print, PrintItem printSetting) { if (printSetting.PrintHeader) { print.CreateMarginalHeaderArea += (sender, e) => { PageInfoBrick _rick = e.Graph.DrawPageInfo(PageInfo.None, printSetting.HeaderText, printSetting.HeaderColor, new RectangleF(0, 0, 200, 20), DevExpress.XtraPrinting.BorderSide.None); _rick.LineAlignment = BrickAlignment.Center; _rick.Alignment = BrickAlignment.Center; _rick.AutoWidth = true; _rick.Font = printSetting.FooterFont; }; } }
private Brick CreateBrick(string format, PageInfo info) { PageInfoBrick brick = new PageInfoBrick(); brick.Format = format; brick.PageInfo = info; brick.Sides = BorderSide.None; if (format.Contains("\n")) brick.Rect = new RectangleF(0, 0, 0, 54); else brick.Rect = new RectangleF(0, 0, 0, 18); brick.Font = new Font("Arial", 10, FontStyle.Bold); // brick.Alignment = BrickAlignment.Center; brick.AutoWidth = true; return brick; }
void link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { string format = "Page(eng) {0} of(eng) {1}"; e.Graph.Font = e.Graph.DefaultFont; e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; }
public static void gridPreviewPaginacao(object sender, CreateAreaEventArgs e) { //https://documentation.devexpress.com/WindowsForms/3244/Controls-and-Libraries/Printing-Exporting/Examples/Using-Printing-Links/How-to-Use-Link-Events-Complete-Sample RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height); //Paginação PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, "Página {0} de {1}", Color.Black, r, BorderSide.None); brick.LineAlignment = BrickAlignment.Far; brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; //Descrição do dia brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Near; brick.AutoWidth = true; }
private void printableComponentLink1_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { PageInfoBrick pib = new PageInfoBrick(); pib.Format = "Page {0}/{1}"; RectangleF r = RectangleF.Empty; r.Height = 20; pib = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, pib.Format, Color.Black, r, BorderSide.None); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, "Print Date " + DateTime.Now.ToShortDateString() + " G.C", Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Far; }
private void link_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e) { string format = "第{0}页 共{1}页"; e.Graph.Font = new Font("微软雅黑", 9); e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 5, 0, e.Graph.Font.Height + 20); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "打印时间:" + DateTime.Today.ToLongDateString(), Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Near; brick.AutoWidth = true; }
private void _PrintableLink_CreatePageFooterArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e) { string format = "当前页:{0} 总页数 {1}"; e.Graph.Font = e.Graph.DefaultFont; e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Far; brick.AutoWidth = true; brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Near; brick.AutoWidth = true; }
/// <summary> /// 添加页眉 /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.XtraPrinting.CreateAreaEventArgs"/> instance containing the event data.</param> private void pcl_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { if (!String.IsNullOrEmpty(reportTitle) && reportTitle.Length > 0) { e.Graph.Font = new Font("宋体", 15, FontStyle.Bold); e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 20, 0, e.Graph.Font.Height + 20); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, reportTitle, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Center; brick.AutoWidth = true; } if (!String.IsNullOrEmpty(condition)) { e.Graph.Font = new Font("宋体", 10); e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 50, 0, e.Graph.Font.Height + 20); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, condition, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Center; brick.AutoWidth = true; } }
private void link_CreateMarginalHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e) { if (mReportName != "") { e.Graph.Font = new Font("微软雅黑", 12, FontStyle.Bold); e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 20, 0, e.Graph.Font.Height + 20); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, mReportName, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Center; //brick.LineAlignment = BrickAlignment.Near; brick.AutoWidth = true; } if (mCondition != "") { e.Graph.Font = new Font("微软雅黑", 9, FontStyle.Bold); e.Graph.BackColor = Color.Transparent; RectangleF r = new RectangleF(0, 50, 0, e.Graph.Font.Height + 20); PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, mCondition, Color.Black, r, BorderSide.None); brick.Alignment = BrickAlignment.Near; brick.AutoWidth = true; } }
private void CreatePageHeader(BrickGraphics gr, string reportName, Image imgTitle, Color c) { gr.BackColor = Color.Transparent; gr.Modifier = BrickModifier.MarginalHeader; gr.Font = new Font("Arial", 16, FontStyle.Bold); RectangleF r = new RectangleF(0, 0, 0, gr.Font.Height); PageTableBrick ptBrick = new PageTableBrick(); TableRow row = new TableRow(); PageImageBrick piBrick = new PageImageBrick(); piBrick.Image = imgTitle; piBrick.Rect = new RectangleF(0, 0, imgTitle.Width, imgTitle.Height); piBrick.Sides = BorderSide.None; piBrick.BackColor = Color.Transparent; row.Bricks.Add(piBrick); ptBrick.Rows.Add(row); row = new TableRow(); PageInfoBrick pinfBrick = new PageInfoBrick(); pinfBrick.Format = reportName; pinfBrick.ForeColor = c; pinfBrick.Rect = r; pinfBrick.Sides = BorderSide.None; row.Bricks.Add(pinfBrick); ptBrick.Rows.Add(row); gr.DrawBrick(ptBrick); ptBrick.UpdateSize(); gr.Font = gr.DefaultFont; pinfBrick = gr.DrawPageInfo(PageInfo.NumberOfTotal, "Page {0} of {1}", Color.Black, r, BorderSide.None); pinfBrick.Alignment = BrickAlignment.Far; pinfBrick.LineAlignment = BrickAlignment.Center; pinfBrick.AutoWidth = true; }
protected override void CreateMarginalFooter(BrickGraphics graph) { base.CreateMarginalFooter(graph); if (_MultiPage._pageNumbering) { //graph.DrawBrick() PageInfoBrick info = new PageInfoBrick(BorderSide.None, 0, Color.White, Color.White, Color.Black); info.Alignment = BrickAlignment.Far; info.Font = _MultiPage._FontForPageNumering; info.Format = "Page {0}"; info.PageInfo = PageInfo.Number; info.Printed = true; info.LineAlignment = BrickAlignment.Near; graph.DrawBrick(info); } }
private static void _Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { if (_dp.BaslikEkle == COMMON.Enums.EvetHayir.Hayir) { return; } var boldFont = new Font("Tahoma", 7, FontStyle.Bold); var regularFont = new Font("Tahoma", 7, FontStyle.Regular); var sayfaBrick = new PageInfoBrick(BorderSide.None, 0, Color.Transparent, Color.Transparent, Color.Black) { Font = regularFont, PageInfo = PageInfo.NumberOfTotal, Format = "Sayfa {0} / {1}", Alignment = BrickAlignment.Far, AutoWidth = true }; _ps.Graph.DrawBrick(sayfaBrick, new RectangleF(200, 25, 40, 15)); var tarihBrick = new PageInfoBrick(BorderSide.None, 0, Color.Transparent, Color.Transparent, Color.Black) { Font = regularFont, PageInfo = PageInfo.DateTime, Format = "Tarih {0:dd.MM.yyyy}", Alignment = BrickAlignment.Far, AutoWidth = true }; _ps.Graph.DrawBrick(tarihBrick, new RectangleF(0, 40, 50, 15)); var subeBaslikBrick = new TextBrick(BorderSide.None, 0, Color.Transparent, Color.Transparent, Color.Black) { Font = boldFont, Text = "Şube" }; _ps.Graph.DrawBrick(subeBaslikBrick, new RectangleF(0, 25, 40, 15)); var subeValueBrick = new TextBrick(BorderSide.None, 0, Color.Transparent, Color.Transparent, Color.Black) { Font = regularFont, Text = $": { _subeAdi}" }; _ps.Graph.DrawBrick(subeValueBrick, new RectangleF(55, 25, 500, 15)); var donemBaslikBrick = new TextBrick(BorderSide.None, 0, Color.Transparent, Color.Transparent, Color.Black) { Font = boldFont, Text = "Dönem" }; _ps.Graph.DrawBrick(donemBaslikBrick, new RectangleF(0, 40, 40, 15)); var donemValueBrick = new TextBrick(BorderSide.None, 0, Color.Transparent, Color.Transparent, Color.Black) { Font = regularFont, Text = $": {AnaForm.DonemAdi}" }; _ps.Graph.DrawBrick(donemValueBrick, new RectangleF(55, 40, 200, 15)); }