📄 repoedit.pas
字号:
if FieldByname('Font.Style.IsStrikeOut').AsBoolean then ThFst:=ThFST+[fsStrikeOut];
(ThComp as TQRCustomRichText).Font.Style:=ThFST;
if not FieldByname('Color').IsNull
then (ThComp as TQRCustomRichText).Color:=TColor(FieldByname('Color').AsInteger);
if not FieldByname('Alignment').IsNull
then (ThComp as TQRCustomRichText).Alignment:=TAlignment(FieldByname('Alignment').AsInteger);
if not FieldByname('Stretch').IsNull
then (ThComp as TQRCustomRichText).AutoStretch:=FieldByname('Stretch').AsBoolean;
if (ThComp is TQRRichText) then begin
ThFileName:=VALUES['LINES'];
SetDopParam(ThComp,'LINES',thFileName);
if (ThFileName<>'') and FileExists(ThFileName) then
try
(ThComp as TQRRichText).LINES.Clear;
(ThComp as TQRRichText).LINES.LoadFromFile(thfileName);
except
on E:exception do
bvMessError('Cannot open file'+#13+
'Message: '+e.Message);
end;
end;
end
else if (ThComp is TQRImage) then begin
if not FieldByname('Stretch').IsNull
then (ThComp as TQRImage).Stretch:=FieldByname('Stretch').AsBoolean;
if not FieldByname('AutoSize').IsNull
then (ThComp as TQRImage).AutoSize:=FieldByname('AutoSize').AsBoolean;
if Values['CENTER']<>''
then (ThComp as TQRIMAGE).CENTER:=GetBool(Values['CENTER']);
if Values['PICTURE']<>''
then begin
ThFileName:=Values['PICTURE'];
SetDopParam(ThComp,'PICTURE',ThFileName);
if FileExists(ThFileName) then
try
(ThComp as TQRIMAGE).Picture.LoadFromFile(ThFileName);
except
end;
end
end
else if (ThComp is TQRDBImage) then begin
if not FieldByname('Stretch').IsNull
then (ThComp as TQRDBImage).Stretch:=FieldByname('Stretch').AsBoolean;
if not FieldByname('AutoSize').IsNull
then (ThComp as TQRImage).AutoSize:=FieldByname('AutoSize').AsBoolean;
if VALUES['CENTER']<>''
then (ThComp as TQRDBImage).CENTER:=getbool(VALUES['CENTER']);
if VALUES['FIELD']<>''
then (ThComp as TQRDBIMAGE).DataField:=VALUES['FIELD'];
end
else if (ThComp is TQRShape) then begin
if VALUES['SHAPE']<>''
then (ThComp as TQRSHAPE).Shape:=TQRShapeType(GetInt(VALUES['SHAPE']));
if VALUES['PEN.COLOR']<>''
then (ThComp as TQRSHAPE).Pen.Color:=TColor(Getint(VALUES['PEN.COLOR']));
if VALUES['PEN.MODE']<>''
then (ThComp as TQRSHAPE).Pen.Mode:=TPenMode(getInt(VALUES['PEN.MODE']));
if VALUES['PEN.STYLE']<>''
then (ThComp as TQRSHAPE).Pen.style:=TPenStyle(GETInt(Values['PEN.STYLE']));
if VALUES['PEN.WIDTH']<>''
then (ThComp as TQRSHAPE).Pen.Width:=GEtInt(Values['PEN.WIDTH']);
end
end
else if (ThComp is TQRBasePanel) then begin
if not fieldByname('Frame.Color').IsNULL
then (ThComp as TQRBasePanel).Frame.Color:=TColor(FieldByName('Frame.Color').AsInteger);
if not fieldByname('Frame.DrawBottom').IsNULL
then (ThComp as TQRBasePanel).Frame.DrawBottom:=FieldByName('Frame.DrawBottom').AsBoolean;
if not fieldByname('Frame.DrawLeft').IsNULL
then (ThComp as TQRBasePanel).Frame.DrawLeft:=FieldByName('Frame.DrawLeft').AsBoolean;
if not fieldByname('Frame.DrawTop').IsNULL
then (ThComp as TQRBasePanel).Frame.DrawTop:=FieldByName('Frame.DrawTop').AsBoolean;
if not fieldByname('Frame.DrawRight').IsNULL
then (ThComp as TQRBasePanel).Frame.DrawRight:=FieldByName('Frame.DrawRight').AsBoolean;
if not fieldByname('Frame.Width').IsNULL
then (ThComp as TQRBasePanel).Frame.Width:=FieldByName('Frame.Width').AsInteger;
if not fieldByname('Frame.Style').IsNULL
then (ThComp as TQRBasePanel).Frame.Style:=TPenStyle(FieldByName('Frame.Style').AsInteger);
if (ThComp is TQuickRep) then begin
if not FieldByname('Font.Charset').IsNull
then (ThComp as TQuickRep).Font.Charset:=TFontCharSet(FieldByname('Font.Charset').AsInteger);
if not FieldByname('Font.Color').IsNull
then (ThComp as TQuickRep).Font.Color:=TColor(FieldByname('Font.Color').AsInteger);
if not FieldByname('Font.Height').IsNull
then (ThComp as TQuickRep).Font.Height:=FieldByname('Font.Height').AsInteger;
if not FieldByname('Font.Name').IsNull
then (ThComp as TQuickRep).Font.Name:=FieldByname('Font.Name').AsString;
if not FieldByname('Font.Pitch').IsNull
then (ThComp as TQuickRep).Font.Pitch:=TFontPitch(FieldByname('Font.Pitch').AsInteger);
if not FieldByname('Font.Size').IsNull
then (ThComp as TQuickRep).Font.Size:=FieldByname('Font.Size').AsInteger;
ThFSt:=[];
if FieldByname('Font.Style.IsBold').AsBoolean=true then ThFst:=ThFST+[fsBold];
if FieldByname('Font.Style.IsItalic').AsBoolean=true then ThFst:=ThFST+[fsItalic];
if FieldByname('Font.Style.IsUnderline').AsBoolean=true then ThFst:=ThFST+[fsUnderLine];
if FieldByname('Font.Style.IsStrikeOut').AsBoolean=true then ThFst:=ThFST+[fsStrikeOut];
(ThComp as TQuickRep).Font.Style:=ThFST;
end
else if (ThComp is TQRCustomBand) then begin
if not FieldByname('Font.Charset').IsNull
then (ThComp as TQRCustomBand).Font.Charset:=TFontCharSet(FieldByname('Font.Charset').AsInteger);
if not FieldByname('Font.Color').IsNull
then (ThComp as TQRCustomBand).Font.Color:=TColor(FieldByname('Font.Color').AsInteger);
if not FieldByname('Font.Height').IsNull
then (ThComp as TQRCustomBand).Font.Height:=FieldByname('Font.Height').AsInteger;
if not FieldByname('Font.Name').IsNull
then (ThComp as TQRCustomBand).Font.Name:=FieldByname('Font.Name').AsString;
if not FieldByname('Font.Pitch').IsNull
then (ThComp as TQRCustomBand).Font.Pitch:=TFontPitch(FieldByname('Font.Pitch').AsInteger);
if not FieldByname('Font.Size').IsNull
then (ThComp as TQRCustomBand).Font.Size:=FieldByname('Font.Size').AsInteger;
if not FieldByname('Alignment').IsNull
then (ThComp as TQRCustomBand).Aligntobottom:=Boolean(FieldByname('Alignment').AsInteger);
ThFSt:=[];
if FieldByname('Font.Style.IsBold').AsBoolean then ThFst:=ThFST+[fsBold];
if FieldByname('Font.Style.IsItalic').AsBoolean then ThFst:=ThFST+[fsItalic];
if FieldByname('Font.Style.IsUnderline').AsBoolean then ThFst:=ThFST+[fsUnderLine];
if FieldByname('Font.Style.IsStrikeOut').AsBoolean then ThFst:=ThFST+[fsStrikeOut];
(ThComp as TQRCustomBand).Font.Style:=ThFST;
if not FieldByname('Color').IsNull
then (ThComp as TQRCustomBand).Color:=TColor(FieldByname('Color').AsInteger);
if VALUES['FORCENEWCOLUMN']<>''
then (ThComp as TQRCustomBand).ForceNewColumn:=GetBool(VALUES['FORCENEWCOLUMN']);
if VALUES['FORCENEWPAGE']<>''
then (ThComp as TQRCustomBand).ForceNewPAGE:=GETBOOL(VALUES['FORCENEWPAGE']);
if VALUES['BANDTYPE']<>''
then (ThComp as TQRCustomBand).BandType:=TQRBandType(GETINT(VALUES['BANDTYPE']));
end;
end;
end;
end;
Next;
end;
end;
finally
free;
end;
end;
procedure TRepoEdit.SaveReport;
var
// BoolVal:boolean;
i:integer;
ThComp:TComponent;
begin
// ThID:=-1;
IniCheck;
DeleteSavedReport(false);
if Assigned(AppendObj) then begin
AppendObj.free;
AppendObj:=nil;
end;
with TaREPORT do begin
SetKey;
TarepNameForm.AsString:=CorrectName;
TaRepNameComp.AsString:=ThReport.Name+VariantStr;
if Gotokey then begin
Edit;
FieldByname('Enabled').AsBoolean:=Enabled;
// Post;
end
else begin
insert;
TaRepNameForm.AsString:=CorrectName;
TaRepNameComp.AsString:=ThReport.Name+VariantStr;
fieldByname('Enabled').AsBoolean:=Enabled;
// post;
// FlushBuffers;
end;
end;
try
if Enabled then with TStringList.Create do
try
SetText(pchar(TaRepValue.Value));
Values['ZOOM']:= inttostr(ThReport.Zoom);
Values['PAGE.BOTTOMMARGIN']:=floattostr(ThReport.PAGE.BOTTOMMARGIN);
Values['PAGE.LEFTMARGIN']:=FloatToStr(ThReport.PAGE.LEFTMARGIN);
Values['PAGE.TOPMARGIN']:=FloatToStr(ThReport.PAGE.TOPMARGIN);
Values['PAGE.RIGHTMARGIN']:=floattostr(ThReport.PAGE.RIGHTMARGIN);
Values['PAGE.COLUMNSPACE']:=floattostr(ThReport.PAGE.COLUMNSPACE);
Values['PAGE.LENGTH']:=floatTostr(ThReport.PAGE.LENGTH);
Values['PAGE.WIDTH']:=floattostr(ThReport.PAGE.WIDTH);
Values['PAGE.ORIENTATION']:=setInt(ord(ThReport.PAGE.ORIENTATION));
Values['PAGE.PAPERSIZE']:=inttostr(ORD(ThReport.PAGE.PAPERSIZE));
Values['PAGE.RULER']:=SetBool(ThReport.PAGE.RULER);
Values['PAGE.COLUMNS']:=inttostr(ThReport.PAGE.COLUMNS);
Values['PRINTERSETTINGS.COPIES']:=inttostr(ThReport.PRINTERSETTINGS.COPIES);
Values['PRINTERSETTINGS.FIRSTPAGE']:=inttostr(ThReport.PRINTERSETTINGS.FIRSTPAGE);
Values['PRINTERSETTINGS.LASTPAGE']:=inttostr(ThReport.PRINTERSETTINGS.LASTPAGE);
Values['PRINTERSETTINGS.OUTPUTBIN']:=inttostr(ORD(ThReport.PRINTERSETTINGS.OUTPUTBIN));
Values['PRINTERSETTINGS.DUPLEX']:=SetBool(ThReport.PRINTERSETTINGS.Duplex);
Values['PRINTIFEMPTY']:=SetBool(ThReport.PRINTIFEMPTY);
Values['SNAPTOGRID']:=SetBool(ThReport.SNAPTOGRID);
Values['UNITS']:=inttostr(ord(ThReport.Units));
TaRepValue.Value:=Text;
TaReport.Post;
for i:=-1 to MainWin.ComponentCount-1 do with TaReport do begin
if i=-1 then ThComp:=ThReport
else if (MainWin.Components[i] is tqrPrintable
or (MainWin.Components[i] is tqrBasePanel))
and not
((pos('New_',MainWin.Components[i].Name)=1)
and (mainWin.components[i] is TWinControl)
and not Assigned((MainWin.Components[i] as TWinControl).PARENT))
then ThComp:=MainWin.Components[i]
else thComp:=nil;
if Assigned(thComp) then begin
Setkey;
TaRepNAMEFORM.AsString:=CorrectName;
TaRepNAMECOMP.AsString:=ThComp.Name+VariantStr;
if not Gotokey then begin
insert;
TaRepNAMEFORM.AsString:=CorrectName;
TaRepNAMECOMP.AsString:=ThComp.Name+VariantStr;
end
else Edit;
SetText(pchar(TaRepValue.Value));
if Not (ThComp is TQuickRep) then begin
FieldByName('TOP').AsInteger:=(ThComp as TCustomControl).Top;
fieldByname('LEFT').AsInteger:=(ThComp as TCustomControl).LEFT;
fieldByname('WIDTH').AsInteger:=(ThComp as TCustomControl).Width;
fieldByname('HEIGHT').AsInteger:=(ThComp as TCustomControl).HEIGHT;
fieldByname('ENABLED').AsBoolean:=(ThComp as TCustomControl).Enabled;
end;
if (pos('New_',ThComp.Name)=1) then begin //NewComponent
values['TYPE']:=UpperCase(ThComp.ClassName);
values['PARENT']:=UpperCase((ThComp as TWinControl).PARENT.NAME);
end;
if ThComp is TQrPrintable then begin
fieldByname('Frame.Color').AsInteger:=ORD((ThComp as TQRPrintable).Frame.Color);
fieldByname('Frame.DrawBottom').AsBoolean:=(ThComp as TQRPrintable).Frame.DrawBottom;
fieldByname('Frame.DrawLeft').AsBoolean:=(ThComp as TQRPrintable).Frame.DrawLeft;
FieldByName('Frame.DrawTop').AsBoolean:=(ThComp as TQRPrintable).Frame.DrawTop;
FieldByName('Frame.DrawRight').AsBoolean:=(ThComp as TQRPrintable).Frame.DrawRight;
FieldByName('Frame.Width').AsInteger:=(ThComp as TQRPrintable).Frame.Width;
FieldByName('Frame.Style').AsInteger:=ORD((ThComp as TQRPrintable).Frame.Style);
values['BRUSH.COLOR']:=Inttostr(ORD((ThComp as TQRPRINTABLE).Brush.Color));
values['BRUSH.STYLE']:=Inttostr(ORD((ThComp as TQRPRINTABLE).Brush.STYLE));
if (ThComp is TQRCustomlabel) then begin
FieldByname('Color').AsInteger:=ORD((ThComp as TQRCustomLabel).Color);
FieldByname('Alignment').AsInteger:=ORD((ThComp as TQRCustomLabel).Alignment);
FieldByname('AutoSize').AsBoolean:=(ThComp as TQRCustomLabel).AutoSize;
FieldByname('Stretch').AsBoolean:=(ThComp as TQRCustomLabel).AutoStretch;
FieldByname('Font.Charset').AsInteger:=ORD((ThComp as TQRCustomLabel).Font.Charset);
FieldByname('Font.Color').AsInteger:=ORD((ThComp as TQRCustomLabel).Font.Color);
FieldByname('Font.Height').AsInteger:=(ThComp as TQRCustomLabel).Font.Height;
FieldByname('Font.Name').AsString:=(ThComp as TQRCustomLabel).Font.Name;
FieldByname('Font.Pitch').AsInteger:=ORD((ThComp as TQRCustomLabel).Font.Pitch);
FieldByname('Font.Size').AsInteger:=(ThComp as TQRCustomLabel).Font.Size;
FieldByname('WordWrap').AsBoolean:=(ThComp as TQRCustomLabel).WordWrap;
FieldByname('Font.Style.IsBold').AsBoolean:=fsBold in (ThComp as TQRCustomLabel).Font.Style;
FieldByname('Font.Style.IsItalic').AsBoolean:=fsItalic in (ThComp as TQRCustomLabel).Font.Style;
FieldByname('Font.Style.IsUnderline').AsBoolean:=fsUnderLine in (ThComp as TQRCustomLabel).Font.Style;
FieldByname('Font.Style.IsStrikeOut').AsBoolean:=fsStrikeOut in (ThComp as TQRCustomLabel).Font.Style;
if thComp is TQRlabel then begin
FieldByname('Transparent').AsBoolean:=(ThComp as TQRLabel).Transparent;
Values['CAPTION']:=(ThComp as TQRlabel).CAPTION;
end
else if thComp is TQRDBText then begin
FieldByname('Transparent').AsBoolean:=(ThComp as TQRDBText).Transparent;
Values['MASK']:=(ThComp as TQRDBText).MASK;
Values['FIELD']:=(ThComp as TQRDBTEXT).DATAField;
end
else if thComp is TQRMemo then begin
FieldByname('Transparent').asboolean:=(ThComp as TQRMemo).Transparent;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -