hfghfghfg (2003-03-17 13:13:00)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QuickRpt, QRCtrls, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
Button1: TButton;
procedure QRLabel1Print(sender: TObject;
var Value: string);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.QRLabel1Print(sender: TObject;
var Value: string);
var
str: widestring;
nowstr: string;
i: integer;
begin
self.Font := TQRLabel(sender).Font;
str := Value;
Value := '';
nowstr := '';
for i := 1 to length(str)do
begin
if Canvas.TextWidth(nowstr + str) > TQRLabel(sender).Width then
begin
nowstr := '';
Value := Value + #13;
nowstr := nowstr + str;
Value := Value + str;
end
else
begin
nowstr := nowstr + str;
Value := Value + str;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview;
end;
end.
hfghfghfg (2003-03-17 13:16:00)
object Form1: TForm1
Left = 192
Top = 107
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
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = 160
Top = 32
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'
'''''')
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 TitleBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 203
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 = (
537.104166666667
1899.70833333333)
BandType = rbTitle
object QRLabel1: TQRLabel
Left = 32
Top = 0
Width = 89
Height = 185
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
489.479166666667
84.6666666666667
0
235.479166666667)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = False
AutoStretch = False
Caption =
'QRLabel1QRLabel1QRLabel1QRLabel1QRLabel1QRLabel1QRLabel1QRLabel1' +
'QRLabel1QR哈哈哈哈哈哈哈哈哈哈Label1'
Color = clWhite
OnPrint = QRLabel1Print
Transparent = False
WordWrap = True
FontSize = 10
end
end
end
object Button1: TButton
Left = 40
Top = 32
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
end
hfghfghfg (2003-03-17 13:23:00)
RM_Pgopt.pas