在delphi中用自带的quickreport制作出来的preview界面是英文的,如何把它变成中文呢???(50分)

  • 主题发起人 主题发起人 leonada
  • 开始时间 开始时间
L

leonada

Unregistered / Unconfirmed
GUEST, unregistred user!
在delphi中用自带的quickreport制作出来的preview界面是英文的,如何把它变成中文呢???
 
修改其source
 
改源码?
 
我有3.0.7的源码,如果要与我联系:
mail to :loopy@netease.com
巨大无比,怕我没有耐心发。^-^
 
建form14,源码如下
unit print;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
qrprntr, Buttons, ExtCtrls, StdCtrls;
type
TForm14 = class(TForm)
Panel1: TPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
QRPreview1: TQRPreview;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form14: TForm14;
implementation
{$R *.DFM}
procedure TForm14.SpeedButton3Click(Sender: TObject);
begin
QRPreview1.QRPrinter.PrintSetup;
end;

procedure TForm14.SpeedButton4Click(Sender: TObject);
begin
close;
end;

procedure TForm14.SpeedButton1Click(Sender: TObject);
begin
QRPreview1.QRPrinter.Print;
end;

procedure TForm14.BitBtn1Click(Sender: TObject);
begin
QRPreview1.PageNumber := QRPreview1.PageNumber-1;
// UpdatePanelShow;
end;

procedure TForm14.BitBtn2Click(Sender: TObject);
begin
QRPreview1.PageNumber := QRPreview1.PageNumber+1;
end;

end.

