W
wdjlover
Unregistered / Unconfirmed
GUEST, unregistred user!
调用预览窗体时的语句
procedure TFormSelect.ButtonOKClick(Sender: TObject);
var
FormPreview: TFormPreview;
FormPreviewXX: TFormPreviewXX;
begin
if RGNJ.ItemIndex < 3 then
begin
try
FormPreviewXX := TFormPreviewXX.Create(self);
FormPreviewXX.subactive('', RGNJ.Items[RGNJ.itemIndex]);
FormPreviewXX.QuickRep1.Preview;
finally
FormPreviewXX.Free;
end;
end
else
begin
try
FormPreview := TFormPreview.Create(self);
FormPreview.subactive('', RGNJ.Items[RGNJ.itemIndex]);
FormPreview.QuickRep1.Preview;
finally
FormPreview.Free;
end;
end;
报表窗体代码
unit U_Preview;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, QuickRpt, DB, ADODB, TeEngine, Series, TeeProcs,
Chart, DBChart, QrTee, jpeg, QRCtrls;
type
TFormPreview = class(TForm)
QuickRep1: TQuickRep;
QRBand1: TQRBand;
QRDBChart1: TQRDBChart;
QRChart1: TQRChart;
Series1: TBarSeries;
ADOQuery2: TADOQuery;
ADOQuery3: TADOQuery;
ADOQuery4: TADOQuery;
ADOQuery5: TADOQuery;
ADOQuery6: TADOQuery;
ADOQuery7: TADOQuery;
QRChart2: TQRChart;
QRDBChart2: TQRDBChart;
BarSeries1: TBarSeries;
QRChart3: TQRChart;
QRDBChart3: TQRDBChart;
BarSeries2: TBarSeries;
QRChart4: TQRChart;
QRDBChart4: TQRDBChart;
BarSeries3: TBarSeries;
QRChart5: TQRChart;
QRDBChart5: TQRDBChart;
BarSeries4: TBarSeries;
QRChart6: TQRChart;
QRDBChart6: TQRDBChart;
BarSeries5: TBarSeries;
QRChart7: TQRChart;
QRDBChart7: TQRDBChart;
BarSeries6: TBarSeries;
QRImage1: TQRImage;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel23: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel31: TQRLabel;
QRLabel32: TQRLabel;
QRLabel33: TQRLabel;
QRLabel34: TQRLabel;
QRLabel35: TQRLabel;
QRLabel36: TQRLabel;
QRLabel37: TQRLabel;
QRLabel38: TQRLabel;
QRLabel39: TQRLabel;
QRLabel40: TQRLabel;
QRLabel41: TQRLabel;
QRLabel42: TQRLabel;
ADO2: TADOQuery;
ADOQLoad: TADOQuery;
QRLabel43: TQRLabel;
ADO11: TADOQuery;
ADOQuery1: TADOQuery;
ADOConnection1: TADOConnection;
procedure QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure subactive(strSQL, strNJ: string);
private
function GetOrder(strKM, strNJ, strFS: string): string;
function GetAvg(strKM, strNJ: string): string;
function GetPc(strKM, strNJ, strFS: string): string;
{ Private declarations }
public
{ Public declarations }
end;
var
FormPreview: TFormPreview;
implementation
uses U_DMMain;
{$R *.dfm}
{ TFormPreview }
function TFormPreview.GetAvg(strKM, strNJ: string): string;
begin
ado2.Close;
ado2.sql.Clear;
ado2.SQL.Add('select AvgGrade from avgtable where km=0 and nj=1');
ado2.Parameters.ParamByName('p0').Value := strkm;
ado2.Parameters.ParamByName('p1').Value := strNj;
ado2.Open;
result := ado2.fieldbyname('AvgGrade').AsString;
ado2.Close;
end;
function TFormPreview.GetOrder(strKM, strNJ, strFS: string): string;
begin
ADOQLoad.Close;
ADOQLoad.SQL.Clear;
ADOQLoad.SQL.Add('select sum(rs) as ordervalue from pc where fs>0 and km=1 and NJ=2');
ADOQLoad.Parameters.ParamByName('p0').Value := strFs;
ADOQLoad.Parameters.ParamByName('p1').Value := strKM;
ADOQLoad.Parameters.ParamByName('p2').Value := strNJ;
ADOQLoad.Open;
if ADOQLoad.FieldByName('ordervalue').AsInteger = 0 then
result := '1/1000';
if ADOQLoad.FieldByName('ordervalue').AsInteger >= 1000 then
result := '1000/1000';
if (ADOQLoad.FieldByName('ordervalue').AsInteger > 0) and (ADOQLoad.FieldByName('ordervalue').AsInteger < 1000) then
result := inttostr(ADOQLoad.FieldByName('ordervalue').AsInteger + 1) + '/1000';
ADOQLoad.Close;
end;
function TFormPreview.GetPc(strKM, strNJ, strFS: string): string;
begin
ado2.Close;
ado2.SQL.Clear;
ado2.sql.Add('select pc from pc where km=0 and nj=1 and fs=2');
ado2.Parameters.ParamByName('p0').Value := strkm;
ado2.Parameters.ParamByName('p1').Value := strnj;
ado2.Parameters.ParamByName('p2').Value := strfs;
ado2.Open;
result := ado2.fieldbyname('pc').AsString;
ado2.close;
end;
procedure TFormPreview.QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
QRLabel1.Caption := ado11.fieldbyname('幚巤擔').AsString;
QRLabel2.Caption := ado11.fieldbyname('庴尡斣崋').AsString;
QRLabel3.Caption := ado11.fieldbyname('妛擭').AsString;
QRLabel4.Caption := ado11.fieldbyname('嵼妛峑').AsString;
QRLabel5.Caption := ado11.fieldbyname('巵柤').AsString;
QRLabel6.Caption := ado11.FieldByName('惈暿').AsString;
QRLabel7.Caption := ado11.fieldbyname('庴尡夛応').AsString;
QRLabel43.Caption := ado11.fieldbyname('捠妛夛応').AsString;
//****************************************************崙岅************************************************//
QRLabel15.Caption := ado11.fieldbyname('崙岅').AsString;
QRLabel16.Caption := GetAvg('崙岅', ado11.fieldbyname('妛擭').AsString);
QRLabel17.Caption := GetPc('崙岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('崙岅').AsString);
QRLabel18.Caption := GetOrder('崙岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('崙岅').AsString);
if ado11.fieldbyname('崙岅').AsInteger <= 10 then
QRChart1.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('崙岅').AsInteger = 100 then
QRChart1.Chart.SubFoot.Left := 120
else
QRChart1.Chart.SubFoot.Left := round((ado11.fieldbyname('崙岅').AsInteger div 10) * 13.5);
end;
{
//*****************************************************悢妛***********************************************//
QRLabel19.Caption := ado11.fieldbyname('悢妛').AsString;
QRLabel20.Caption := GetAvg('悢妛', ado11.fieldbyname('妛擭').AsString);
QRLabel21.Caption := GetPc('悢妛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('悢妛').AsString);
QRLabel22.Caption := GetOrder('悢妛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('悢妛').AsString);
if ado11.fieldbyname('悢妛').AsInteger <= 10 then
QRChart2.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('悢妛').AsInteger = 100 then
QRChart2.Chart.SubFoot.Left := 120
else
QRChart2.Chart.SubFoot.Left := round((ado11.fieldbyname('悢妛').AsInteger div 10) * 13.5);
end;
//*****************************************************塸岅***********************************************//
QRLabel23.Caption := ado11.fieldbyname('塸岅').AsString;
QRLabel24.Caption := GetAvg('塸岅', ado11.fieldbyname('妛擭').AsString);
QRLabel25.Caption := GetPc('塸岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('塸岅').AsString);
QRLabel26.Caption := GetOrder('塸岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('塸岅').AsString);
if ado11.fieldbyname('塸岅').AsInteger <= 10 then
QRChart3.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('塸岅').AsInteger = 100 then
QRChart3.Chart.SubFoot.Left := 120
else
QRChart3.Chart.SubFoot.Left := round((ado11.fieldbyname('塸岅').AsInteger div 10) * 13.5);
end;
//*****************************************************棟壢***********************************************//
QRLabel27.Caption := ado11.fieldbyname('棟壢').AsString;
QRLabel28.Caption := GetAvg('棟壢', ado11.fieldbyname('妛擭').AsString);
QRLabel29.Caption := GetPc('棟壢', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('棟壢').AsString);
QRLabel30.Caption := GetOrder('棟壢', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('棟壢').AsString);
if ado11.fieldbyname('棟壢').AsInteger <= 10 then
QRChart4.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('棟壢').AsInteger = 100 then
QRChart4.Chart.SubFoot.Left := 120
else
QRChart4.Chart.SubFoot.Left := round((ado11.fieldbyname('棟壢').AsInteger div 10) * 13.5);
end;
//*****************************************************幮夛***********************************************//
QRLabel31.Caption := ado11.fieldbyname('幮夛').AsString;
QRLabel32.Caption := GetAvg('幮夛', ado11.fieldbyname('妛擭').AsString);
QRLabel33.Caption := GetPc('幮夛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('幮夛').AsString);
QRLabel34.Caption := GetOrder('幮夛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('幮夛').AsString);
if ado11.fieldbyname('幮夛').AsInteger <= 10 then
QRChart5.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('幮夛').AsInteger = 100 then
QRChart5.Chart.SubFoot.Left := 120
else
QRChart5.Chart.SubFoot.Left := round((ado11.fieldbyname('幮夛').AsInteger div 10) * 13.5);
end;
//***************************************************** 3Hj ***********************************************//
QRLabel35.Caption := ado11.fieldbyname('ThreeTotal').AsString;
QRLabel36.Caption := GetAvg('ThreeTotal', ado11.fieldbyname('妛擭').AsString);
QRLabel37.Caption := GetPc('ThreeTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('ThreeTotal').AsString);
QRLabel38.Caption := GetOrder('ThreeTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('ThreeTotal').AsString);
if ado11.fieldbyname('ThreeTotal').AsInteger <= 30 then
QRChart6.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('ThreeTotal').AsInteger = 300 then
QRChart6.Chart.SubFoot.Left := 120
else
QRChart6.Chart.SubFoot.Left := round((round(ado11.fieldbyname('ThreeTotal').AsInteger / 3) div 10) * 13.5);
end;
//***************************************************** 5HJ ***********************************************//
QRLabel39.Caption := ado11.fieldbyname('FiveTotal').AsString;
QRLabel40.Caption := GetAvg('FiveTotal', ado11.fieldbyname('妛擭').AsString);
QRLabel41.Caption := GetPc('FiveTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('FiveTotal').AsString);
QRLabel42.Caption := GetOrder('FiveTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('FiveTotal').AsString);
if ado11.fieldbyname('FiveTotal').AsInteger <= 50 then
QRChart7.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('FiveTotal').AsInteger = 500 then
QRChart7.Chart.SubFoot.Left := 120
else
QRChart7.Chart.SubFoot.Left := round((round(ado11.fieldbyname('FiveTotal').AsInteger / 5) div 10) * 13.5);
end;
}
end;
procedure TFormPreview.subactive(strSQL, strNJ: string);
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from chartgy where nj=0 order by CLng(b)');
ADOQuery1.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery1.Open;
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('select * from chartsx where nj=0 order by CLng(b)');
ADOQuery2.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery2.Open;
ADOQuery3.Close;
ADOQuery3.SQL.Clear;
ADOQuery3.SQL.Add('select * from chartyy where nj=0 order by CLng(b)');
ADOQuery3.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery3.Open;
ADOQuery4.Close;
ADOQuery4.SQL.Clear;
ADOQuery4.SQL.Add('select * from chartlk where nj=0 order by CLng(b)');
ADOQuery4.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery4.Open;
ADOQuery5.Close;
ADOQuery5.SQL.Clear;
ADOQuery5.SQL.Add('select * from chartsh where nj=0 order by CLng(b)');
ADOQuery5.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery5.Open;
ADOQuery6.Close;
ADOQuery6.SQL.Clear;
ADOQuery6.SQL.Add('select * from ChartThreeTotal where nj=0 order by CLng(b)');
ADOQuery6.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery6.Open;
ADOQuery7.Close;
ADOQuery7.SQL.Clear;
ADOQuery7.SQL.Add('select * from ChartFiveTotal where nj=0 order by CLng(b)');
ADOQuery7.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery7.Open;
ado11.Close;
ado11.SQL.Clear;
if strSQL = '' then
begin
ado11.SQL.Add('select * from Grade where 妛擭=0 ');
ado11.Parameters.ParamByName('p0').Value := strNJ;
end
else
begin
ado11.SQL.Add('select * from Grade where ' + strSQL + ' and 妛擭=0');
ado11.Parameters.ParamByName('p0').Value := strNJ;
end;
ado11.Open;
end;
end.
当adoquery1 至 adoquery7 当中的任何一个打开时 就会出现stack overflow提示 请各位大虾帮我看看 为什么会出错,在windows2000下就没有问题。我现在用的是windowsxp
急啊!!!!!!!!!!!!!!!
procedure TFormSelect.ButtonOKClick(Sender: TObject);
var
FormPreview: TFormPreview;
FormPreviewXX: TFormPreviewXX;
begin
if RGNJ.ItemIndex < 3 then
begin
try
FormPreviewXX := TFormPreviewXX.Create(self);
FormPreviewXX.subactive('', RGNJ.Items[RGNJ.itemIndex]);
FormPreviewXX.QuickRep1.Preview;
finally
FormPreviewXX.Free;
end;
end
else
begin
try
FormPreview := TFormPreview.Create(self);
FormPreview.subactive('', RGNJ.Items[RGNJ.itemIndex]);
FormPreview.QuickRep1.Preview;
finally
FormPreview.Free;
end;
end;
报表窗体代码
unit U_Preview;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, QuickRpt, DB, ADODB, TeEngine, Series, TeeProcs,
Chart, DBChart, QrTee, jpeg, QRCtrls;
type
TFormPreview = class(TForm)
QuickRep1: TQuickRep;
QRBand1: TQRBand;
QRDBChart1: TQRDBChart;
QRChart1: TQRChart;
Series1: TBarSeries;
ADOQuery2: TADOQuery;
ADOQuery3: TADOQuery;
ADOQuery4: TADOQuery;
ADOQuery5: TADOQuery;
ADOQuery6: TADOQuery;
ADOQuery7: TADOQuery;
QRChart2: TQRChart;
QRDBChart2: TQRDBChart;
BarSeries1: TBarSeries;
QRChart3: TQRChart;
QRDBChart3: TQRDBChart;
BarSeries2: TBarSeries;
QRChart4: TQRChart;
QRDBChart4: TQRDBChart;
BarSeries3: TBarSeries;
QRChart5: TQRChart;
QRDBChart5: TQRDBChart;
BarSeries4: TBarSeries;
QRChart6: TQRChart;
QRDBChart6: TQRDBChart;
BarSeries5: TBarSeries;
QRChart7: TQRChart;
QRDBChart7: TQRDBChart;
BarSeries6: TBarSeries;
QRImage1: TQRImage;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel23: TQRLabel;
QRLabel19: TQRLabel;
QRLabel20: TQRLabel;
QRLabel21: TQRLabel;
QRLabel22: TQRLabel;
QRLabel24: TQRLabel;
QRLabel25: TQRLabel;
QRLabel26: TQRLabel;
QRLabel27: TQRLabel;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel31: TQRLabel;
QRLabel32: TQRLabel;
QRLabel33: TQRLabel;
QRLabel34: TQRLabel;
QRLabel35: TQRLabel;
QRLabel36: TQRLabel;
QRLabel37: TQRLabel;
QRLabel38: TQRLabel;
QRLabel39: TQRLabel;
QRLabel40: TQRLabel;
QRLabel41: TQRLabel;
QRLabel42: TQRLabel;
ADO2: TADOQuery;
ADOQLoad: TADOQuery;
QRLabel43: TQRLabel;
ADO11: TADOQuery;
ADOQuery1: TADOQuery;
ADOConnection1: TADOConnection;
procedure QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure subactive(strSQL, strNJ: string);
private
function GetOrder(strKM, strNJ, strFS: string): string;
function GetAvg(strKM, strNJ: string): string;
function GetPc(strKM, strNJ, strFS: string): string;
{ Private declarations }
public
{ Public declarations }
end;
var
FormPreview: TFormPreview;
implementation
uses U_DMMain;
{$R *.dfm}
{ TFormPreview }
function TFormPreview.GetAvg(strKM, strNJ: string): string;
begin
ado2.Close;
ado2.sql.Clear;
ado2.SQL.Add('select AvgGrade from avgtable where km=0 and nj=1');
ado2.Parameters.ParamByName('p0').Value := strkm;
ado2.Parameters.ParamByName('p1').Value := strNj;
ado2.Open;
result := ado2.fieldbyname('AvgGrade').AsString;
ado2.Close;
end;
function TFormPreview.GetOrder(strKM, strNJ, strFS: string): string;
begin
ADOQLoad.Close;
ADOQLoad.SQL.Clear;
ADOQLoad.SQL.Add('select sum(rs) as ordervalue from pc where fs>0 and km=1 and NJ=2');
ADOQLoad.Parameters.ParamByName('p0').Value := strFs;
ADOQLoad.Parameters.ParamByName('p1').Value := strKM;
ADOQLoad.Parameters.ParamByName('p2').Value := strNJ;
ADOQLoad.Open;
if ADOQLoad.FieldByName('ordervalue').AsInteger = 0 then
result := '1/1000';
if ADOQLoad.FieldByName('ordervalue').AsInteger >= 1000 then
result := '1000/1000';
if (ADOQLoad.FieldByName('ordervalue').AsInteger > 0) and (ADOQLoad.FieldByName('ordervalue').AsInteger < 1000) then
result := inttostr(ADOQLoad.FieldByName('ordervalue').AsInteger + 1) + '/1000';
ADOQLoad.Close;
end;
function TFormPreview.GetPc(strKM, strNJ, strFS: string): string;
begin
ado2.Close;
ado2.SQL.Clear;
ado2.sql.Add('select pc from pc where km=0 and nj=1 and fs=2');
ado2.Parameters.ParamByName('p0').Value := strkm;
ado2.Parameters.ParamByName('p1').Value := strnj;
ado2.Parameters.ParamByName('p2').Value := strfs;
ado2.Open;
result := ado2.fieldbyname('pc').AsString;
ado2.close;
end;
procedure TFormPreview.QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
QRLabel1.Caption := ado11.fieldbyname('幚巤擔').AsString;
QRLabel2.Caption := ado11.fieldbyname('庴尡斣崋').AsString;
QRLabel3.Caption := ado11.fieldbyname('妛擭').AsString;
QRLabel4.Caption := ado11.fieldbyname('嵼妛峑').AsString;
QRLabel5.Caption := ado11.fieldbyname('巵柤').AsString;
QRLabel6.Caption := ado11.FieldByName('惈暿').AsString;
QRLabel7.Caption := ado11.fieldbyname('庴尡夛応').AsString;
QRLabel43.Caption := ado11.fieldbyname('捠妛夛応').AsString;
//****************************************************崙岅************************************************//
QRLabel15.Caption := ado11.fieldbyname('崙岅').AsString;
QRLabel16.Caption := GetAvg('崙岅', ado11.fieldbyname('妛擭').AsString);
QRLabel17.Caption := GetPc('崙岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('崙岅').AsString);
QRLabel18.Caption := GetOrder('崙岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('崙岅').AsString);
if ado11.fieldbyname('崙岅').AsInteger <= 10 then
QRChart1.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('崙岅').AsInteger = 100 then
QRChart1.Chart.SubFoot.Left := 120
else
QRChart1.Chart.SubFoot.Left := round((ado11.fieldbyname('崙岅').AsInteger div 10) * 13.5);
end;
{
//*****************************************************悢妛***********************************************//
QRLabel19.Caption := ado11.fieldbyname('悢妛').AsString;
QRLabel20.Caption := GetAvg('悢妛', ado11.fieldbyname('妛擭').AsString);
QRLabel21.Caption := GetPc('悢妛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('悢妛').AsString);
QRLabel22.Caption := GetOrder('悢妛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('悢妛').AsString);
if ado11.fieldbyname('悢妛').AsInteger <= 10 then
QRChart2.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('悢妛').AsInteger = 100 then
QRChart2.Chart.SubFoot.Left := 120
else
QRChart2.Chart.SubFoot.Left := round((ado11.fieldbyname('悢妛').AsInteger div 10) * 13.5);
end;
//*****************************************************塸岅***********************************************//
QRLabel23.Caption := ado11.fieldbyname('塸岅').AsString;
QRLabel24.Caption := GetAvg('塸岅', ado11.fieldbyname('妛擭').AsString);
QRLabel25.Caption := GetPc('塸岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('塸岅').AsString);
QRLabel26.Caption := GetOrder('塸岅', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('塸岅').AsString);
if ado11.fieldbyname('塸岅').AsInteger <= 10 then
QRChart3.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('塸岅').AsInteger = 100 then
QRChart3.Chart.SubFoot.Left := 120
else
QRChart3.Chart.SubFoot.Left := round((ado11.fieldbyname('塸岅').AsInteger div 10) * 13.5);
end;
//*****************************************************棟壢***********************************************//
QRLabel27.Caption := ado11.fieldbyname('棟壢').AsString;
QRLabel28.Caption := GetAvg('棟壢', ado11.fieldbyname('妛擭').AsString);
QRLabel29.Caption := GetPc('棟壢', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('棟壢').AsString);
QRLabel30.Caption := GetOrder('棟壢', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('棟壢').AsString);
if ado11.fieldbyname('棟壢').AsInteger <= 10 then
QRChart4.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('棟壢').AsInteger = 100 then
QRChart4.Chart.SubFoot.Left := 120
else
QRChart4.Chart.SubFoot.Left := round((ado11.fieldbyname('棟壢').AsInteger div 10) * 13.5);
end;
//*****************************************************幮夛***********************************************//
QRLabel31.Caption := ado11.fieldbyname('幮夛').AsString;
QRLabel32.Caption := GetAvg('幮夛', ado11.fieldbyname('妛擭').AsString);
QRLabel33.Caption := GetPc('幮夛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('幮夛').AsString);
QRLabel34.Caption := GetOrder('幮夛', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('幮夛').AsString);
if ado11.fieldbyname('幮夛').AsInteger <= 10 then
QRChart5.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('幮夛').AsInteger = 100 then
QRChart5.Chart.SubFoot.Left := 120
else
QRChart5.Chart.SubFoot.Left := round((ado11.fieldbyname('幮夛').AsInteger div 10) * 13.5);
end;
//***************************************************** 3Hj ***********************************************//
QRLabel35.Caption := ado11.fieldbyname('ThreeTotal').AsString;
QRLabel36.Caption := GetAvg('ThreeTotal', ado11.fieldbyname('妛擭').AsString);
QRLabel37.Caption := GetPc('ThreeTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('ThreeTotal').AsString);
QRLabel38.Caption := GetOrder('ThreeTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('ThreeTotal').AsString);
if ado11.fieldbyname('ThreeTotal').AsInteger <= 30 then
QRChart6.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('ThreeTotal').AsInteger = 300 then
QRChart6.Chart.SubFoot.Left := 120
else
QRChart6.Chart.SubFoot.Left := round((round(ado11.fieldbyname('ThreeTotal').AsInteger / 3) div 10) * 13.5);
end;
//***************************************************** 5HJ ***********************************************//
QRLabel39.Caption := ado11.fieldbyname('FiveTotal').AsString;
QRLabel40.Caption := GetAvg('FiveTotal', ado11.fieldbyname('妛擭').AsString);
QRLabel41.Caption := GetPc('FiveTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('FiveTotal').AsString);
QRLabel42.Caption := GetOrder('FiveTotal', ado11.fieldbyname('妛擭').AsString, ado11.fieldbyname('FiveTotal').AsString);
if ado11.fieldbyname('FiveTotal').AsInteger <= 50 then
QRChart7.Chart.SubFoot.Left := 5
else
begin
if ado11.fieldbyname('FiveTotal').AsInteger = 500 then
QRChart7.Chart.SubFoot.Left := 120
else
QRChart7.Chart.SubFoot.Left := round((round(ado11.fieldbyname('FiveTotal').AsInteger / 5) div 10) * 13.5);
end;
}
end;
procedure TFormPreview.subactive(strSQL, strNJ: string);
begin
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('select * from chartgy where nj=0 order by CLng(b)');
ADOQuery1.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery1.Open;
ADOQuery2.Close;
ADOQuery2.SQL.Clear;
ADOQuery2.SQL.Add('select * from chartsx where nj=0 order by CLng(b)');
ADOQuery2.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery2.Open;
ADOQuery3.Close;
ADOQuery3.SQL.Clear;
ADOQuery3.SQL.Add('select * from chartyy where nj=0 order by CLng(b)');
ADOQuery3.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery3.Open;
ADOQuery4.Close;
ADOQuery4.SQL.Clear;
ADOQuery4.SQL.Add('select * from chartlk where nj=0 order by CLng(b)');
ADOQuery4.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery4.Open;
ADOQuery5.Close;
ADOQuery5.SQL.Clear;
ADOQuery5.SQL.Add('select * from chartsh where nj=0 order by CLng(b)');
ADOQuery5.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery5.Open;
ADOQuery6.Close;
ADOQuery6.SQL.Clear;
ADOQuery6.SQL.Add('select * from ChartThreeTotal where nj=0 order by CLng(b)');
ADOQuery6.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery6.Open;
ADOQuery7.Close;
ADOQuery7.SQL.Clear;
ADOQuery7.SQL.Add('select * from ChartFiveTotal where nj=0 order by CLng(b)');
ADOQuery7.Parameters.ParamByName('p0').Value := strNJ;
ADOQuery7.Open;
ado11.Close;
ado11.SQL.Clear;
if strSQL = '' then
begin
ado11.SQL.Add('select * from Grade where 妛擭=0 ');
ado11.Parameters.ParamByName('p0').Value := strNJ;
end
else
begin
ado11.SQL.Add('select * from Grade where ' + strSQL + ' and 妛擭=0');
ado11.Parameters.ParamByName('p0').Value := strNJ;
end;
ado11.Open;
end;
end.
当adoquery1 至 adoquery7 当中的任何一个打开时 就会出现stack overflow提示 请各位大虾帮我看看 为什么会出错,在windows2000下就没有问题。我现在用的是windowsxp
急啊!!!!!!!!!!!!!!!