唉,现在才发现Delphi是如此的难搞,弄的我想转行,在犹豫之中……。(注:一年DELPHI实战经验) (6分)

  • 主题发起人 主题发起人 small pig
  • 开始时间 开始时间
这个问题是挺麻烦的
 
来自:samboy111, 时间:2004-1-9 10:47:00, ID:2401946
连DELPHI都学起来那么吃力的人,只能学学EXCEL。

EXCEL 对于我 来说 已经很难了。
我一直学不会!! 唉!!!!
 
我给一段“房屋安全鉴定管理系统”绘制表格的代码给你,下载:http://www.softreg.com.cn/shareware_view.asp?id=/950F4034-6E45-4E3B-AFCE-AF42D4CA0BD5/
procedure LineAtInch(DrawCanvas:TCanvas;
X1,Y1,X2,Y2:Real;
PixelsPerInchX,PixelsPerInchY: Integer);
var
Px1,Py1,Px2,Py2:Integer;
begin
try
Px1:=Carry(X1*PixelsPerInchX);
Py1:=Carry(Y1*PixelsPerInchY);
Px2:=Carry(X2*PixelsPerInchX);
Py2:=Carry(Y2*PixelsPerInchY);
DrawCanvas.MoveTo(Px1,Py1);
DrawCanvas.LineTo(Px2,Py2);
except
Application.MessageBox(PChar('画线错误!'), szProgramTitle, MB_OK+MB_ICONWARNING);
end;
end
procedure TextAtInch(DrawCanvas:TCanvas;X1,Y1,X2,Y2:Real;const Str:String;
PixelsPerInchX,PixelsPerInchY: Integer;
Alignment:Alignment);
var
Px,Py:Integer;
DrawRect: TRect;
widths:array[0..255] of Integer;
begin
try
px:=0;
case Alignment of
taLeft:
Px:=Round(X1*PixelsPerInchX);
taCenter:
Px:=Round((X1+(X2-X1-GetStrWidthInch(DrawCanvas, str, PixelsPerInchX, PixelsPerInchY))/2)*PixelsPerInchX);
taRight:
Px:=Round((X1+X2-X1-GetStrWidthInch(DrawCanvas, str, PixelsPerInchX,PixelsPerInchY))*PixelsPerInchX);
end;
Py:=trunc((Y1+(Y2-Y1-GetStrHeightInch(DrawCanvas, str, PixelsPerInchX,PixelsPerInchY))/2)*PixelsPerInchY);
DrawCanvas.TextOut(Px,Py,Str);
except
Application.MessageBox(PChar('绘制文本错误!'), szProgramTitle, MB_OK+MB_ICONWARNING);
end;
end;

procedure DrawTabPage(hDC: THandle;
Canvas:TCanvas;
PageWidth,PageHeight:Real;
LeftMargin, TopMargin, RightMargin, BottomMargin: Real;
Previewing:Boolean;
PixelsPerInchX,PixelsPerInchY:Integer);
var
i,j : Integer;
StrRect: TExtRect;
//文本框
iCellColNumber: Integer;
iCellColWidth1: array[0..5] of Integer;
iCellColWidth2: array[0..3] of Integer;
iCellRowHeight: array[0..5] of Integer;
iCellTotalWidth : Integer;
CellRectTop_tmp, CellRectBottom_tmp: Real;
CellRect: TExtRect;
//单元格框
CellHeadTop1,CellHeadTop2, CellHeadBottom1, CellHeadBottom2: Real;
function InteriorLineWidth(Previewing: Boolean): Integer;
//里边线宽
begin
if Previewing then
Result:=1
else
Result:=3;
end;

function ExteriorLineWidth(Previewing: Boolean): Integer;
//外边线宽
begin
if Previewing then
Result:=3
else
Result:=9;
end;
begin
Canvas.Pen.Color:=clBlack;
iTabFontSize:=10;
iCellColWidth2[0]:=18;
iCellColWidth2[1]:= nClientWidth;
iCellColWidth2[2]:=24;
iCellColWidth2[3]:=iCellColWidth2[1];
iCellTotalWidth := 0;
for i:=0 to 3do
iCellTotalWidth:=iCellTotalWidth + iCellColWidth2;
//iCellTotalWidth:=110;

