本文整理汇总了C#中OpenDental.UI.ODGrid.PrintHeader方法的典型用法代码示例。如果您正苦于以下问题:C# ODGrid.PrintHeader方法的具体用法?C# ODGrid.PrintHeader怎么用?C# ODGrid.PrintHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenDental.UI.ODGrid
的用法示例。
在下文中一共展示了ODGrid.PrintHeader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawGridHelper
private void DrawGridHelper(Graphics g,int i) {
if(listFields.SelectedIndices.Contains(i)) {
_argsDF.pen=_argsDF.penRed;
_argsDF.brush=_argsDF.brushRed;
}
else {
_argsDF.pen=_argsDF.penBlack;
_argsDF.brush=_argsDF.brushBlue;
}
List<DisplayField> Columns=SheetUtil.GetGridColumnsAvailable(SheetDefCur.SheetFieldDefs[i].FieldName);
//fGrid.Columns=SheetGridDefs.GetColumnsAvailable(fGrid.GridType);
ODGrid odGrid=new ODGrid();
odGrid.Width=0;
for(int c=0;c<Columns.Count;c++){
odGrid.Width+=Columns[c].ColumnWidth;
}
odGrid.HideScrollBars=true;
#region Fill Grid
odGrid.BeginUpdate();
odGrid.Columns.Clear();
ODGridColumn col;
for(int c=0;c<Columns.Count;c++) {
col=new ODGridColumn(Columns[c].Description,Columns[c].ColumnWidth);
odGrid.Columns.Add(col);
}
ODGridRow row=new ODGridRow();//Add dummy row
for(int c=0;c<Columns.Count;c++) {
row.Cells.Add(" ");//add dummy row.
}
odGrid.Rows.Add(row);
odGrid.EndUpdate();//Calls ComputeRows and ComputeColumns, meaning the RowHeights int[] has been filled.
#endregion
int yPosGrid=SheetDefCur.SheetFieldDefs[i].YPos;
if(SheetDefCur.SheetFieldDefs[i].FieldName=="StatementPayPlan") {
SizeF sSize=g.MeasureString("Payment Plans",new Font(FontFamily.GenericSansSerif,10,FontStyle.Bold));
g.FillRectangle(Brushes.White,SheetDefCur.SheetFieldDefs[i].XPos,yPosGrid,odGrid.Width,odGrid.TitleHeight);
g.DrawString("Payment Plans",new Font(FontFamily.GenericSansSerif,10,FontStyle.Bold),new SolidBrush(Color.Black),SheetDefCur.SheetFieldDefs[i].XPos+(SheetDefCur.SheetFieldDefs[i].Width-sSize.Width)/2,yPosGrid);
yPosGrid+=odGrid.TitleHeight;
}
odGrid.PrintHeader(g,SheetDefCur.SheetFieldDefs[i].XPos,yPosGrid);
yPosGrid+=odGrid.HeaderHeight;
odGrid.PrintRow(0,g,SheetDefCur.SheetFieldDefs[i].XPos,yPosGrid,false,true);//a single dummy row.
yPosGrid+=odGrid.RowHeights[0]+2;
#region drawFooter
if(SheetDefCur.SheetFieldDefs[i].FieldName=="StatementPayPlan") {
RectangleF rf=new RectangleF(SheetDefCur.Width-SheetDefCur.SheetFieldDefs[i].Width-60,yPosGrid,SheetDefCur.SheetFieldDefs[i].Width,odGrid.TitleHeight);
g.FillRectangle(Brushes.White,rf);
StringFormat sf=new StringFormat();
sf.Alignment=StringAlignment.Far;
g.DrawString("Payment Plan Amount Due: "+"0.00",new Font(FontFamily.GenericSansSerif,10,FontStyle.Bold),new SolidBrush(Color.Black),rf,sf);
}
#endregion
if(listFields.SelectedIndices.Contains(i)) {
g.DrawRectangle(_argsDF.penRedThick,
SheetDefCur.SheetFieldDefs[i].XPos,
SheetDefCur.SheetFieldDefs[i].YPos,
SheetDefCur.SheetFieldDefs[i].Width,
SheetDefCur.SheetFieldDefs[i].Height);
}
//g.DrawRectangle(_argsDF.pen,SheetDefCur.SheetFieldDefs[i].XPos,SheetDefCur.SheetFieldDefs[i].YPos,
// SheetDefCur.SheetFieldDefs[i].Width,SheetDefCur.SheetFieldDefs[i].Height);
//g.DrawString("Grid:"+SheetGridDefs.GetName(SheetDefCur.SheetFieldDefs[i].GridDef),Font,_argsDF.brush,SheetDefCur.SheetFieldDefs[i].XPos,SheetDefCur.SheetFieldDefs[i].YPos);
}
示例2: drawFieldGrid
//.........这里部分代码省略.........
Patient pat=Patients.GetPat(PIn.Long(Table.Rows[i]["PatNum"].ToString()));
string patName="";
if(pat!=null) {//should always be true
patName=pat.GetNameFLnoPref();
}
if(gx==null) {
g.FillRectangle(Brushes.White,field.XPos-10,odGrid.PrintRows[i].YPos-_yPosPrint,odGrid.Width,odGrid.TitleHeight);
g.DrawString(patName,new Font("Arial",10,FontStyle.Bold),new SolidBrush(Color.Black),field.XPos-10,odGrid.PrintRows[i].YPos-_yPosPrint);
}
else {
gx.DrawRectangle(Brushes.White,p(field.XPos-10),p(odGrid.PrintRows[i].YPos-_yPosPrint-1),p(odGrid.Width),p(odGrid.TitleHeight));
using(Font _font=new Font("Arial",10,FontStyle.Bold)) {
GraphicsHelper.DrawStringX(gx,Graphics.FromImage(new Bitmap(100,100)),(double)((1d)/p(1)),patName,new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),XBrushes.Black,new XRect(p(field.XPos-10),p(odGrid.PrintRows[i].YPos-_yPosPrint-1),p(300),p(100)),XStringAlignment.Near);
//gx.DrawString(patName,new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),new SolidBrush(Color.Black),field.XPos-10,yPosGrid);
}
}
break;
case "StatementPayPlan":
SizeF sSize=new SizeF();
using(Graphics f= Graphics.FromImage(new Bitmap(100,100))) {//using graphics f because g is null when gx is not.
sSize=f.MeasureString("Payment Plans",new Font("Arial",10,FontStyle.Bold));
}
if(gx==null) {
g.FillRectangle(Brushes.White,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint,odGrid.Width,odGrid.TitleHeight);
g.DrawString("Payment Plans",new Font("Arial",10,FontStyle.Bold),new SolidBrush(Color.Black),field.XPos+(field.Width-sSize.Width)/2,odGrid.PrintRows[i].YPos-_yPosPrint);
}
else {
gx.DrawRectangle(Brushes.White,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint-1,odGrid.Width,odGrid.TitleHeight);
using(Font _font=new Font("Arial",10,FontStyle.Bold)) {
GraphicsHelper.DrawStringX(gx,Graphics.FromImage(new Bitmap(100,100)),(double)((1d)/p(1)),"Payment Plans",new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),XBrushes.Black,new XRect(p(field.XPos+field.Width/2),p(odGrid.PrintRows[i].YPos-_yPosPrint-1),p(300),p(100)),XStringAlignment.Center);
//gx.DrawString("Payment Plans",new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),new SolidBrush(Color.Black),field.XPos+(field.Width-sSize.Width)/2,yPosGrid);
}
}
break;
default:
if(gx==null) {
odGrid.PrintTitle(g,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint);
}
else {
odGrid.PrintTitleX(gx,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint);
}
break;
}
_yAdjCurRow+=odGrid.TitleHeight;
}
#endregion
#region Draw Header
if(odGrid.PrintRows[i].IsHeaderRow) {
if(gx==null) {
odGrid.PrintHeader(g,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow);
}
else {
odGrid.PrintHeaderX(gx,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow);
}
_yAdjCurRow+=odGrid.HeaderHeight;
}
#endregion
#region Draw Row
if(gx==null) {
odGrid.PrintRow(i,g,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow,odGrid.PrintRows[i].IsBottomRow,true);
}
else {
odGrid.PrintRowX(i,gx,field.XPos,odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow,odGrid.PrintRows[i].IsBottomRow,true);
}
_yAdjCurRow+=odGrid.RowHeights[i];
#endregion
#region Draw Footer (rare)
if(odGrid.PrintRows[i].IsFooterRow) {
_yAdjCurRow+=2;
switch(field.FieldName) {
case "StatementPayPlan":
DataTable tableMisc=AccountModules.GetStatementDataSet(stmt).Tables["misc"];
if(tableMisc==null) {
tableMisc=new DataTable();
}
Double payPlanDue=0;
for(int m=0;m<tableMisc.Rows.Count;m++) {
if(tableMisc.Rows[m]["descript"].ToString()=="payPlanDue") {
payPlanDue=PIn.Double(tableMisc.Rows[m]["value"].ToString());
}
}
if(gx==null) {
RectangleF rf=new RectangleF(sheet.Width-60-field.Width,odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow,field.Width,odGrid.TitleHeight);
g.FillRectangle(Brushes.White,rf);
StringFormat sf=new StringFormat();
sf.Alignment=StringAlignment.Far;
g.DrawString("Payment Plan Amount Due: "+payPlanDue.ToString("c"),new Font("Arial",9,FontStyle.Bold),new SolidBrush(Color.Black),rf,sf);
}
else {
gx.DrawRectangle(Brushes.White,p(sheet.Width-field.Width-60),p(odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow),p(field.Width),p(odGrid.TitleHeight));
using(Font _font=new Font("Arial",9,FontStyle.Bold)) {
GraphicsHelper.DrawStringX(gx,Graphics.FromImage(new Bitmap(100,100)),(double)((1d)/p(1)),"Payment Plan Amount Due: "+payPlanDue.ToString("c"),new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),XBrushes.Black,new XRect(p(sheet.Width-60),p(odGrid.PrintRows[i].YPos-_yPosPrint+_yAdjCurRow),p(field.Width),p(odGrid.TitleHeight)),XStringAlignment.Far);
}
}
break;
}
}
#endregion
}
}