我用QRPreview写了自定义预览程序,在D4能正常显示,D5下不显示,谁能找到问题在哪?(200分)

  • 主题发起人 主题发起人 ediechen
  • 开始时间 开始时间
E

ediechen

Unregistered / Unconfirmed
GUEST, unregistred user!
源程序如下:
-------------------------------------------------
//主程序
unit U_main;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
QuickRpt, Qrctrls, Qrprntr, ExtCtrls, StdCtrls, Db, DBTables;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
QRBand1: TQRBand;
QRLabel1: TQRLabel;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure OnMyPreview(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
uses U_MyPreview;
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
QuickRep1.OnPreview := OnMyPreview;
end;

procedure TForm1.OnMyPreview(Sender: TObject);
begin
try
Application.CreateForm(TF_MyPreview, F_MyPreview);
except
MessageDlg('打印预览窗口已经存在,请重新启动本系统!',mtError, [mbOK], 0);
exit;
end;
F_MyPreview.QRPreview1.QRPrinter := TQRPrinter(Sender);
F_MyPreview.ShowModal;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview;
end;

end.
//U_main.dfm
object Form1: TForm1
Left = 192
Top = 114
Width = 544
Height = 375
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Scaled = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = 24
Top = 56
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE')
Functions.DATA = (
'0'
'0'
#39#39)
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100
2970
100
2100
100
100
0)
PrinterSettings.Copies = 1
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.OutputBin = Auto
PrintIfEmpty = True
SnapToGrid = True
Units = MM
Zoom = 100
object QRBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 91
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
240.770833333333
1899.70833333333)
BandType = rbTitle
object QRLabel1: TQRLabel
Left = 104
Top = 24
Width = 33
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.9791666666667
275.166666666667
63.5
87.3125)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = '测试'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 10
end
end
end
object Button1: TButton
Left = 152
Top = 16
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
end
//自定义预览程序
unit U_MyPreview;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, QRPrntr, ExtCtrls, Buttons, ComCtrls, Printers;
type
TF_MyPreview = class(TForm)
Panel1: TPanel;
QRPreview1: TQRPreview;
CloseBtn: TBitBtn;
FirstBtn: TSpeedButton;
PriorBtn: TSpeedButton;
NextBtn: TSpeedButton;
LastBtn: TSpeedButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
FitBtn: TSpeedButton;
SpeedButton6: TSpeedButton;
ComboBox1: TComboBox;
PrintSetBtn: TSpeedButton;
PrintBtn: TSpeedButton;
PrintDialog1: TPrintDialog;
SpeedButton1: TSpeedButton;
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure FirstBtnClick(Sender: TObject);
procedure PriorBtnClick(Sender: TObject);
procedure NextBtnClick(Sender: TObject);
procedure LastBtnClick(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure ComboBox1KeyPress(Sender: TObject;
var Key: Char);
procedure ComboBox1Change(Sender: TObject);
procedure FitBtnClick(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
procedure QRPreview1PageAvailable(Sender: TObject;
PageNum: Integer);
procedure PrintSetBtnClick(Sender: TObject);
procedure PrintBtnClick(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;

var
F_MyPreview: TF_MyPreview;
implementation
uses u_Main;
{$R *.DFM}
procedure TF_MyPreview.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action := caFree;
end;

procedure TF_MyPreview.FirstBtnClick(Sender: TObject);
begin
QRPreview1.PageNumber := 1;
Label2.Caption := '第 '+ trim(inttostr(QRPreview1.PageNumber))+' 页';
end;

procedure TF_MyPreview.PriorBtnClick(Sender: TObject);
begin
with QRPreview1do
if PageNumber > 1 then
PageNumber := PageNumber - 1;
Label2.Caption := '第 '+ trim(inttostr(QRPreview1.PageNumber))+' 页';
end;

procedure TF_MyPreview.NextBtnClick(Sender: TObject);
begin
with QRPreview1do
if PageNumber < QRPrinter.PageCount then
PageNumber := PageNumber + 1;
Label2.Caption := '第 '+ trim(inttostr(QRPreview1.PageNumber))+' 页';
end;

procedure TF_MyPreview.LastBtnClick(Sender: TObject);
begin
QRPreview1.PageNumber := QRPreview1.QRPrinter.PageCount;
Label2.Caption := '第 '+ trim(inttostr(QRPreview1.PageNumber))+' 页';
end;

procedure TF_MyPreview.Edit1Change(Sender: TObject);
begin
QRPreview1.Zoom := StrToInt(ComboBox1.text);
end;

procedure TF_MyPreview.ComboBox1KeyPress(Sender: TObject;
var Key: Char);
begin
if not(key in ['0'..'9',chr(VK_BACK),chr(VK_DELETE),chr(VK_RETURN)]) then
key := #0;
if key = chr(VK_RETURN) then
begin
if trim(ComboBox1.text) = '' then
QRPreview1.Zoom := 100 else
QRPreview1.Zoom := strtoint(ComboBox1.text);
Key:= #0;
end;
end;

procedure TF_MyPreview.ComboBox1Change(Sender: TObject);
begin
if (trim(ComboBox1.text)='')or(strtoint(ComboBox1.text)<10) then
QRPreview1.Zoom := 10
else
QRPreview1.Zoom := strtoint(ComboBox1.text)
end;

procedure TF_MyPreview.FitBtnClick(Sender: TObject);
begin
QRPreview1.ZoomToFit;
end;

procedure TF_MyPreview.SpeedButton6Click(Sender: TObject);
begin
QRPreview1.ZoomToWidth;
end;

procedure TF_MyPreview.QRPreview1PageAvailable(Sender: TObject;
PageNum: Integer);
begin
Label1.Caption := '共 '+ trim(inttostr(QRPreview1.QRPrinter.PageCount))+' 页';
end;

procedure TF_MyPreview.PrintSetBtnClick(Sender: TObject);
begin
if Printer.Printers.Count = 0 then
begin
MessageDlg('未发现打印机!',mtError,[mbOK],0);
Exit;
end;
QRPreview1.QRPrinter.PrintSetUp;
end;

procedure TF_MyPreview.PrintBtnClick(Sender: TObject);
begin
//printer_project;
if QRPreview1.QRPrinter.PrinterOK then
QRPreview1.QRPrinter.Print
//当打印不出来报表时可能用以下2行替换上一行。
//TQuickRep(QRPreview1.QRPrinter.Master).Print;
//然后在uses里加上QuickRpt。
else
showmessage('没有安装打印机');
Close;

end;

procedure TF_MyPreview.SpeedButton1Click(Sender: TObject);
begin
QRPreview1.Zoom := 100;
end;

procedure TF_MyPreview.FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
if key = VK_PRIOR then
PriorBtn.Click
else
if Key = VK_NEXT then
NextBtn.Click;
end;

end.
//U_MyPreview.dfm
object F_MyPreview: TF_MyPreview
Left = 135
Top = 109
Width = 591
Height = 406
BorderIcons = [biSystemMenu, biMaximize]
Caption = '打印预览'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
WindowState = wsMaximized
OnClose = FormClose
OnKeyDown = FormKeyDown
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 583
Height = 49
Align = alTop
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = '宋体'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
object FirstBtn: TSpeedButton
Left = 4
Top = 9
Width = 30
Height = 29
Hint = '第一页'
Glyph.Data = {
C2010000424DC20100000000000036000000280000000C0000000B0000000100
1800000000008C010000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBF0000007F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F
000000BFBFBFBFBFBF0000007F7F7FBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F0000
00000000000000BFBFBFBFBFBF0000007F7F7FBFBFBFBFBFBF7F7F7F00000000
0000000000000000000000BFBFBFBFBFBF0000007F7F7F7F7F7F000000000000
000000000000000000000000000000BFBFBFBFBFBF0000007F7F7FBFBFBFBFBF
BF7F7F7F000000000000000000000000000000BFBFBFBFBFBF0000007F7F7FBF
BFBFBFBFBFBFBFBFBFBFBF7F7F7F000000000000000000BFBFBFBFBFBF000000
7F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F000000BFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBF}
ParentShowHint = False
ShowHint = True
OnClick = FirstBtnClick
end
object PriorBtn: TSpeedButton
Left = 34
Top = 9
Width = 30
Height = 29
Hint = '上一页'
Glyph.Data = {
56010000424D560100000000000036000000280000000A000000090000000100
18000000000020010000C40E0000C40E00000000000000000000C0C0C0C0C0C0
C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C00000C0C0C0C0C0C0
C0C0C0C0C0C0C0C0C0C0C0C0C0C0C07F7F7F000000C0C0C00000C0C0C0C0C0C0
C0C0C0C0C0C0C0C0C07F7F7F000000000000000000C0C0C00000C0C0C0C0C0C0
C0C0C07F7F7F000000000000000000000000000000C0C0C00000C0C0C07F7F7F
000000000000000000000000000000000000000000C0C0C00000C0C0C0C0C0C0
C0C0C07F7F7F000000000000000000000000000000C0C0C00000C0C0C0C0C0C0
C0C0C0C0C0C0C0C0C07F7F7F000000000000000000C0C0C00000C0C0C0C0C0C0
C0C0C0C0C0C0C0C0C0C0C0C0C0C0C07F7F7F000000C0C0C00000C0C0C0C0C0C0
C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C0C00000}
ParentShowHint = False
ShowHint = True
OnClick = PriorBtnClick
end
object NextBtn: TSpeedButton
Left = 64
Top = 9
Width = 30
Height = 29
Hint = '下一页'
Glyph.Data = {
56010000424D560100000000000036000000280000000A000000090000000100
18000000000020010000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBF000000
7F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBF000000
0000000000007F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBF000000
0000000000000000000000007F7F7FBFBFBFBFBFBFBFBFBF0000BFBFBF000000
0000000000000000000000000000000000007F7F7FBFBFBF0000BFBFBF000000
0000000000000000000000007F7F7FBFBFBFBFBFBFBFBFBF0000BFBFBF000000
0000000000007F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBF000000
7F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000}
ParentShowHint = False
ShowHint = True
OnClick = NextBtnClick
end
object LastBtn: TSpeedButton
Left = 94
Top = 9
Width = 30
Height = 29
Hint = '最后一页'
Glyph.Data = {
7A010000424D7A0100000000000036000000280000000C000000090000000100
18000000000044010000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BF0000007F7F7FBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F000000BF
BFBFBFBFBF0000000000000000007F7F7FBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F
000000BFBFBFBFBFBF0000000000000000000000000000007F7F7FBFBFBFBFBF
BF7F7F7F000000BFBFBFBFBFBF00000000000000000000000000000000000000
00007F7F7F7F7F7F000000BFBFBFBFBFBF000000000000000000000000000000
7F7F7FBFBFBFBFBFBF7F7F7F000000BFBFBFBFBFBF0000000000000000007F7F
7FBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F000000BFBFBFBFBFBF0000007F7F7FBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F000000BFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF}
ParentShowHint = False
ShowHint = True
OnClick = LastBtnClick
end
object Label1: TLabel
Left = 144
Top = 9
Width = 54
Height = 14
Caption = '共 1 页'
end
object Label2: TLabel
Left = 144
Top = 25
Width = 54
Height = 14
Caption = '第 1 页'
end
object Label3: TLabel
Left = 229
Top = 7
Width = 66
Height = 12
Caption = '缩放比例(%)'
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
ParentFont = False
end
object FitBtn: TSpeedButton
Left = 366
Top = 3
Width = 47
Height = 43
Hint = '显示整个页面'
Caption = '满页'
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
Glyph.Data = {
42030000424D42030000000000003600000028000000110000000F0000000100
1800000000000C030000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBF00BFBFBFBFBFBF000000000000000000000000
000000000000000000000000000000000000000000000000000000BFBFBFBFBF
BF00BFBFBF000000808700808780808700808780808700808780808700808780
808700808780808700808780808700000000BFBFBF00BFBFBF00000080878080
8700808780000000000000000000000000000000000000000000808780808700
808780000000BFBFBF00BFBFBF000000808700808780808700000000BFBFBFBF
BFBFBFBFBFBFBFBFBFBFBF000000808700808780808700000000BFBFBF00BFBF
BF000000808780808700808780000000BFBFBF800000800000800000BFBFBF00
0000808780808700808780000000BFBFBF00BFBFBF0000008087008087808087
00000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF00000080870080878080870000
0000BFBFBF00BFBFBF000000808780808700808780000000BFBFBF8000008000
00BFBFBFBFBFBF000000808780808700808780000000BFBFBF00BFBFBF000000
808700808780808700000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000008087
00808780808700000000BFBFBF00BFBFBF000000808780808700808780000000
BFBFBF800000800000800000BFBFBF000000808780808700808780000000BFBF
BF00BFBFBF000000808700808780808700000000BFBFBFBFBFBFBFBFBFBFBFBF
BFBFBF000000808700808780808700000000BFBFBF00BFBFBF00000080878080
8700808780000000000000000000000000000000000000000000808780808700
808780000000BFBFBF00BFBFBF00000080870080878080870080878080870080
8780808700808780808700808780808700808780808700000000BFBFBF00BFBF
BFBFBFBF00000000000000000000000000000000000000000000000000000000
0000000000000000000000BFBFBFBFBFBF00BFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBF00}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = FitBtnClick
end
object SpeedButton6: TSpeedButton
Left = 413
Top = 3
Width = 47
Height = 43
Hint = '填满窗口'
Caption = '满窗'
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
Glyph.Data = {
42030000424D42030000000000003600000028000000110000000F0000000100
1800000000000C030000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBF00BFBFBFBFBFBF000000000000000000000000
000000000000000000000000000000000000000000000000000000BFBFBFBFBF
BF00BFBFBF800000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBFBF800000BFBFBFBF
BFBFBFBFBFBFBFBF000000000000000000000000000000000000BFBFBFBFBFBF
BFBFBF000000BFBFBF00BFBFBF800000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBF
BF800000BFBFBFBFBFBFBFBFBFBFBFBF000000000000000000000000000000BF
BFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBFBF800000BFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF00
0000BFBFBF00BFBFBF800000BFBFBFBFBFBF800000BFBFBF0000000000000000
00000000BFBFBFBFBFBF800000BFBFBFBFBFBF000000BFBFBF00BFBFBF800000
BFBFBF800000800000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF8000
00800000BFBFBF000000BFBFBF00BFBFBF800000800000800000800000800000
BFBFBF000000000000000000BFBFBF800000800000800000800000000000BFBF
BF00BFBFBF800000BFBFBF800000800000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBF800000800000BFBFBF000000BFBFBF00BFBFBF800000BFBFBFBF
BFBF800000BFBFBF000000000000000000000000000000BFBFBF800000BFBFBF
BFBFBF000000BFBFBF00BFBFBF800000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBF
BFBFBFBF00000000000000000000000000000000000000000000000000000000
0000000000000000000000BFBFBFBFBFBF00BFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBF00}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = SpeedButton6Click
end
object PrintSetBtn: TSpeedButton
Left = 460
Top = 3
Width = 47
Height = 43
Hint = '设置打印机'
Caption = '设置'
Font.Charset = GB2312_CHARSET
Font.Color = clNavy
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
Glyph.Data = {
EE030000424DEE03000000000000360000002800000012000000110000000100
180000000000B8030000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBFBFBFBFBFBFBF0000000000
00000000000000000000000000000000000000000000000000000000BFBFBFBF
BFBFBFBFBFBFBFBF0000BFBFBFBFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF000000BFBFBFBFBFBFBFBFBF
0000BFBFBF000000000000000000000000000000000000000000000000000000
000000000000000000000000BFBFBF000000BFBFBFBFBFBF0000BFBFBF000000
BFBFBFBFBFBF808780BFBFBFBFBFBFBFBFBF00FFFF00FFFF00FFFF808780BFBF
BF000000000000000000BFBFBFBFBFBF0000BFBFBF000000BFBFBFBFBFBF8087
80808780BFBFBFBFBFBF808780808780808780808780BFBFBF000000BFBFBF00
0000BFBFBFBFBFBF0000BFBFBF00000000000000000000000000000000000000
0000000000000000000000000000000000000000BFBFBFBFBFBF000000BFBFBF
0000BFBFBF000000BFBFBFBFBFBF808780808780808780808780BFBFBFBFBFBF
808780808780000000BFBFBF000000BFBFBF000000BFBFBF0000BFBFBFBFBFBF
000000000000000000000000000000000000000000000000000000000000BFBF
BF000000BFBFBF000000000000BFBFBF0000BFBFBFBFBFBFBFBFBF000000BFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF000000BF
BFBF000000BFBFBF0000BFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBF808700FFFF00FFFF00FFFF00000000BFBFBF
0000BFBFBFBFBFBF808780000000000000000000000000000000000000000000
000000000000FFFF00808700000000000000808780BFBFBF0000BFBFBFBFBFBF
000000FFFF00808700FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
00000000BFBFBFBFBFBFBFBFBFBFBFBF0000BFBFBFBFBFBF8087800000000000
00000000000000000000000000000000000000000000FFFF0080870000000000
0000808780BFBFBF0000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBFBF
BFBFBFBFBFBFBFBFBFBFBF808780808700FFFF00FFFF00FFFF00000000BFBFBF
0000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000000000000000000000
000000000000808780000000000000000000808780BFBFBF0000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = PrintSetBtnClick
end
object PrintBtn: TSpeedButton
Left = 507
Top = 3
Width = 47
Height = 43
Caption = '打印'
Font.Charset = GB2312_CHARSET
Font.Color = clNavy
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
Glyph.Data = {
6E040000424D6E04000000000000360000002800000014000000120000000100
18000000000038040000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000
00000000000000000000000000000000000000000000000000000000000000BF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF000000BFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF00000000000000000000000000000000
0000000000000000000000000000000000000000000000BFBFBF000000BFBFBF
BFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BF00FFFF00FFFF00FFFFBFBFBFBFBFBF000000000000000000BFBFBFBFBFBFBF
BFBFBFBFBFBFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF7F7F7F
7F7F7F7F7F7FBFBFBFBFBFBF000000BFBFBF000000BFBFBFBFBFBFBFBFBFBFBF
BFBFBFBF00000000000000000000000000000000000000000000000000000000
0000000000000000000000BFBFBFBFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBF
000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BF000000BFBFBF000000BFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF00
0000000000000000000000000000000000000000000000000000000000BFBFBF
000000BFBFBF000000000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000BFBFBF00
0000BFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000
FFFFFF000000000000000000000000000000FFFFFF0000000000000000000000
00BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000FFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000BFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000FFFFFF0000
00000000000000000000000000FFFFFF000000BFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF00000000000000000000000000
0000000000000000000000000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = PrintBtnClick
end
object SpeedButton1: TSpeedButton
Left = 319
Top = 3
Width = 47
Height = 43
Hint = '显示整个页面'
Caption = '100%'
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = '宋体'
Font.Style = [fsBold]
Glyph.Data = {
42030000424D42030000000000003600000028000000110000000F0000000100
1800000000000C030000C40E0000C40E00000000000000000000BFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBF00BFBFBFBFBFBF000000000000000000000000
000000000000000000000000000000000000000000000000000000BFBFBFBFBF
BF00BFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBFBF000000BFBFBF00
0000000000000000000000000000000000000000000000000000000000000000
BFBFBF000000BFBFBF00BFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBF
BF000000BFBFBF00000000000000000000000000000000000000000000000000
0000000000000000BFBFBF000000BFBFBF00BFBFBF000000BFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF00
0000BFBFBF00BFBFBF000000BFBFBF0000000000000000000000000000000000
00000000000000000000000000000000BFBFBF000000BFBFBF00BFBFBF000000
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBF000000BFBFBF00BFBFBF000000BFBFBF000000000000000000
000000000000000000000000000000000000000000000000BFBFBF000000BFBF
BF00BFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBFBF000000BFBFBF00
0000000000000000000000000000000000000000000000000000000000000000
BFBFBF000000BFBFBF00BFBFBF000000BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF000000BFBFBF00BFBF
BFBFBFBF00000000000000000000000000000000000000000000000000000000
0000000000000000000000BFBFBFBFBFBF00BFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBFBF
BFBFBFBFBF00}
Layout = blGlyphTop
ParentFont = False
ParentShowHint = False
ShowHint = True
OnClick = SpeedButton1Click
end
object CloseBtn: TBitBtn
Left = 562
Top = 3
Width = 47
Height = 43
Caption = '关闭'
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -12
Font.Name = '宋体'
Font.Style = []
ModalResult = 2
ParentFont = False
TabOrder = 0
Glyph.Data = {
DE010000424DDE01000000000000760000002800000024000000120000000100
0400000000006801000000000000000000001000000000000000000000000000
80000080000000808000800000008000800080800000C0C0C000808080000000
FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00388888888877
F7F787F8888888888333333F00004444400888FFF444448888888888F333FF8F
000033334D5007FFF4333388888888883338888F0000333345D50FFFF4333333
338F888F3338F33F000033334D5D0FFFF43333333388788F3338F33F00003333
45D50FEFE4333333338F878F3338F33F000033334D5D0FFFF43333333388788F
3338F33F0000333345D50FEFE4333333338F878F3338F33F000033334D5D0FFF
F43333333388788F3338F33F0000333345D50FEFE4333333338F878F3338F33F
000033334D5D0EFEF43333333388788F3338F33F0000333345D50FEFE4333333
338F878F3338F33F000033334D5D0EFEF43333333388788F3338F33F00003333
4444444444333333338F8F8FFFF8F33F00003333333333333333333333888888
8888333F00003333330000003333333333333FFFFFF3333F00003333330AAAA0
333333333333888888F3333F00003333330000003333333333338FFFF8F3333F
0000}
Layout = blGlyphTop
NumGlyphs = 2
end
object ComboBox1: TComboBox
Left = 230
Top = 21
Width = 77
Height = 22
ItemHeight = 14
MaxLength = 3
TabOrder = 1
OnChange = ComboBox1Change
OnKeyPress = ComboBox1KeyPress
Items.Strings = (
'20'
'50'
'70'
'100'
'150'
'200'
'300')
end
end
object QRPreview1: TQRPreview
Left = 0
Top = 49
Width = 583
Height = 330
HorzScrollBar.Tracking = True
VertScrollBar.Tracking = True
Align = alClient
TabOrder = 1
OnPageAvailable = QRPreview1PageAvailable
PageNumber = 1
Zoom = 100
end
object PrintDialog1: TPrintDialog
Left = 114
Top = 75
end
end


 
这样行不?
procedure TForm1.OnMyPreview(Sender: TObject);
begin
try
F_MyPreview:=TF_MyPreview.Create(Application);
except
MessageDlg('打印预览窗口已经存在,请重新启动本系统!',mtError, [mbOK], 0);
exit;
end;
F_MyPreview.QRPreview1.QRPrinter := TQRPrinter(Sender);
F_MyPreview.ShowModal;
end;
 
我按照netatom的方法,还是不行。
我奇怪的是,同样的代码,在Delphi 4能正常运行,在Delphi 5却不能。
而且如果把F_MyPreview.ShowModal;改为F_MyPreview.Show;
则报表可以在自定义窗口显示,但我要的是ShowModal形式。
D4下的ShowModal与D5下的ShowModal为什么会出现不同的效果?
 
如何改正QR这个BUG?
 
你可以让它Show,但是效果是Showmodal.
比如说在它show的时候让主窗体(或者除了self之外的窗体都)hide,
close的时候show主窗体.
猥琐了些,不过赶时间的时候还堪用.
 
要不你换一个delphi4的qr最新版本做,然后再到d5下试。
 
请问hbezwwl:哪里有delphi4的qr最新版本?
 
你直接在D5下安装不就结了,费半天事,D4做完了还要在D5下做。你要是在D6下,问题还会更多。
 
to 816
D6中为何问题更多,如何更新qr控件呀。再有我在d6中做的报表预览时正确,打印时最右
面的竖线总打不出来,换了打印机也一样。还有就是如何让qr的预览不出新窗口而是在
QRPreview控件中。
 
后退
顶部