iCellColWidth1[0]:=iCellColWidth2[0];
iCellColWidth1[1]:=iCellColWidth2[1];
iCellColWidth1[2]:=11;
iCellColWidth1[3]:=nPhoneWidth;
iCellColWidth1[4]:=iCellColWidth2[0];
iCellColWidth1[5] := iCellTotalWidth;
for i:=0 to 4do
iCellColWidth1[5]:= iCellColWidth1[5] - iCellColWidth1;
iCellRowHeight[0] := 5;
iCellRowHeight[1] := nApprCircsRowCount;
//鉴定情况框高
iCellRowHeight[2] := nShatterReasonRowCount;
//损坏原因分析
iCellRowHeight[3] := nApprConclusionRowCount;
//鉴定结论
iCellRowHeight[4] := nDisposalAdviRowCount;
//处理建议
iCellRowHeight[5] := 4;
//一、委托单位/个人情况
CellRect.Top:=TopMargin+iTabTitleHeight*InchPerMM;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
{
Application.MessageBox(PChar(floattostr(iCellTotalWidth)), szProgramTitle, MB_OK+MB_ICONWARNING);
Application.MessageBox(PChar(floattostr(CellRect.Left)), szProgramTitle, MB_OK+MB_ICONWARNING);
Application.MessageBox(PChar(Inttostr(iCellTotalWidth)), szProgramTitle, MB_OK+MB_ICONWARNING);
}
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='一、委托单位/个人情况';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
CellRect.Right:=LeftMargin;
for i:=0 to 5do
begin
CellRect.Left:=CellRect.Right;
CellRect.Right:= CellRect.Left+iCellColWidth1*InchPerMM;
Canvas.Pen.Color:=clBlack;
if i = 0 then
Canvas.Pen.Width := ExteriorLineWidth(Previewing)
else
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
if i = 5 then
Canvas.Pen.Width := ExteriorLineWidth(Previewing)
else
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
case i of
0:
strText:='委 托 人';
1:
strText:=TabList[1];
2:
strText:= '电话';
3:
strText:= TabList[2];
4:
strText:= '委托日期';
5:
strText:= TabList[3];
end;
if i=1 then
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft)
else
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taCenter);
end;

//二、房屋情况
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='二、房屋情况';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
for i:=0 to 4do
begin
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
CellRect.Right := LeftMargin;
for j:=0 to 3do
begin
CellRect.Left:= CellRect.Right;
CellRect.Right:= CellRect.Left+iCellColWidth2[j]*InchPerMM;
Canvas.Pen.Color:=clBlack;
if j = 0 then
Canvas.Pen.Width := ExteriorLineWidth(Previewing)
else
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
if j = 3 then
Canvas.Pen.Width := ExteriorLineWidth(Previewing)
else
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
case i of
0:
case j of
0:
strText:='房屋地址';
1:
strText:=TabList[4];
2:
strText:='产 权 人';
3:
strText:=TabList[5];
end;
1:
case j of
0:
strText:='房屋用途';
1:
strText:=TabList[6];
2:
strText:='建造年份';
3:
strText:=TabList[7];
end;
2:
case j of
0:
strText:='结构类型';
1:
strText:=TabList[8];
2:
strText:='建筑面积';
3:
strText:=TabList[9];
end;
3:
case j of
0:
strText:='平面形式';
1:
strText:=TabList[10];
2:
strText:='层 数';
3:
strText:=TabList[11];
end;
4:
case j of
0:
strText:='产权性质';
1:
strText:=TabList[12];
2:
strText:='产权证编号';
3:
strText:=TabList[13];
end;
end;
if i=0 then
if (j=1) or (j=3) then
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft)
else
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taCenter)
else
if (i=2) and (j =3) then
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,(strText+'㎡'),PixelsPerInchX,PixelsPerInchY, taCenter)
else
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taCenter);
end;
end;