建成表form13,这个窗口上为delphi中用自带的quickreport制作出来的preview,源码如下
unit printqr;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, Quickrpt, QRCtrls;
type
TForm13 = class(TForm)
QuickRep1 : TQuickRep;
TitleBand1 : TQRBand;
QRLabel1 : TQRLabel;
PageFooterBand1 : TQRBand;
ColumnHeaderBand1 : TQRBand;
DetailBand1 : TQRBand;
QRLabel2 : TQRLabel;
QRExpr1 : TQRExpr;
QRLabel3 : TQRLabel;
QRExpr2 : TQRExpr;
QRLabel4 : TQRLabel;
QRExpr3 : TQRExpr;
QRLabel5 : TQRLabel;
QRExpr4 : TQRExpr;
QRLabel6 : TQRLabel;
QRExpr5 : TQRExpr;
QRLabel7 : TQRLabel;
QRExpr6 : TQRExpr;
QRLabel8 : TQRLabel;
QRExpr7 : TQRExpr;
QRBand1: TQRBand;
QRLabel9: TQRLabel;
QRSysData1: TQRSysData;
QRShape1: TQRShape;
QRShape2: TQRShape;
QRShape3: TQRShape;
QRShape4: TQRShape;
QRShape5: TQRShape;
QRShape6: TQRShape;
QRShape7: TQRShape;
QRShape8: TQRShape;
QRShape9: TQRShape;
QRShape10: TQRShape;
QRShape11: TQRShape;
QRShape12: TQRShape;
QRShape13: TQRShape;
QRExpr8: TQRExpr;
QRLabel10: TQRLabel;
procedure QuickRep1Preview(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
end;

var
Form13: TForm13;
implementation
uses print;
{$R *.DFM}






procedure TForm13.QuickRep1Preview(Sender: TObject);
begin
form14.QRPreview1.QRPrinter := form13.QuickRep1.QRPrinter;
form14.Show;
end;

procedure TForm13.FormCreate(Sender: TObject);
begin
shortdateformat:='yyyy-mm-dd';
end;

end.
 
1.打开你的Delphi目录下的/lib/qrprev.dfm文件,你就看到了默认quickrep预览窗口文件,
你可以把那里面的一些英文信息改成中文的,然后存盘,从编译你的程序,就行了...
2.你自己做一个预览窗体...
 
从新建一个预览窗口,方法见帮助
 
源码可以从www.yesky.com上获得!
 
别见怪,献丑了。
升级到3.07(大小844K)后,打开C:/Program Files/Borland/Delphi5/quickrpt/ Qrprev.pas ,
然后设计界面,ToolButton的HIT信息改为中文,
另外你还可以将ExitButton(Close)按钮删掉,自己建一BitBtn1(关闭(C))按钮,这样
还可以加图象,太酷了。最后在窗体上单击鼠标右键弹出菜单选择‘View as text'项,
复制全部代码,将Qrprev.dfm文件中的代码覆盖掉,再Preview 你就成功了。
 
你可uses以下单元文件
unit Preview;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, ToolWin, QRPrntr, ImgList;
type
TMyPreviewForm = class(TForm)
CoolBar1: TCoolBar;
StatusBar1: TStatusBar;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton3: TToolButton;
ToolButton5: TToolButton;
ToolButton7: TToolButton;
ToolButton9: TToolButton;
ToolButton13: TToolButton;
ToolButton15: TToolButton;
ToolButton17: TToolButton;
ToolButton19: TToolButton;
ToolButton21: TToolButton;
ToolButton2: TToolButton;
QRPreview: TQRPreview;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
ToolButton4: TToolButton;
ToolButton6: TToolButton;
procedure QRPreviewPageAvailable(Sender: TObject;
PageNum: Integer);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
procedure ToolButton7Click(Sender: TObject);
procedure ToolButton9Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure ToolButton13Click(Sender: TObject);
procedure ToolButton15Click(Sender: TObject);
procedure ToolButton17Click(Sender: TObject);
procedure ToolButton19Click(Sender: TObject);
procedure ToolButton21Click(Sender: TObject);
procedure ToolButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
MyPreviewForm: TMyPreviewForm;
implementation
{$R *.DFM}
procedure TMyPreviewForm.QRPreviewPageAvailable(Sender: TObject;
PageNum: Integer);
begin
self.StatusBar1.Panels[3].Text:='总共有:'+IntToStr(QRPreview.QRPrinter.PageCount)+'页';
end;

procedure TMyPreviewForm.ToolButton1Click(Sender: TObject);
begin

QRPreview.ZoomToFit;
end;

procedure TMyPreviewForm.ToolButton3Click(Sender: TObject);
begin
QRPreview.Zoom:=100;
end;

procedure TMyPreviewForm.ToolButton5Click(Sender: TObject);
begin
QRPreview.ZoomToWidth ;
end;

procedure TMyPreviewForm.ToolButton7Click(Sender: TObject);
begin
QRPreview.PageNumber :=1;
self.StatusBar1.Panels[2].Text:= '当前页码:第1页';
end;

procedure TMyPreviewForm.ToolButton9Click(Sender: TObject);
begin
if QRPreview.PageNumber >1 then
begin
QRPreview.PageNumber:=QRPreview.PageNumber -1;
self.StatusBar1.Panels[2].Text:= '当前页码为:第'+intToStr(QRPreview.pageNumber)+'页';
end;
end;

procedure TMyPreviewForm.ToolButton2Click(Sender: TObject);
begin
if QRPreview.PageNumber<QRPreview.QRPrinter.PageCount then
begin
QRPreview.PageNumber:=QRPreview.PageNumber +1;
self.StatusBar1.Panels[2].Text:= '当前页码为:第'+intToStr(QRPreview.pageNumber)+'页';
end;
end;

procedure TMyPreviewForm.ToolButton13Click(Sender: TObject);
begin
QRPreview.PageNumber:=QRPreview.QRPrinter.PageCount;
self.StatusBar1.Panels[2].Text:= '当前页码为:第'+intToStr(QRPreview.pageNumber)+'页';
end;

procedure TMyPreviewForm.ToolButton15Click(Sender: TObject);
begin
if Opendialog1.execute then
QRPreview.QRPrinter.Load(Opendialog1.FileName);
end;

procedure TMyPreviewForm.ToolButton17Click(Sender: TObject);
begin
if Savedialog1.Execute then
QRPreview.QRPrinter.Save(savedialog1.FileName);
end;

procedure TMyPreviewForm.ToolButton19Click(Sender: TObject);
begin
QRPreview.QRPrinter.PrintSetup ;
end;

procedure TMyPreviewForm.ToolButton21Click(Sender: TObject);
begin
QRPreview.QRPrinter.Print ;
end;

procedure TMyPreviewForm.ToolButton4Click(Sender: TObject);
begin
Close;
end;

end.
然后在你所要引用的文件中加入以下代码:
procedure Tqrform.QuickRep1Preview(Sender: TObject);
begin
MyPreviewForm.QRpreview.QRprinter:=QuickRep1.QRprinter;
MyPreviewForm.Show;
end;
 
然后在你所要引用的文件中加入以下代码:
procedure Tqrform.QuickRep1Preview(Sender: TObject);
begin
MyPreviewForm.QRpreview.QRprinter:=QuickRep1.QRprinter;
MyPreviewForm.Show;
end;
 
多人接受答案了。
 
后退
顶部