Devexpress Printablecomponentlink



1. 가로 스크롤 보이기

3.On ChartControl,Click on Add Project Data Source Database Microsoft Access Database File Choose gsp.mdb from DevExpress Demos 15.1 Components Data gsp.mdb 4.click Next to save the Connection String and Select GSP table. 5.In properties,Go to DataSeriesdatamember, set it to:year SeriestemplatesArgumentDataMember,set it to:region. C# (CSharp) DevExpress.XtraPrinting PrintableComponentLink - 6 examples found. These are the top rated real world C# (CSharp) examples of DevExpress.XtraPrinting.PrintableComponentLink extracted from open source projects. You can rate examples to help us improve the quality of examples.

Imports DevExpress.XtraPrinting. The code below demonstrates how to a create a report with DevExpress Gridcontrol. Generate the Report Header, Set the Paper Format, and Add Custom Information to the Report at runtime using XtraPrinting library. Let us assume that the name of the gridcontrol is “myGridControl” ' Create a PrintingSystem. DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, Delphi, HTML5 or iOS & Android development. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

gridView1.OptionsView.ColumnAutoWidth = false;

Devexpress Printablecomponentlink Example

gridView1 .HorzScrollVisibiity = Auto or Always

2. 프린터에서 필요없는 Footer 없애기

gridView1.OptionsPrint.PrintFooter = false;

3. 컬럼헤더 중앙정렬

gridview1 -> Column Properties -> Apperance Header -> TextOptions -> HAlignment = Center

4. 간단한 프린트 클래스 설정

using System;
using System.Collections.Generic;
using System.Text;
using DevExpress.XtraPrinting;
using System.Drawing;

namespace Test

{
class clsReport
{
string strTitle;
string _subContent=';
float _subHeight = 20;

System.Drawing.Printing.PaperKind PaperKind;

public string subContent { get { return _subContent; } set { _subContent = value; } }

#region Print with Title
// using DevExpress.XtraPrinting;

public void Print(DevExpress.XtraPrinting.IPrintable pGrid, string pTitle, System.Drawing.Printing.PaperKind pPaperKind, bool pLandscape)
{
Print(pGrid, pTitle, pPaperKind, pLandscape, 20);
}

public void Print(DevExpress.XtraPrinting.IPrintable pGrid, string pTitle, System.Drawing.Printing.PaperKind pPaperKind, bool pLandscape, float subHeight)
{
strTitle = pTitle;
PaperKind = pPaperKind;
_subHeight = subHeight;
PrintableComponentLink link = new PrintableComponentLink(new PrintingSystem());
link.PaperKind = PaperKind;
link.Landscape = pLandscape;
link.Margins.Top = 100;
link.Margins.Bottom = 60;
link.Margins.Left = 50;
link.Margins.Right = 50;
link.Component = pGrid;
link.CreateMarginalHeaderArea += new CreateAreaEventHandler(Link_CreateMarginalHeaderArea);
link.CreateMarginalFooterArea += new CreateAreaEventHandler(Link_CreateMarginalFooterArea);
link.CreateDocument();
link.ShowPreview();
//link.ShowRibbonPreview(DevExpress.LookAndFeel.UserLookAndFeel.Default);
}

Devexpress Printablecomponentlink Component

Devexpress


private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e)
{
PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.None, strTitle, Color.DarkBlue, new RectangleF(0, 0, 110, 50), BorderSide.None);
brick.LineAlignment = BrickAlignment.Center;
brick.Font = new Font('굴림체', 18);
brick.Alignment = BrickAlignment.Center;
brick.AutoWidth = true;

PageInfoBrick Lbrick = e.Graph.DrawPageInfo(PageInfo.DateTime, ', Color.DarkBlue, new RectangleF(0, 0, 100, 20), BorderSide.None);
Lbrick.LineAlignment = BrickAlignment.Far;
Lbrick.Font = new Font('굴림체', 9);
Lbrick.Alignment = BrickAlignment.Far;
Lbrick.AutoWidth = true;

Devexpress

if (_subContent != ')
{
PageInfoBrick Sbrick = e.Graph.DrawPageInfo(PageInfo.DateTime, _subContent, Color.DarkBlue, new RectangleF(0, 0, 100, _subHeight), BorderSide.None);
Sbrick.LineAlignment = BrickAlignment.Far;
Sbrick.Font = new Font('굴림체', 9);
Sbrick.Alignment = BrickAlignment.Near;
Sbrick.AutoWidth = true;
}

Devexpress Printablecomponentlink Fit To Page


}

Devexpress Printablecomponentlink Margins

private void Link_CreateMarginalFooterArea(object sender, CreateAreaEventArgs e)
{
PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.None, CUser.Company, Color.DarkBlue, new RectangleF(0, 0, 100, 20), BorderSide.None);
brick.LineAlignment = BrickAlignment.Near;
brick.Font = new Font('굴림체', 9);
brick.Alignment = BrickAlignment.Center;
brick.AutoWidth = true;

PageInfoBrick Lbrick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, ', Color.DarkBlue, new RectangleF(0, 0, 100, 20), BorderSide.None);
Lbrick.LineAlignment = BrickAlignment.Near;
Lbrick.Font = new Font('굴림체', 9);
Lbrick.Alignment = BrickAlignment.Far;
Lbrick.AutoWidth = true;
}
#endregion

}
}

※ 클래스 호출

clsReport cReport = new clsReport();
cReport.subContent = '조회조건 : ' + dtpFrom.Value.ToString('yyyy-MM-dd') ;
cReport.Print(gridControl2, '보고서', System.Drawing.Printing.PaperKind.A4, true);