//备注
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellColWidth2[0]*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='备 注';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '宋体', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taCenter);
CellRect.Left:=CellRect.Right;
for i:=1 to 3do
CellRect.Right := CellRect.Right+ iCellColWidth2*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
strText:=TabList[14];
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '宋体', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//三、房屋鉴定目的
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='三、房屋安全鉴定目的:'+TabList[15];
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//四、鉴定情况
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='四、鉴定情况:';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
//SetFontEx(hDC, Canvas, Canvas. iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
//DrawTextAtInch(hDC, strRect.Left ,strRect.Top, strRect.right, strRect.Bottom, strText,PixelsPerInchX,PixelsPerInchY, DT_Left);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//TextAtInchEx(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
MattersList := TStringList.Create;
MattersList.Clear;
wrap_lineExEx(TabList[16], nRowMaxCharCount, MattersList);
CellRectTop_tmp:=CellRect.Top;
for i:=1 to MattersList.Countdo
begin
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+(iCellRowHeight[0]-1)*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
strText:=MattersList[i-1];
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
//SetFont(hDC, Canvas, '宋体', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
//DrawTextAtInch(hDC, strRect.Left, strRect.top, strRect.Right, strRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, DT_EXPANDTABS or DT_WORDBREAK);
TextAtInchEx(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//TextAtInchExt(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY);
end;
CellRect.Bottom:= CellRectTop_tmp+(iCellRowHeight[1]-1)*InchPerMM;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRectTop_tmp, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRectTop_tmp, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//五、损坏原因分析
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='五、损坏原因分析:';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
MattersList := TStringList.Create;
MattersList.Clear;
wrap_lineExEx(TabList[17], nRowMaxCharCount, MattersList);
CellRectTop_tmp:=CellRect.Top;
for i:=1 to MattersList.Countdo
begin
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+(iCellRowHeight[0]-1)*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
strText:=MattersList[i-1];
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '宋体', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
//TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
TextAtInchEx(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
end;
CellRect.Bottom:= CellRectTop_tmp+(iCellRowHeight[2]-1)*InchPerMM;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRectTop_tmp, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRectTop_tmp, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
{
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
}
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//六、鉴定结论
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='六、鉴定结论:';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
MattersList := TStringList.Create;
MattersList.Clear;
wrap_lineExEx(TabList[18], nRowMaxCharCount, MattersList);
CellRectTop_tmp:=CellRect.Top;
for i:=1 to MattersList.Countdo
begin
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+(iCellRowHeight[0]-1)*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
strText:=MattersList[i-1];
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
//SetFont(hDC, Canvas, '宋体', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
//TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
TextAtInchEx(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
end;
CellRect.Bottom:= CellRectTop_tmp+(iCellRowHeight[3]-1)*InchPerMM;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRectTop_tmp, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRectTop_tmp, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//七、处理建议
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
strText:='七、处理建议:';
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
MattersList := TStringList.Create;
MattersList.Clear;
wrap_lineExEx(TabList[19], nRowMaxCharCount, MattersList);
CellRectTop_tmp:=CellRect.Top;
for i:=1 to MattersList.Countdo
begin
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+(iCellRowHeight[0]-1)*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
strText:=MattersList[i-1];
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
//SetFont(hDC, Canvas, '宋体', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
//TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
TextAtInchEx(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
end;
CellRect.Bottom:= CellRectTop_tmp+(iCellRowHeight[3]-1)*InchPerMM;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRectTop_tmp, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRectTop_tmp, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//八、检测鉴定人员:
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := InteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
strText:='八、检测鉴定人员:'+(MainForm.ActiveMDIChild as TfrmChildWin).labedtAppraiser1.Text;
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//九、鉴定单位技术负责人签章
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
strText:='九、鉴定单位技术负责人签章:';
SetFont(hDC, Canvas, '黑体', [fsBold], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//'九、鉴定单位技术负责人签章'
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[5]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//鉴定人
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
if fCovPrnSelAppraisor=1 then
strText:='鉴定人:'+(MainForm.ActiveMDIChild as TfrmChildWin).labedtAppraiser.Text
else
strText:='鉴定人:';
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
//'九、鉴定单位技术负责人签章'
strText1:= '鉴定单位(公章):'+(MainForm.ActiveMDIChild as TfrmChildWin).labedtApprUnit.Text;
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left + 90*InchPerMM,StrRect.Top,StrRect.Right,StrRect.Bottom,strText1,PixelsPerInchX,PixelsPerInchY, taLeft);
//鉴定单位
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[5]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//审核人
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
if fCovPrnSelAssessor=1 then
strText:='审核人:'+(MainForm.ActiveMDIChild as TfrmChildWin).labedtAssessor.Text
else
strText:='审核人:';
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
strText:='鉴定日期:'+FormatDateTime('yyyy"年"m"月"d"日"',(MainForm.ActiveMDIChild as TfrmChildWin).dtpickApprDate.Date);
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left + 90*InchPerMM,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[5]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
//审定人
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[0]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
//LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
StrRect.Left:=CellRect.Left+1*InchPerMM;
StrRect.Right:=CellRect.Right-1*InchPerMM;
StrRect.Top:=CellRect.Top+1*InchPerMM;
StrRect.Bottom:=CellRect.Bottom-0.5*InchPerMM;
if fCovPrnSelAuthorizedMan=1 then
strText:='审定人:'+(MainForm.ActiveMDIChild as TfrmChildWin).labedtAuthorizedMan.Text
else
strText:='审定人:';
SetFont(hDC, Canvas, 'Times New Roman', [], iTabFontSize, Previewing, PixelsPerInchX,PixelsPerInchY);
TextAtInch(Canvas, StrRect.Left,StrRect.Top,StrRect.Right,StrRect.Bottom,strText,PixelsPerInchX,PixelsPerInchY, taLeft);
CellRect.Top:= CellRect.Bottom;
CellRect.Bottom:= CellRect.top+iCellRowHeight[5]*InchPerMM;
CellRect.Left:=LeftMargin;
CellRect.Right := CellRect.Left+ iCellTotalWidth*InchPerMM;
Canvas.Pen.Color:=clBlack;
Canvas.Pen.Width := ExteriorLineWidth(Previewing);
LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Left, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//左线
//LineAtInch(Canvas, CellRect.Left, CellRect.Top, CellRect.Right, CellRect.Top, PixelsPerInchX, PixelsPerInchY);
//上线
LineAtInch(Canvas, CellRect.Right, CellRect.Top, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//右线
LineAtInch(Canvas, CellRect.Left, CellRect.Bottom, CellRect.Right, CellRect.Bottom, PixelsPerInchX, PixelsPerInchY);
//下线
// Image1.Picture.Bitmap.HandleType:=bmDIB;
// Image1.Picture.SaveToFile(MainDir+'/'+IntToStr(iPageNumber)+'.bmp');
// SaveTempFile(iPageNumber);
end;

虽然代码有点烂,但请你慢慢研究吧

 
楼上真是热心人啊!
其实大家都是来学习的,有能力的就帮帮,
没能力的也不要说些过份的话啊。
 
我的建议是有了问题,不能光靠提问来解决,应该自己在网上多去寻找些资料。
 
反正我有很多报表都是用canvas画出来的。
 
接受答案了.
 
后退
顶部