mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 17:22:11 +02:00
LazReport: support for http links and print ranges on exported data to xls/xslx/odf formats, patch from Aleksey Lagunov
git-svn-id: trunk@51641 -
This commit is contained in:
parent
7dfb0bf8fc
commit
8b3dc8d735
@ -7,7 +7,7 @@
|
||||
<KeyWords Value=""/>
|
||||
<Comments Value=""/>
|
||||
<ReportCreateDate Value="2015-08-03 16:39:16"/>
|
||||
<ReportLastChange Value="2015-08-06 10:43:35"/>
|
||||
<ReportLastChange Value="2016-02-10 10:30:44"/>
|
||||
<ReportVersionBuild Value=""/>
|
||||
<ReportVersionMajor Value=""/>
|
||||
<ReportVersionMinor Value=""/>
|
||||
@ -243,7 +243,7 @@
|
||||
<LineSpacing Value="2"/>
|
||||
</Data>
|
||||
<Tag Value=""/>
|
||||
<FURLInfo Value=""/>
|
||||
<FURLInfo Value="http://www.lazarus-ide.org/"/>
|
||||
<Font>
|
||||
<Name Value="helvetica [urw]"/>
|
||||
<Size Value="10"/>
|
||||
|
@ -7,15 +7,15 @@ object Form1: TForm1
|
||||
ClientHeight = 267
|
||||
ClientWidth = 490
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.5'
|
||||
LCLVersion = '1.7'
|
||||
object Button1: TButton
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Button2
|
||||
Left = 75
|
||||
Height = 20
|
||||
Top = 123
|
||||
Width = 112
|
||||
Left = 93
|
||||
Height = 32
|
||||
Top = 117
|
||||
Width = 100
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 6
|
||||
@ -28,10 +28,10 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 193
|
||||
Height = 20
|
||||
Top = 123
|
||||
Width = 104
|
||||
Left = 199
|
||||
Height = 32
|
||||
Top = 117
|
||||
Width = 93
|
||||
AutoSize = True
|
||||
Caption = 'Show report'
|
||||
OnClick = Button2Click
|
||||
@ -42,10 +42,10 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 303
|
||||
Height = 20
|
||||
Top = 123
|
||||
Width = 110
|
||||
Left = 298
|
||||
Height = 32
|
||||
Top = 117
|
||||
Width = 99
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Export report'
|
||||
@ -57,10 +57,10 @@ object Form1: TForm1
|
||||
AnchorSideTop.Control = Button2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Button2
|
||||
Left = 75
|
||||
Height = 20
|
||||
Top = 149
|
||||
Width = 112
|
||||
Left = 93
|
||||
Height = 32
|
||||
Top = 155
|
||||
Width = 100
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
@ -75,10 +75,10 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = Button2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 303
|
||||
Height = 20
|
||||
Top = 149
|
||||
Width = 110
|
||||
Left = 298
|
||||
Height = 32
|
||||
Top = 155
|
||||
Width = 99
|
||||
AutoSize = True
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
@ -92,10 +92,10 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = Button2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 193
|
||||
Height = 20
|
||||
Top = 149
|
||||
Width = 104
|
||||
Left = 199
|
||||
Height = 32
|
||||
Top = 155
|
||||
Width = 93
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 6
|
||||
Caption = 'Show report'
|
||||
@ -107,9 +107,9 @@ object Form1: TForm1
|
||||
AnchorSideBottom.Control = Button1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 16
|
||||
Top = 127
|
||||
Width = 54
|
||||
Height = 20
|
||||
Top = 129
|
||||
Width = 55
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Demo 1:'
|
||||
@ -120,9 +120,9 @@ object Form1: TForm1
|
||||
AnchorSideBottom.Control = Button3
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 16
|
||||
Top = 153
|
||||
Width = 54
|
||||
Height = 20
|
||||
Top = 167
|
||||
Width = 55
|
||||
Anchors = [akLeft, akBottom]
|
||||
BorderSpacing.Left = 6
|
||||
Caption = 'Demo 2:'
|
||||
@ -132,10 +132,10 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideLeft.Side = asrCenter
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 178
|
||||
Height = 76
|
||||
Left = 176
|
||||
Height = 94
|
||||
Top = 0
|
||||
Width = 134
|
||||
Width = 139
|
||||
AutoFill = True
|
||||
AutoSize = True
|
||||
Caption = 'File format'
|
||||
@ -146,8 +146,8 @@ object Form1: TForm1
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 1
|
||||
ClientHeight = 54
|
||||
ClientWidth = 126
|
||||
ClientHeight = 72
|
||||
ClientWidth = 135
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Export to ODS'
|
||||
@ -174,7 +174,8 @@ object Form1: TForm1
|
||||
OpenAfterExport = True
|
||||
DeleteEmptyRow = False
|
||||
MergeCell = True
|
||||
ShowSetupForm = False
|
||||
ShowSetupForm = True
|
||||
ExportURL = True
|
||||
left = 232
|
||||
top = 24
|
||||
end
|
||||
|
@ -52,6 +52,10 @@ msgstr ""
|
||||
msgid "Export pictures"
|
||||
msgstr "Bilder exportieren"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportprintrange
|
||||
msgid "Export print range"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportsettings
|
||||
msgid "Export settings"
|
||||
msgstr "Exporteinstellungen"
|
||||
@ -60,6 +64,10 @@ msgstr "Exporteinstellungen"
|
||||
msgid "Export to spreadsheet"
|
||||
msgstr "In Tabellenkalkulation exportieren"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexporturl
|
||||
msgid "Export URL"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sgeneral
|
||||
msgid "General"
|
||||
msgstr "Allgemein"
|
||||
@ -99,3 +107,4 @@ msgstr "Seiten:"
|
||||
#: le_e_spreadsheet_consts.sreportpagename
|
||||
msgid "Report"
|
||||
msgstr "Report"
|
||||
|
||||
|
@ -51,6 +51,10 @@ msgstr ""
|
||||
msgid "Export pictures"
|
||||
msgstr "Exporter les images"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportprintrange
|
||||
msgid "Export print range"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportsettings
|
||||
msgid "Export settings"
|
||||
msgstr "Exporter les paramètres"
|
||||
@ -59,6 +63,10 @@ msgstr "Exporter les paramètres"
|
||||
msgid "Export to spreadsheet"
|
||||
msgstr "Exporter vers la feuille de calcul"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexporturl
|
||||
msgid "Export URL"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sgeneral
|
||||
msgid "General"
|
||||
msgstr "Général"
|
||||
|
@ -51,6 +51,10 @@ msgstr ""
|
||||
msgid "Export pictures"
|
||||
msgstr "Képek exportálása"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportprintrange
|
||||
msgid "Export print range"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportsettings
|
||||
msgid "Export settings"
|
||||
msgstr "Exportálás beállításai"
|
||||
@ -59,6 +63,10 @@ msgstr "Exportálás beállításai"
|
||||
msgid "Export to spreadsheet"
|
||||
msgstr "Exportálás táblázatba"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexporturl
|
||||
msgid "Export URL"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sgeneral
|
||||
msgid "General"
|
||||
msgstr "Általános"
|
||||
|
@ -39,6 +39,10 @@ msgstr ""
|
||||
msgid "Export pictures"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportprintrange
|
||||
msgid "Export print range"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportsettings
|
||||
msgid "Export settings"
|
||||
msgstr ""
|
||||
@ -47,6 +51,10 @@ msgstr ""
|
||||
msgid "Export to spreadsheet"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sexporturl
|
||||
msgid "Export URL"
|
||||
msgstr ""
|
||||
|
||||
#: le_e_spreadsheet_consts.sgeneral
|
||||
msgid "General"
|
||||
msgstr ""
|
||||
|
@ -51,6 +51,10 @@ msgstr ""
|
||||
msgid "Export pictures"
|
||||
msgstr "Экспортировать изображения"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportprintrange
|
||||
msgid "Export print range"
|
||||
msgstr "Экспорт диапазона печати"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexportsettings
|
||||
msgid "Export settings"
|
||||
msgstr "Параметры экспорта"
|
||||
@ -59,6 +63,10 @@ msgstr "Параметры экспорта"
|
||||
msgid "Export to spreadsheet"
|
||||
msgstr "Экспорт в электронную таблицу"
|
||||
|
||||
#: le_e_spreadsheet_consts.sexporturl
|
||||
msgid "Export URL"
|
||||
msgstr "Экспорт HTTP адресов"
|
||||
|
||||
#: le_e_spreadsheet_consts.sgeneral
|
||||
msgid "General"
|
||||
msgstr "Общие"
|
||||
|
@ -51,6 +51,8 @@ type
|
||||
FDataGroupingChunks: integer;
|
||||
FDeleteEmptyRow: boolean;
|
||||
FExportMatrix:TExportMatrix;
|
||||
FExportPrintRange: boolean;
|
||||
FExportURL: boolean;
|
||||
FMergeCell: boolean;
|
||||
FOpenAfterExport: boolean;
|
||||
FWorkbook:TsWorkbook;
|
||||
@ -63,6 +65,7 @@ type
|
||||
FTmpTextHeight: Double;
|
||||
procedure ExportColWidth;
|
||||
procedure ExportRowHight;
|
||||
procedure DoExportPrintRange;
|
||||
//procedure ExportData;
|
||||
procedure ExportData1;
|
||||
|
||||
@ -94,11 +97,14 @@ type
|
||||
property OpenAfterExport:boolean read FOpenAfterExport write FOpenAfterExport;
|
||||
property DeleteEmptyRow:boolean read FDeleteEmptyRow write FDeleteEmptyRow;
|
||||
property MergeCell:boolean read FMergeCell write FMergeCell;
|
||||
property ExportURL:boolean read FExportURL write FExportURL;
|
||||
property ExportPrintRange:boolean read FExportPrintRange write FExportPrintRange;
|
||||
end;
|
||||
|
||||
implementation
|
||||
uses LCLType, le_e_spreadsheet_params, fpsTypes, fpsutils, LazUTF8Classes, Forms, Controls,
|
||||
LCLIntf, LazFileUtils, le_e_spreadsheet_consts, lrSpreadSheetExp, math;
|
||||
uses LCLType, le_e_spreadsheet_params, fpsTypes, fpsutils, fpsAllFormats,
|
||||
LazUTF8Classes, Forms, Controls, LCLIntf, LazFileUtils, le_e_spreadsheet_consts,
|
||||
lrSpreadSheetExp, math;
|
||||
|
||||
const
|
||||
ssAligns : array [TAlignment] of TsHorAlignment = (haLeft, haRight, haCenter);
|
||||
@ -124,6 +130,56 @@ begin
|
||||
FWorksheet.WriteRowHeight(i, FExportMatrix.RowHiht[i] / FTmpTextHeight);
|
||||
end;
|
||||
|
||||
procedure TlrSpreadSheetExportFilter.DoExportPrintRange;
|
||||
var
|
||||
X1, Y1, X2, Y2, R, C: Integer;
|
||||
Row: TExportRow;
|
||||
Cel: TExportObject;
|
||||
begin
|
||||
X1:=MaxInt;
|
||||
Y1:=MaxInt;
|
||||
X2:=-1;
|
||||
Y2:=-1;
|
||||
for R:=0 to FExportMatrix.Rows.Count-1 do
|
||||
begin
|
||||
Row:=TExportRow(FExportMatrix.Rows[R]);
|
||||
for C:=0 to Row.Cells.Count-1 do
|
||||
begin
|
||||
Cel:=TExportObject(Row.Cells[C]);
|
||||
if Assigned(Cel) then
|
||||
begin
|
||||
if Cel.Col < X1 then
|
||||
X1:=Cel.Col;
|
||||
if Cel.Row < Y1 then
|
||||
Y1:=Cel.Row;
|
||||
|
||||
//MERG!
|
||||
if (Cel.Col < Cel.MergedCol) then
|
||||
begin
|
||||
if Cel.MergedCol > X2 then
|
||||
X2:=Cel.MergedCol;
|
||||
end
|
||||
else
|
||||
if Cel.Col > X2 then
|
||||
X2:=Cel.Col;
|
||||
|
||||
|
||||
if (Cel.Row < Cel.MergedRow) then
|
||||
begin
|
||||
if Cel.MergedRow > Y2 then
|
||||
Y2:=Cel.MergedRow;
|
||||
end
|
||||
else
|
||||
if Cel.Row > Y2 then
|
||||
Y2:=Cel.Row;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if (X1>0) and (Y1>0) and (X2>X1) and (Y2>Y1) then
|
||||
FWorksheet.AddPrintRange(Y1, X1, Y2, X2);
|
||||
end;
|
||||
|
||||
function sftofs(AFont:TFont):TsFontStyles;
|
||||
begin
|
||||
Result:=[];
|
||||
@ -263,6 +319,9 @@ begin
|
||||
|
||||
if scFrm <> [] then
|
||||
FWorksheet.WriteBorders(Y, X, scFrm);
|
||||
|
||||
if FExportURL and (Cel.URLInfo <> '') then
|
||||
FWorksheet.WriteHyperlink(Y, X, Cel.URLInfo, Cel.URLInfo);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -279,10 +338,13 @@ begin
|
||||
S:=sReportPageName;
|
||||
|
||||
FWorksheet := FWorkbook.AddWorksheet(S);
|
||||
|
||||
ExportColWidth;
|
||||
ExportRowHight;
|
||||
//ExportData;
|
||||
ExportData1;
|
||||
if FExportPrintRange then
|
||||
DoExportPrintRange;
|
||||
|
||||
FWorksheet:=nil;
|
||||
FExportMatrix.Clear;
|
||||
end;
|
||||
@ -301,6 +363,8 @@ begin
|
||||
leSpreadsheetParamsForm.CheckBox4.Checked:=FOpenAfterExport;
|
||||
leSpreadsheetParamsForm.CheckBox2.Checked:=FMergeCell;
|
||||
leSpreadsheetParamsForm.CheckBox6.Checked:=FDeleteEmptyRow;
|
||||
leSpreadsheetParamsForm.CheckBox7.Checked:=FExportURL;
|
||||
leSpreadsheetParamsForm.CheckBox8.Checked:=FExportPrintRange;
|
||||
|
||||
|
||||
Result:=leSpreadsheetParamsForm.ShowModal = mrOk;
|
||||
@ -316,9 +380,11 @@ begin
|
||||
FDataGrouping:=ldgChunks;
|
||||
FDataGroupingChunks:=leSpreadsheetParamsForm.SpinEdit1.Value;
|
||||
end;
|
||||
FOpenAfterExport:=leSpreadsheetParamsForm.CheckBox4.Checked;
|
||||
FOpenAfterExport:= leSpreadsheetParamsForm.CheckBox4.Checked;
|
||||
FMergeCell := leSpreadsheetParamsForm.CheckBox2.Checked;
|
||||
FDeleteEmptyRow := leSpreadsheetParamsForm.CheckBox6.Checked;
|
||||
FExportURL := leSpreadsheetParamsForm.CheckBox7.Checked;
|
||||
FExportPrintRange:=leSpreadsheetParamsForm.CheckBox8.Checked;
|
||||
|
||||
FExportMatrix.MergeCell:=FMergeCell;
|
||||
FExportMatrix.DeleteEmptyRow:=FDeleteEmptyRow;
|
||||
@ -344,6 +410,8 @@ begin
|
||||
FOpenAfterExport:=lrSpreadSheetExportComponent.OpenAfterExport;
|
||||
FMergeCell:=lrSpreadSheetExportComponent.MergeCell;
|
||||
FDeleteEmptyRow:=lrSpreadSheetExportComponent.DeleteEmptyRow;
|
||||
FExportURL:=lrSpreadSheetExportComponent.ExportURL;
|
||||
FExportPrintRange:=lrSpreadSheetExportComponent.ExportPrintRange;
|
||||
end
|
||||
else
|
||||
begin
|
||||
@ -352,6 +420,8 @@ begin
|
||||
FOpenAfterExport:=true;
|
||||
FMergeCell:=true;
|
||||
FDeleteEmptyRow:=false;
|
||||
FExportURL:=false;
|
||||
FExportPrintRange:=false;
|
||||
end;
|
||||
|
||||
FExportMatrix:=TExportMatrix.Create;
|
||||
@ -401,6 +471,26 @@ begin
|
||||
FCurPage:=0;
|
||||
end;
|
||||
|
||||
function GetFormatFromFileName(const AFileName: TFileName;
|
||||
out SheetType: TsSpreadsheetFormat): Boolean;
|
||||
var
|
||||
suffix: String;
|
||||
begin
|
||||
Result := true;
|
||||
suffix := Lowercase(ExtractFileExt(AFileName));
|
||||
case suffix of
|
||||
STR_EXCEL_EXTENSION : SheetType := sfExcel8;
|
||||
STR_OOXML_EXCEL_EXTENSION : SheetType := sfOOXML;
|
||||
STR_OPENDOCUMENT_CALC_EXTENSION : SheetType := sfOpenDocument;
|
||||
STR_COMMA_SEPARATED_EXTENSION : SheetType := sfCSV;
|
||||
STR_HTML_EXTENSION, '.htm' : SheetType := sfHTML;
|
||||
STR_WIKITABLE_PIPES_EXTENSION : SheetType := sfWikiTable_Pipes;
|
||||
STR_WIKITABLE_WIKIMEDIA_EXTENSION : SheetType := sfWikiTable_WikiMedia;
|
||||
else Result := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TlrSpreadSheetExportFilter.OnEndDoc;
|
||||
var
|
||||
S: String;
|
||||
|
@ -59,6 +59,8 @@ resourcestring
|
||||
sPages = 'Pages:';
|
||||
sEnterPageNumbers = 'Enter page numbers and/or page ranges,'#13'separated by commas. For example, 1,3,5-12';
|
||||
sExportPictures = 'Export pictures';
|
||||
sExportURL = 'Export URL';
|
||||
sExportPrintRange = 'Export print range';
|
||||
sMergeCells = 'Merge cells';
|
||||
sPageBreaks = 'Page breaks';
|
||||
sDeleteEmptyRows = 'Delete empty rows';
|
||||
|
@ -1,19 +1,19 @@
|
||||
object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
Left = 725
|
||||
Height = 326
|
||||
Height = 369
|
||||
Top = 260
|
||||
Width = 350
|
||||
Width = 406
|
||||
Caption = 'Export to spreadsheet'
|
||||
ClientHeight = 326
|
||||
ClientWidth = 350
|
||||
ClientHeight = 369
|
||||
ClientWidth = 406
|
||||
OnCreate = FormCreate
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.5'
|
||||
LCLVersion = '1.7'
|
||||
object ButtonPanel1: TButtonPanel
|
||||
Left = 6
|
||||
Height = 42
|
||||
Top = 278
|
||||
Width = 338
|
||||
Top = 321
|
||||
Width = 394
|
||||
OKButton.Name = 'OKButton'
|
||||
OKButton.DefaultCaption = True
|
||||
HelpButton.Name = 'HelpButton'
|
||||
@ -27,37 +27,37 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
end
|
||||
object PageControl1: TPageControl
|
||||
Left = 0
|
||||
Height = 272
|
||||
Height = 315
|
||||
Top = 0
|
||||
Width = 350
|
||||
Width = 406
|
||||
ActivePage = TabSheet2
|
||||
Align = alClient
|
||||
TabIndex = 1
|
||||
TabOrder = 1
|
||||
object TabSheet1: TTabSheet
|
||||
Caption = 'General'
|
||||
ClientHeight = 233
|
||||
ClientWidth = 344
|
||||
ClientHeight = 277
|
||||
ClientWidth = 400
|
||||
object GroupBox1: TGroupBox
|
||||
AnchorSideLeft.Control = TabSheet1
|
||||
AnchorSideRight.Control = TabSheet1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 176
|
||||
Top = 208
|
||||
Width = 344
|
||||
Height = 170
|
||||
Top = 192
|
||||
Width = 400
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Page range'
|
||||
ClientHeight = 153
|
||||
ClientWidth = 340
|
||||
ClientHeight = 148
|
||||
ClientWidth = 396
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
object RadioButton1: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox1
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
Left = 6
|
||||
Height = 25
|
||||
Height = 24
|
||||
Top = 6
|
||||
Width = 76
|
||||
BorderSpacing.Around = 6
|
||||
@ -71,8 +71,8 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = RadioButton1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 37
|
||||
Height = 24
|
||||
Top = 36
|
||||
Width = 109
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Current page'
|
||||
@ -83,8 +83,8 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = RadioButton2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 68
|
||||
Height = 24
|
||||
Top = 66
|
||||
Width = 67
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Pages:'
|
||||
@ -98,9 +98,9 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideRight.Control = GroupBox1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 79
|
||||
Height = 31
|
||||
Top = 68
|
||||
Width = 255
|
||||
Height = 30
|
||||
Top = 66
|
||||
Width = 311
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
TabOrder = 3
|
||||
@ -112,9 +112,9 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideRight.Control = GroupBox1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 42
|
||||
Top = 105
|
||||
Width = 328
|
||||
Height = 40
|
||||
Top = 102
|
||||
Width = 384
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Enter page numbers and/or page ranges,'#10'separated by commas. For example, 1,3,5-12'
|
||||
@ -127,20 +127,20 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideRight.Control = TabSheet1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 128
|
||||
Height = 124
|
||||
Top = 0
|
||||
Width = 344
|
||||
Width = 400
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
Caption = 'Data grouping'
|
||||
ClientHeight = 105
|
||||
ClientWidth = 340
|
||||
ClientHeight = 102
|
||||
ClientWidth = 396
|
||||
TabOrder = 1
|
||||
object RadioButton4: TRadioButton
|
||||
AnchorSideLeft.Control = GroupBox2
|
||||
AnchorSideTop.Control = GroupBox2
|
||||
Left = 6
|
||||
Height = 25
|
||||
Height = 24
|
||||
Top = 6
|
||||
Width = 119
|
||||
BorderSpacing.Around = 6
|
||||
@ -154,8 +154,8 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = RadioButton4
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 37
|
||||
Height = 24
|
||||
Top = 36
|
||||
Width = 119
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'All in one page'
|
||||
@ -166,8 +166,8 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = RadioButton5
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 68
|
||||
Height = 24
|
||||
Top = 66
|
||||
Width = 228
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Chunks. Each chunk has (rows):'
|
||||
@ -182,9 +182,9 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideRight.Control = GroupBox2
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 240
|
||||
Height = 31
|
||||
Top = 68
|
||||
Width = 94
|
||||
Height = 30
|
||||
Top = 66
|
||||
Width = 150
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
MaxValue = 655360
|
||||
@ -199,8 +199,8 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = GroupBox2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 134
|
||||
Height = 24
|
||||
Top = 130
|
||||
Width = 141
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Open after export'
|
||||
@ -211,9 +211,9 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = CheckBox4
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 165
|
||||
Width = 123
|
||||
Height = 24
|
||||
Top = 160
|
||||
Width = 124
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Auto create file'
|
||||
TabOrder = 3
|
||||
@ -222,14 +222,14 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
end
|
||||
object TabSheet2: TTabSheet
|
||||
Caption = 'Export settings'
|
||||
ClientHeight = 233
|
||||
ClientWidth = 344
|
||||
ClientHeight = 277
|
||||
ClientWidth = 400
|
||||
object CheckBox1: TCheckBox
|
||||
AnchorSideLeft.Control = TabSheet2
|
||||
AnchorSideTop.Control = TabSheet2
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 181
|
||||
Height = 24
|
||||
Top = 217
|
||||
Width = 123
|
||||
Anchors = [akLeft]
|
||||
BorderSpacing.Around = 6
|
||||
@ -241,7 +241,7 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideLeft.Control = TabSheet2
|
||||
AnchorSideTop.Control = TabSheet2
|
||||
Left = 6
|
||||
Height = 25
|
||||
Height = 24
|
||||
Top = 6
|
||||
Width = 99
|
||||
BorderSpacing.Around = 6
|
||||
@ -253,8 +253,8 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = CheckBox2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 214
|
||||
Height = 24
|
||||
Top = 248
|
||||
Width = 102
|
||||
Anchors = [akLeft]
|
||||
BorderSpacing.Around = 6
|
||||
@ -267,13 +267,37 @@ object leSpreadsheetParamsForm: TleSpreadsheetParamsForm
|
||||
AnchorSideTop.Control = CheckBox2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 25
|
||||
Top = 37
|
||||
Height = 24
|
||||
Top = 36
|
||||
Width = 150
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Delete empty rows'
|
||||
TabOrder = 3
|
||||
end
|
||||
object CheckBox7: TCheckBox
|
||||
AnchorSideLeft.Control = TabSheet2
|
||||
AnchorSideTop.Control = CheckBox6
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 66
|
||||
Width = 60
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'URL''s'
|
||||
TabOrder = 4
|
||||
end
|
||||
object CheckBox8: TCheckBox
|
||||
AnchorSideLeft.Control = TabSheet2
|
||||
AnchorSideTop.Control = CheckBox7
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 96
|
||||
Width = 141
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Export print range'
|
||||
TabOrder = 5
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -54,6 +54,8 @@ type
|
||||
CheckBox4: TCheckBox;
|
||||
CheckBox5: TCheckBox;
|
||||
CheckBox6: TCheckBox;
|
||||
CheckBox7: TCheckBox;
|
||||
CheckBox8: TCheckBox;
|
||||
Edit1: TEdit;
|
||||
GroupBox1: TGroupBox;
|
||||
GroupBox2: TGroupBox;
|
||||
@ -112,6 +114,8 @@ begin
|
||||
CheckBox2.Caption:=sMergeCells;
|
||||
CheckBox3.Caption:=sPageBreaks;
|
||||
CheckBox6.Caption:=sDeleteEmptyRows;
|
||||
CheckBox7.Caption:=sExportURL;
|
||||
CheckBox8.Caption:=sExportPrintRange;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -62,6 +62,7 @@ type
|
||||
FHeight: integer;
|
||||
FLeft: integer;
|
||||
FTop: integer;
|
||||
FURLInfo: string;
|
||||
FWidht: integer;
|
||||
|
||||
FObjType: integer;
|
||||
@ -97,6 +98,7 @@ type
|
||||
property Angle:byte read FAngle;
|
||||
property Layout : TTextLayout read FLayout;
|
||||
property WordWrap:boolean read FWordWrap;
|
||||
property URLInfo: string read FURLInfo write FURLInfo;
|
||||
end;
|
||||
|
||||
{ TExportRows }
|
||||
@ -248,6 +250,8 @@ begin
|
||||
end;
|
||||
|
||||
constructor TExportObject.Create(AObj: TfrView);
|
||||
var
|
||||
S: String;
|
||||
begin
|
||||
Inherited Create;
|
||||
|
||||
@ -277,6 +281,10 @@ begin
|
||||
FAngle:=TfrMemoView(AObj).Angle;
|
||||
FLayout:=TfrMemoView(AObj).Layout;
|
||||
FWordWrap:=TfrMemoView(AObj).WordWrap;
|
||||
//http://www.lazarus-ide.org/
|
||||
S:=UpperCase(TfrMemoView(AObj).URLInfo);
|
||||
if (S <> '') and ((Copy(S, 1, 7) = 'HTTP://') or (Copy(S, 1, 8) = 'HTTPS://')) then
|
||||
URLInfo:=TfrMemoView(AObj).URLInfo;
|
||||
end
|
||||
else
|
||||
if AObj is TfrPictureView then
|
||||
|
@ -50,6 +50,8 @@ type
|
||||
FDataGrouping: TlreDataGrouping;
|
||||
FDataGroupingChunks: integer;
|
||||
FDeleteEmptyRow: boolean;
|
||||
FExportPrintRange: boolean;
|
||||
FExportURL: boolean;
|
||||
FMergeCell: boolean;
|
||||
FOpenAfterExport: boolean;
|
||||
FShowSetupForm: boolean;
|
||||
@ -66,6 +68,8 @@ type
|
||||
property DeleteEmptyRow:boolean read FDeleteEmptyRow write FDeleteEmptyRow;
|
||||
property MergeCell:boolean read FMergeCell write FMergeCell;
|
||||
property ShowSetupForm:boolean read FShowSetupForm write FShowSetupForm;
|
||||
property ExportURL:boolean read FExportURL write FExportURL default false;
|
||||
property ExportPrintRange:boolean read FExportPrintRange write FExportPrintRange default false;
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
@ -97,6 +101,8 @@ begin
|
||||
FOpenAfterExport:=true;
|
||||
FMergeCell:=true;
|
||||
FDeleteEmptyRow:=false;
|
||||
FExportURL:=false;
|
||||
FExportPrintRange:=false;
|
||||
FShowSetupForm:=true;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user