這個報表問題問了好久都沒有解決,是問題太難還是高手不在 ? (100分)

  • 主题发起人 主题发起人 weifang
  • 开始时间 开始时间
W

weifang

Unregistered / Unconfirmed
GUEST, unregistred user!
用delphi6自帶的QuickRep做報表。怎樣讓QRShape的高度隨著DetailBand高度的變化而變化?(使用QRDBText自動換行時,QRShape高度也要跟著變化)
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=620364
QuickReport里中文折行的解决办法,请初学者关注!
 
方法一 。用 DetailBand 的frame ;
如果想保留空间,不要到边到岸的效果,情使用
方法二 QuickReport 的 onpreview 事件 用代码调整大小
 
app2001
你看錯問題啦,不是換行問題。是換行後QRShape的高度變化問題。
zhbj
在onpreview 中根本就不行的
 
用 rb7.03 的话可以完美的解决这个问题。
 
TO:笑冲天
rb7.03不會用,我是用delphi自帶的QuickRep。
 
一个锁了门的房子我们要进去,是不是非的挖个洞来钻进钻出,而不用钥匙开门直接进去呢?
 
//报表换行控制
function AdjustQRDBText(Canvas:TCanvas;QRBand:TQRBand;QRDBText:TQRDBText;var BandHeight:Integer;var Value:string):string;
var
strValue,strTmp:Widestring;
i,intValue:integer;
iTextWidth,iQRDBTextWidth:integer;
iLines,iLineZiCount:Integer;
iSlgZIHeight,iSlgZIWidth:Integer;
iTmpBandHeight,intPos:Integer;
begin
iSlgZIHeight:=Canvas.TextHeight('我');
//得到单个字的高度
iSlgZIWidth:=Canvas.TextWidth('我');
//得到单个字的宽度
strValue:=Trim(WideString(value));
intValue:=Length(strValue);
//得到输入文本的字数
iTextWidth:=Canvas.TextWidth(strValue);
//输入的文本宽度
iQRDBTextWidth:=QRDBText.Width;
//文本框的宽度,去除两边的宽度
iLineZiCount:=iQRDBTextWidth div iSlgZIWidth;
//得到每一行的字数
iLines:=intValue div iLineZiCount+1;
//计算文本的行数
strTmp:='';
intPos:=1;
for I:=0 to iLines-1do
begin
//LineCount:=
if I<iLines-1 then
strTmp:=strTmp+Copy(strValue,intPos,iLineZiCount)+#10#13
else
strTmp:=strTmp+Copy(strValue,intPos,iLineZiCount);
intPos:=intPos+iLineZiCount;
end;
value:=strTmp;

QRDBText.top:=5;
QRDBText.Height:=iLines*iSlgZiHeight;
//得到文本框的高度
iTmpBandHeight:=iSlgZiHeight*(iLines+1);
//此处BAND的计算高度
if QRBand.Height<iTmpBandHeight then
QRBand.Height:=iTmpBandHeight;
for I:=0 to QRBand.ControlCount-1do
begin
if QRBand.Controls is TQRShape then
if TQRShape(QRBand.Controls).Shape=qrsVertLine then
begin
TQRShape(QRBand.Controls).Height:=QRBand.Height;
TQRShape(QRBand.Controls).Top:=0;
end;
end;
end;
 
TO:onlyonekgx
你這個函數怎麼用?在那裡調用?
 
procedure TForm1.DetailBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
QRShape1.Height := Sender.Height;
end;
 
jackchin
QRShape1.Height := Sender.Height;不行,產生很多的多於線. 你測試一下。
 
在 DBTEXT 的 BeforePrint 事件中调用
 
TO:onlyonekgx
在 DBTEXT 的 BeforePrint 事件中调用具體怎麼寫呀? 另外QRDBtext中也沒有BeforePrint 事件,只有一個onprint事件。
請給一個調用示例。
 
我给一段“房屋安全鉴定管理系统”绘制表格的代码给你,下载: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;

虽然代码有点烂,但请你慢慢研究吧
 
ChaseSun
兄弟,你貼的代碼太長啦,我看的都頭疼。
我只是想要一段簡單的能馬上解決問題的代碼!
 
供参考:
http://www.delphibbs.com/delphibbs/dispq.asp?LID=330346
http://www.delphibbs.com/delphibbs/dispq.asp?lid=429094
 
liuly版主
您好! 謝謝您的幫助!
http://www.delphibbs.com/delphibbs/dispq.asp?LID=330346該貼的得分是Another_eYes富翁。但是該富翁的以下代碼確在delphi6.0中通不過。
来自:Another_eYes, 时间:2000-9-27 23:44:00, ID:351402
Type
TMyQRShape = class(TQRShape)
published
Align;
end;
加在定义部分(只要在你调用之前就可以了).
TMyQRShape(QRShape1).Align := alLeftJustify;
// or RightJustify
加在BeforePrint事件里(有十个shape最简单的就是写10遍呗).

請問怎麼解決?
我的換行是參考您的http://www.delphibbs.com/delphibbs/dispq.asp?lid=620364貼子,但是這個裡面確沒有解決QRShape的高度變化問題!
該怎麼解決呢? 急需您的幫助!
 
看看330346中我的回答,应该能解决问题,只是不很专业,可以应应急。
429094中dq对此问题进行了初步的探讨和解决,还不够完善,你可以参考参考。
good luck!
 
liuly版主
您在330346中的回答。我測試了。通不過。提示錯誤:undeclared identifier:'hhh'
我是用delphi6.0的.
您能不能整理一下這個問題的完美解決方案, 就像您的620364的帖子一樣。
另外您覺得Another_eYes的貼子是否可以解決這個問題。不過我用delphi6.0也通不過。
来自:Another_eYes, 时间:2000-9-27 23:44:00, ID:351402
Type
TMyQRShape = class(TQRShape)
published
Align;
end;
加在定义部分(只要在你调用之前就可以了).
TMyQRShape(QRShape1).Align := alLeftJustify;
// or RightJustify
加在BeforePrint事件里(有十个shape最简单的就是写10遍呗).

謝謝
 
发现一个问题,凡是做打印的都是民工干的活……从楼上那个兄弟贴的代码看来,不仅仅只有我在干这种活儿,还有很多人都在这样,心里平衡ing……
 
后退
顶部