当前位置: 首页>>代码示例>>C#>>正文


C# ODGrid.PrintRow方法代码示例

本文整理汇总了C#中OpenDental.UI.ODGrid.PrintRow方法的典型用法代码示例。如果您正苦于以下问题:C# ODGrid.PrintRow方法的具体用法?C# ODGrid.PrintRow怎么用?C# ODGrid.PrintRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenDental.UI.ODGrid的用法示例。


在下文中一共展示了ODGrid.PrintRow方法的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);
			}
开发者ID:mnisl,项目名称:OD,代码行数:63,代码来源:FormSheetDefEdit.cs

示例2: drawFieldGrid

		public static void drawFieldGrid(SheetField field,Sheet sheet,Graphics g,XGraphics gx,Statement stmt=null,MedLab medLab=null) {
			_printMargin.Top=40;
			if(sheet.SheetType==SheetTypeEnum.MedLabResults) {
				_printMargin.Top=120;
			}
			UI.ODGrid odGrid=new UI.ODGrid();//Only used for measurements, also contains printing/drawing logic.
			odGrid.FontForSheets=new Font(field.FontName,field.FontSize,field.FontIsBold?FontStyle.Bold:FontStyle.Regular);
			int _yAdjCurRow=0;//used to adjust for Titles, Headers, Rows, and footers (all considered part of the same row).
			odGrid.Width=0;
			List<DisplayField> Columns=SheetUtil.GetGridColumnsAvailable(field.FieldName);
			foreach(DisplayField Col in Columns) {
				odGrid.Width+=Col.ColumnWidth;
			}
			odGrid.Height=field.Height;
			odGrid.HideScrollBars=true;
			odGrid.YPosField=field.YPos;
			odGrid.Title=field.FieldName;
			if(stmt!=null) {
				odGrid.Title+=(stmt.Intermingled?".Intermingled":".NotIntermingled");//Important for calculating heights.
			}
			odGrid.TopMargin=_printMargin.Top;
			odGrid.BottomMargin=_printMargin.Bottom;
			odGrid.PageHeight=sheet.HeightPage;
			DataTable Table=SheetUtil.GetDataTableForGridType(field.FieldName,stmt,medLab);
			#region  Fill Grid, Set Text Alignment
			odGrid.BeginUpdate();
			odGrid.Columns.Clear();
			ODGridColumn col;
			for(int i=0;i<Columns.Count;i++) {
				col=new ODGridColumn(Columns[i].Description,Columns[i].ColumnWidth);
				switch(field.FieldName+"."+Columns[i].InternalName) {//Unusual switch statement to differentiate similar column names in different grids.
					case "StatementMain.charges":
					case "StatementMain.credits":
					case "StatementMain.balance":
					case "StatementPayPlan.charges":
					case "StatementPayPlan.credits":
					case "StatementPayPlan.balance":
						col.TextAlign=HorizontalAlignment.Right;
						break;
					case "StatementAging.Age00to30":
					case "StatementAging.Age31to60":
					case "StatementAging.Age61to90":
					case "StatementAging.Age90plus":
					case "StatementEnclosed.AmountDue":
					case "StatementEnclosed.DateDue":
						col.TextAlign=HorizontalAlignment.Center;
						break;
					default:
						col.TextAlign=HorizontalAlignment.Left;
						break;
				}
				odGrid.Columns.Add(col);
			}
			ODGridRow row;
			for(int i=0;i<Table.Rows.Count;i++) {
				row=new ODGridRow();
				for(int c=0;c<Columns.Count;c++) {//Selectively fill columns from the dataTable into the odGrid.
					row.Cells.Add(Table.Rows[i][Columns[c].InternalName].ToString());
				}
				if(Table.Columns.Contains("PatNum")) {//Used for statments to determine account splitting.
					row.Tag=Table.Rows[i]["PatNum"].ToString();
				}
				odGrid.Rows.Add(row);
			}
			odGrid.EndUpdate(true);//Calls ComputeRows and ComputeColumns, meaning the RowHeights int[] has been filled.
			#endregion
			for(int i=0;i<odGrid.RowHeights.Length;i++) {
				if(_isPrinting
					&& (odGrid.PrintRows[i].YPos-_printMargin.Top<_yPosPrint //rows at the end of previous page
						|| odGrid.PrintRows[i].YPos-sheet.HeightPage+_printMargin.Bottom>_yPosPrint)) 
				{
					continue;//continue because we do not want to draw rows from other pages.
				}
				_yAdjCurRow=0;
				//if(odGrid.PrintRows[i].YPos<_yPosPrint
				//	|| odGrid.PrintRows[i].YPos-_yPosPrint>sheet.HeightPage) {
				//	continue;//skip rows on previous page and rows on next page.
				//}
				#region Draw Title
				if(odGrid.PrintRows[i].IsTitleRow) {
					switch(field.FieldName) {//Draw titles differently for different grids.
						case "StatementMain":
							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":
//.........这里部分代码省略.........
开发者ID:mnisl,项目名称:OD,代码行数:101,代码来源:SheetPrinting.cs


注:本文中的OpenDental.UI.ODGrid.PrintRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。