T
TENTODBV
Unregistered / Unconfirmed
GUEST, unregistred user!
哥哥让我帮他写个足彩投注单打印程序。数据源是文本文件,每行一个单注
3101030300310
3333111100003
3333333333333
1111111111111
0000000000000
......
生成的投注单不是直接打印文本,而是根据文本打印图形。投注单是这样的:每单有5栏,每栏有13行3列共39个打印位置。投注单纵向送入打印机,打印机根据每注的13场的结果而涂黑相应位置,就像标准化答题卡那样。每页打印5注。
我的实现方法是这样的:在QReport报表加入39个QRShape控件,分布位置见下图。把投注文本导入ADOQuery1中,然后打印ADOQuery1中的数据。需要涂黑的位置用类似这样的代码实现涂黑:QRShape1.Pen.Color:=clBlack;
实际的投注单的涂黑位置是像标准化答题卡那样细长形的,所以只能用图形形式打印,而不能用我下面给出的示例那样用全角字符■□来表示。实际打印时只需要打印涂黑位置即可,我为了说明问题而加注的1-13,1-3得数字和第X栏的文字不用打印。
-----------------------------
13121110 9 8 7 6 5 4 3 2 1 QReport报表控件摆放位置示意图
□□■□□■□■□□□□■ 3 QRShape13 QRShape12 ... QRShape1
□■□□□□□□□■□■□ 1 第一栏 QRShape26 QRShape25 ... QRShape14
■□□■■□■□■□■□□ 0 QRShape39 QRShape38 ... QRShape27
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
■□□□□□□□□■■■■ 3
□□□□□■■■■□□□□ 1 第二栏
□■■■■□□□□□□□□ 0
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
■■■■■■■■■■■■■ 3
□□□□□□□□□□□□□ 1 第三栏
□□□□□□□□□□□□□ 0
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
□□□□□□□□□□□□□ 3
■■■■■■■■■■■■■ 1 第四栏
□□□□□□□□□□□□□ 0
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
□□□□□□□□□□□□□ 3
□□□□□□□□□□□□□ 1 第五栏
■■■■■■■■■■■■■ 0
-----------------------------
我的程序代码如下:
程序存在一个重大错误:打印出来的投注单每注都是数据集中的最后一注。请问代码错在哪?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Button1: TButton;
RichEdit1: TRichEdit;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
SL1:TStringList;
i:integer;
txtline:string;
begin
SL1:=TStringList.Create;
SL1.Add('3101030300310');
SL1.Add('3333111100003');
SL1.Add('3333333333333');
SL1.Add('1111111111111');
SL1.Add('0000000000000');
with ADOQuery1do
begin
ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath(Application.ExeName)+'printset.mdb';
SQL.Clear;
SQL.Add('delete from touzhu');
ExecSQL;
close;
SQL.Clear;
SQL.Add('select line from touzhu');
open;
end;
for i:=0 to SL1.Count-1do
begin
ADOQuery1.Append;
ADOQuery1.Fields[0].Value:=SL1;
ADOQuery1.Post;
end;
with ADOQuery1.Recordsetdo
begin
while not Eofdo
begin
txtline:=Fields[0].Value;
//第1场
if txtline[1]='3' then
begin
Form2.QRShape1.Pen.Color:=clBlack;
Form2.QRShape14.Pen.Color:=clWhite;
Form2.QRShape27.Pen.Color:=clWhite;
end
else
if txtline[1]='1' then
begin
Form2.QRShape14.Pen.Color:=clBlack;
Form2.QRShape1.Pen.Color:=clWhite;
Form2.QRShape27.Pen.Color:=clWhite;
end
else
if txtline[1]='0' then
begin
Form2.QRShape27.Pen.Color:=clBlack;
Form2.QRShape1.Pen.Color:=clWhite;
Form2.QRShape14.Pen.Color:=clWhite;
end;
//第2场
if txtline[2]='3' then
begin
Form2.QRShape2.Pen.Color:=clBlack;
Form2.QRShape15.Pen.Color:=clWhite;
Form2.QRShape28.Pen.Color:=clWhite;
end
else
if txtline[2]='1' then
begin
Form2.QRShape15.Pen.Color:=clBlack;
Form2.QRShape2.Pen.Color:=clWhite;
Form2.QRShape28.Pen.Color:=clWhite;
end
else
if txtline[2]='0' then
begin
Form2.QRShape28.Pen.Color:=clBlack;
Form2.QRShape2.Pen.Color:=clWhite;
Form2.QRShape15.Pen.Color:=clWhite;
end;
//第3场
if txtline[3]='3' then
begin
Form2.QRShape3.Pen.Color:=clBlack;
Form2.QRShape16.Pen.Color:=clWhite;
Form2.QRShape29.Pen.Color:=clWhite;
end
else
if txtline[3]='1' then
begin
Form2.QRShape16.Pen.Color:=clBlack;
Form2.QRShape3.Pen.Color:=clWhite;
Form2.QRShape29.Pen.Color:=clWhite;
end
else
if txtline[3]='0' then
begin
Form2.QRShape29.Pen.Color:=clBlack;
Form2.QRShape3.Pen.Color:=clWhite;
Form2.QRShape16.Pen.Color:=clWhite;
end;
//第4场
if txtline[4]='3' then
begin
Form2.QRShape4.Pen.Color:=clBlack;
Form2.QRShape17.Pen.Color:=clWhite;
Form2.QRShape30.Pen.Color:=clWhite;
end
else
if txtline[4]='1' then
begin
Form2.QRShape17.Pen.Color:=clBlack;
Form2.QRShape4.Pen.Color:=clWhite;
Form2.QRShape30.Pen.Color:=clWhite;
end
else
if txtline[4]='0' then
begin
Form2.QRShape30.Pen.Color:=clBlack;
Form2.QRShape4.Pen.Color:=clWhite;
Form2.QRShape17.Pen.Color:=clWhite;
end;
//第5场
if txtline[5]='3' then
begin
Form2.QRShape5.Pen.Color:=clBlack;
Form2.QRShape18.Pen.Color:=clWhite;
Form2.QRShape31.Pen.Color:=clWhite;
end
else
if txtline[5]='1' then
begin
Form2.QRShape18.Pen.Color:=clBlack;
Form2.QRShape5.Pen.Color:=clWhite;
Form2.QRShape31.Pen.Color:=clWhite;
end
else
if txtline[5]='0' then
begin
Form2.QRShape31.Pen.Color:=clBlack;
Form2.QRShape5.Pen.Color:=clWhite;
Form2.QRShape18.Pen.Color:=clWhite;
end;
//第6场
if txtline[6]='3' then
begin
Form2.QRShape6.Pen.Color:=clBlack;
Form2.QRShape19.Pen.Color:=clWhite;
Form2.QRShape32.Pen.Color:=clWhite;
end
else
if txtline[6]='1' then
begin
Form2.QRShape19.Pen.Color:=clBlack;
Form2.QRShape6.Pen.Color:=clWhite;
Form2.QRShape32.Pen.Color:=clWhite;
end
else
if txtline[6]='0' then
begin
Form2.QRShape32.Pen.Color:=clBlack;
Form2.QRShape6.Pen.Color:=clWhite;
Form2.QRShape19.Pen.Color:=clWhite;
end;
//第7场
if txtline[7]='3' then
begin
Form2.QRShape7.Pen.Color:=clBlack;
Form2.QRShape20.Pen.Color:=clWhite;
Form2.QRShape33.Pen.Color:=clWhite;
end
else
if txtline[7]='1' then
begin
Form2.QRShape20.Pen.Color:=clBlack;
Form2.QRShape7.Pen.Color:=clWhite;
Form2.QRShape33.Pen.Color:=clWhite;
end
else
if txtline[7]='0' then
begin
Form2.QRShape33.Pen.Color:=clBlack;
Form2.QRShape7.Pen.Color:=clWhite;
Form2.QRShape20.Pen.Color:=clWhite;
end;
//第8场
if txtline[8]='3' then
begin
Form2.QRShape8.Pen.Color:=clBlack;
Form2.QRShape21.Pen.Color:=clWhite;
Form2.QRShape34.Pen.Color:=clWhite;
end
else
if txtline[8]='1' then
begin
Form2.QRShape21.Pen.Color:=clBlack;
Form2.QRShape8.Pen.Color:=clWhite;
Form2.QRShape34.Pen.Color:=clWhite;
end
else
if txtline[8]='0' then
begin
Form2.QRShape34.Pen.Color:=clBlack;
Form2.QRShape8.Pen.Color:=clWhite;
Form2.QRShape21.Pen.Color:=clWhite;
end;
//第9场
if txtline[9]='3' then
begin
Form2.QRShape9.Pen.Color:=clBlack;
Form2.QRShape22.Pen.Color:=clWhite;
Form2.QRShape35.Pen.Color:=clWhite;
end
else
if txtline[9]='1' then
begin
Form2.QRShape22.Pen.Color:=clBlack;
Form2.QRShape9.Pen.Color:=clWhite;
Form2.QRShape35.Pen.Color:=clWhite;
end
else
if txtline[9]='0' then
begin
Form2.QRShape35.Pen.Color:=clBlack;
Form2.QRShape9.Pen.Color:=clWhite;
Form2.QRShape22.Pen.Color:=clWhite;
end;
//第10场
if txtline[10]='3' then
begin
Form2.QRShape10.Pen.Color:=clBlack;
Form2.QRShape23.Pen.Color:=clWhite;
Form2.QRShape36.Pen.Color:=clWhite;
end
else
if txtline[10]='1' then
begin
Form2.QRShape23.Pen.Color:=clBlack;
Form2.QRShape10.Pen.Color:=clWhite;
Form2.QRShape36.Pen.Color:=clWhite;
end
else
if txtline[10]='0' then
begin
Form2.QRShape36.Pen.Color:=clBlack;
Form2.QRShape10.Pen.Color:=clWhite;
Form2.QRShape23.Pen.Color:=clWhite;
end;
//第11场
if txtline[11]='3' then
begin
Form2.QRShape11.Pen.Color:=clBlack;
Form2.QRShape24.Pen.Color:=clWhite;
Form2.QRShape37.Pen.Color:=clWhite;
end
else
if txtline[11]='1' then
begin
Form2.QRShape24.Pen.Color:=clBlack;
Form2.QRShape11.Pen.Color:=clWhite;
Form2.QRShape37.Pen.Color:=clWhite;
end
else
if txtline[11]='0' then
begin
Form2.QRShape37.Pen.Color:=clBlack;
Form2.QRShape11.Pen.Color:=clWhite;
Form2.QRShape24.Pen.Color:=clWhite;
end;
//第12场
if txtline[12]='3' then
begin
Form2.QRShape12.Pen.Color:=clBlack;
Form2.QRShape25.Pen.Color:=clWhite;
Form2.QRShape38.Pen.Color:=clWhite;
end
else
if txtline[12]='1' then
begin
Form2.QRShape25.Pen.Color:=clBlack;
Form2.QRShape12.Pen.Color:=clWhite;
Form2.QRShape38.Pen.Color:=clWhite;
end
else
if txtline[12]='0' then
begin
Form2.QRShape38.Pen.Color:=clBlack;
Form2.QRShape12.Pen.Color:=clWhite;
Form2.QRShape25.Pen.Color:=clWhite;
end;
//第13场
if txtline[13]='3' then
begin
Form2.QRShape13.Pen.Color:=clBlack;
Form2.QRShape26.Pen.Color:=clWhite;
Form2.QRShape39.Pen.Color:=clWhite;
end
else
if txtline[13]='1' then
begin
Form2.QRShape26.Pen.Color:=clBlack;
Form2.QRShape13.Pen.Color:=clWhite;
Form2.QRShape39.Pen.Color:=clWhite;
end
else
if txtline[13]='0' then
begin
Form2.QRShape39.Pen.Color:=clBlack;
Form2.QRShape13.Pen.Color:=clWhite;
Form2.QRShape26.Pen.Color:=clWhite;
end;
MoveNext;
end;
end;
RichEdit1.Text:=SL1.Text;
Form2.QuickRep1.Preview;
with ADOQuery1do
begin
ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath(Application.ExeName)+'printset.mdb';
SQL.Clear;
SQL.Add('delete from touzhu');
ExecSQL;
end;
end;
end.
//============================================================
//窗体2
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QuickRpt, QRCtrls, ExtCtrls, jpeg;
type
TForm2 = class(TForm)
QuickRep1: TQuickRep;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
DetailBand1: TQRBand;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRShape21: TQRShape;
QRShape22: TQRShape;
QRShape23: TQRShape;
QRShape24: TQRShape;
QRShape25: TQRShape;
QRShape26: TQRShape;
QRShape27: TQRShape;
QRShape28: TQRShape;
QRShape29: TQRShape;
QRShape30: TQRShape;
QRShape31: TQRShape;
QRShape32: TQRShape;
QRShape33: TQRShape;
QRShape34: TQRShape;
QRShape35: TQRShape;
QRShape36: TQRShape;
QRShape37: TQRShape;
QRShape38: TQRShape;
QRShape39: TQRShape;
PageHeaderBand1: TQRBand;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
end.
3101030300310
3333111100003
3333333333333
1111111111111
0000000000000
......
生成的投注单不是直接打印文本,而是根据文本打印图形。投注单是这样的:每单有5栏,每栏有13行3列共39个打印位置。投注单纵向送入打印机,打印机根据每注的13场的结果而涂黑相应位置,就像标准化答题卡那样。每页打印5注。
我的实现方法是这样的:在QReport报表加入39个QRShape控件,分布位置见下图。把投注文本导入ADOQuery1中,然后打印ADOQuery1中的数据。需要涂黑的位置用类似这样的代码实现涂黑:QRShape1.Pen.Color:=clBlack;
实际的投注单的涂黑位置是像标准化答题卡那样细长形的,所以只能用图形形式打印,而不能用我下面给出的示例那样用全角字符■□来表示。实际打印时只需要打印涂黑位置即可,我为了说明问题而加注的1-13,1-3得数字和第X栏的文字不用打印。
-----------------------------
13121110 9 8 7 6 5 4 3 2 1 QReport报表控件摆放位置示意图
□□■□□■□■□□□□■ 3 QRShape13 QRShape12 ... QRShape1
□■□□□□□□□■□■□ 1 第一栏 QRShape26 QRShape25 ... QRShape14
■□□■■□■□■□■□□ 0 QRShape39 QRShape38 ... QRShape27
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
■□□□□□□□□■■■■ 3
□□□□□■■■■□□□□ 1 第二栏
□■■■■□□□□□□□□ 0
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
■■■■■■■■■■■■■ 3
□□□□□□□□□□□□□ 1 第三栏
□□□□□□□□□□□□□ 0
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
□□□□□□□□□□□□□ 3
■■■■■■■■■■■■■ 1 第四栏
□□□□□□□□□□□□□ 0
-----------------------------
13121110 9 8 7 6 5 4 3 2 1
□□□□□□□□□□□□□ 3
□□□□□□□□□□□□□ 1 第五栏
■■■■■■■■■■■■■ 0
-----------------------------
我的程序代码如下:
程序存在一个重大错误:打印出来的投注单每注都是数据集中的最后一注。请问代码错在哪?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Button1: TButton;
RichEdit1: TRichEdit;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
SL1:TStringList;
i:integer;
txtline:string;
begin
SL1:=TStringList.Create;
SL1.Add('3101030300310');
SL1.Add('3333111100003');
SL1.Add('3333333333333');
SL1.Add('1111111111111');
SL1.Add('0000000000000');
with ADOQuery1do
begin
ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath(Application.ExeName)+'printset.mdb';
SQL.Clear;
SQL.Add('delete from touzhu');
ExecSQL;
close;
SQL.Clear;
SQL.Add('select line from touzhu');
open;
end;
for i:=0 to SL1.Count-1do
begin
ADOQuery1.Append;
ADOQuery1.Fields[0].Value:=SL1;
ADOQuery1.Post;
end;
with ADOQuery1.Recordsetdo
begin
while not Eofdo
begin
txtline:=Fields[0].Value;
//第1场
if txtline[1]='3' then
begin
Form2.QRShape1.Pen.Color:=clBlack;
Form2.QRShape14.Pen.Color:=clWhite;
Form2.QRShape27.Pen.Color:=clWhite;
end
else
if txtline[1]='1' then
begin
Form2.QRShape14.Pen.Color:=clBlack;
Form2.QRShape1.Pen.Color:=clWhite;
Form2.QRShape27.Pen.Color:=clWhite;
end
else
if txtline[1]='0' then
begin
Form2.QRShape27.Pen.Color:=clBlack;
Form2.QRShape1.Pen.Color:=clWhite;
Form2.QRShape14.Pen.Color:=clWhite;
end;
//第2场
if txtline[2]='3' then
begin
Form2.QRShape2.Pen.Color:=clBlack;
Form2.QRShape15.Pen.Color:=clWhite;
Form2.QRShape28.Pen.Color:=clWhite;
end
else
if txtline[2]='1' then
begin
Form2.QRShape15.Pen.Color:=clBlack;
Form2.QRShape2.Pen.Color:=clWhite;
Form2.QRShape28.Pen.Color:=clWhite;
end
else
if txtline[2]='0' then
begin
Form2.QRShape28.Pen.Color:=clBlack;
Form2.QRShape2.Pen.Color:=clWhite;
Form2.QRShape15.Pen.Color:=clWhite;
end;
//第3场
if txtline[3]='3' then
begin
Form2.QRShape3.Pen.Color:=clBlack;
Form2.QRShape16.Pen.Color:=clWhite;
Form2.QRShape29.Pen.Color:=clWhite;
end
else
if txtline[3]='1' then
begin
Form2.QRShape16.Pen.Color:=clBlack;
Form2.QRShape3.Pen.Color:=clWhite;
Form2.QRShape29.Pen.Color:=clWhite;
end
else
if txtline[3]='0' then
begin
Form2.QRShape29.Pen.Color:=clBlack;
Form2.QRShape3.Pen.Color:=clWhite;
Form2.QRShape16.Pen.Color:=clWhite;
end;
//第4场
if txtline[4]='3' then
begin
Form2.QRShape4.Pen.Color:=clBlack;
Form2.QRShape17.Pen.Color:=clWhite;
Form2.QRShape30.Pen.Color:=clWhite;
end
else
if txtline[4]='1' then
begin
Form2.QRShape17.Pen.Color:=clBlack;
Form2.QRShape4.Pen.Color:=clWhite;
Form2.QRShape30.Pen.Color:=clWhite;
end
else
if txtline[4]='0' then
begin
Form2.QRShape30.Pen.Color:=clBlack;
Form2.QRShape4.Pen.Color:=clWhite;
Form2.QRShape17.Pen.Color:=clWhite;
end;
//第5场
if txtline[5]='3' then
begin
Form2.QRShape5.Pen.Color:=clBlack;
Form2.QRShape18.Pen.Color:=clWhite;
Form2.QRShape31.Pen.Color:=clWhite;
end
else
if txtline[5]='1' then
begin
Form2.QRShape18.Pen.Color:=clBlack;
Form2.QRShape5.Pen.Color:=clWhite;
Form2.QRShape31.Pen.Color:=clWhite;
end
else
if txtline[5]='0' then
begin
Form2.QRShape31.Pen.Color:=clBlack;
Form2.QRShape5.Pen.Color:=clWhite;
Form2.QRShape18.Pen.Color:=clWhite;
end;
//第6场
if txtline[6]='3' then
begin
Form2.QRShape6.Pen.Color:=clBlack;
Form2.QRShape19.Pen.Color:=clWhite;
Form2.QRShape32.Pen.Color:=clWhite;
end
else
if txtline[6]='1' then
begin
Form2.QRShape19.Pen.Color:=clBlack;
Form2.QRShape6.Pen.Color:=clWhite;
Form2.QRShape32.Pen.Color:=clWhite;
end
else
if txtline[6]='0' then
begin
Form2.QRShape32.Pen.Color:=clBlack;
Form2.QRShape6.Pen.Color:=clWhite;
Form2.QRShape19.Pen.Color:=clWhite;
end;
//第7场
if txtline[7]='3' then
begin
Form2.QRShape7.Pen.Color:=clBlack;
Form2.QRShape20.Pen.Color:=clWhite;
Form2.QRShape33.Pen.Color:=clWhite;
end
else
if txtline[7]='1' then
begin
Form2.QRShape20.Pen.Color:=clBlack;
Form2.QRShape7.Pen.Color:=clWhite;
Form2.QRShape33.Pen.Color:=clWhite;
end
else
if txtline[7]='0' then
begin
Form2.QRShape33.Pen.Color:=clBlack;
Form2.QRShape7.Pen.Color:=clWhite;
Form2.QRShape20.Pen.Color:=clWhite;
end;
//第8场
if txtline[8]='3' then
begin
Form2.QRShape8.Pen.Color:=clBlack;
Form2.QRShape21.Pen.Color:=clWhite;
Form2.QRShape34.Pen.Color:=clWhite;
end
else
if txtline[8]='1' then
begin
Form2.QRShape21.Pen.Color:=clBlack;
Form2.QRShape8.Pen.Color:=clWhite;
Form2.QRShape34.Pen.Color:=clWhite;
end
else
if txtline[8]='0' then
begin
Form2.QRShape34.Pen.Color:=clBlack;
Form2.QRShape8.Pen.Color:=clWhite;
Form2.QRShape21.Pen.Color:=clWhite;
end;
//第9场
if txtline[9]='3' then
begin
Form2.QRShape9.Pen.Color:=clBlack;
Form2.QRShape22.Pen.Color:=clWhite;
Form2.QRShape35.Pen.Color:=clWhite;
end
else
if txtline[9]='1' then
begin
Form2.QRShape22.Pen.Color:=clBlack;
Form2.QRShape9.Pen.Color:=clWhite;
Form2.QRShape35.Pen.Color:=clWhite;
end
else
if txtline[9]='0' then
begin
Form2.QRShape35.Pen.Color:=clBlack;
Form2.QRShape9.Pen.Color:=clWhite;
Form2.QRShape22.Pen.Color:=clWhite;
end;
//第10场
if txtline[10]='3' then
begin
Form2.QRShape10.Pen.Color:=clBlack;
Form2.QRShape23.Pen.Color:=clWhite;
Form2.QRShape36.Pen.Color:=clWhite;
end
else
if txtline[10]='1' then
begin
Form2.QRShape23.Pen.Color:=clBlack;
Form2.QRShape10.Pen.Color:=clWhite;
Form2.QRShape36.Pen.Color:=clWhite;
end
else
if txtline[10]='0' then
begin
Form2.QRShape36.Pen.Color:=clBlack;
Form2.QRShape10.Pen.Color:=clWhite;
Form2.QRShape23.Pen.Color:=clWhite;
end;
//第11场
if txtline[11]='3' then
begin
Form2.QRShape11.Pen.Color:=clBlack;
Form2.QRShape24.Pen.Color:=clWhite;
Form2.QRShape37.Pen.Color:=clWhite;
end
else
if txtline[11]='1' then
begin
Form2.QRShape24.Pen.Color:=clBlack;
Form2.QRShape11.Pen.Color:=clWhite;
Form2.QRShape37.Pen.Color:=clWhite;
end
else
if txtline[11]='0' then
begin
Form2.QRShape37.Pen.Color:=clBlack;
Form2.QRShape11.Pen.Color:=clWhite;
Form2.QRShape24.Pen.Color:=clWhite;
end;
//第12场
if txtline[12]='3' then
begin
Form2.QRShape12.Pen.Color:=clBlack;
Form2.QRShape25.Pen.Color:=clWhite;
Form2.QRShape38.Pen.Color:=clWhite;
end
else
if txtline[12]='1' then
begin
Form2.QRShape25.Pen.Color:=clBlack;
Form2.QRShape12.Pen.Color:=clWhite;
Form2.QRShape38.Pen.Color:=clWhite;
end
else
if txtline[12]='0' then
begin
Form2.QRShape38.Pen.Color:=clBlack;
Form2.QRShape12.Pen.Color:=clWhite;
Form2.QRShape25.Pen.Color:=clWhite;
end;
//第13场
if txtline[13]='3' then
begin
Form2.QRShape13.Pen.Color:=clBlack;
Form2.QRShape26.Pen.Color:=clWhite;
Form2.QRShape39.Pen.Color:=clWhite;
end
else
if txtline[13]='1' then
begin
Form2.QRShape26.Pen.Color:=clBlack;
Form2.QRShape13.Pen.Color:=clWhite;
Form2.QRShape39.Pen.Color:=clWhite;
end
else
if txtline[13]='0' then
begin
Form2.QRShape39.Pen.Color:=clBlack;
Form2.QRShape13.Pen.Color:=clWhite;
Form2.QRShape26.Pen.Color:=clWhite;
end;
MoveNext;
end;
end;
RichEdit1.Text:=SL1.Text;
Form2.QuickRep1.Preview;
with ADOQuery1do
begin
ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+ExtractFilePath(Application.ExeName)+'printset.mdb';
SQL.Clear;
SQL.Add('delete from touzhu');
ExecSQL;
end;
end;
end.
//============================================================
//窗体2
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QuickRpt, QRCtrls, ExtCtrls, jpeg;
type
TForm2 = class(TForm)
QuickRep1: TQuickRep;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
DetailBand1: TQRBand;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRShape14: TQRShape;
QRShape15: TQRShape;
QRShape16: TQRShape;
QRShape17: TQRShape;
QRShape18: TQRShape;
QRShape19: TQRShape;
QRShape20: TQRShape;
QRShape21: TQRShape;
QRShape22: TQRShape;
QRShape23: TQRShape;
QRShape24: TQRShape;
QRShape25: TQRShape;
QRShape26: TQRShape;
QRShape27: TQRShape;
QRShape28: TQRShape;
QRShape29: TQRShape;
QRShape30: TQRShape;
QRShape31: TQRShape;
QRShape32: TQRShape;
QRShape33: TQRShape;
QRShape34: TQRShape;
QRShape35: TQRShape;
QRShape36: TQRShape;
QRShape37: TQRShape;
QRShape38: TQRShape;
QRShape39: TQRShape;
PageHeaderBand1: TQRBand;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
end.