diff --git a/.gitattributes b/.gitattributes
index b7ffea477c..c6c0502388 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2224,6 +2224,12 @@ components/lazreport/images/package_images.bat svneol=native#text/x-msdos-progra
components/lazreport/license-lazreport.txt svneol=native#text/plain
components/lazreport/license-rus.txt svneol=native#text/plain
components/lazreport/license.txt svneol=native#text/plain
+components/lazreport/samples/ChildBand_Example/ChildBand_Example.ico -text
+components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpi svneol=native#text/plain
+components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpr svneol=native#text/pascal
+components/lazreport/samples/ChildBand_Example/ChildBand_Example.res -text
+components/lazreport/samples/ChildBand_Example/unit1.lfm svneol=native#text/plain
+components/lazreport/samples/ChildBand_Example/unit1.pas svneol=native#text/pascal
components/lazreport/samples/Demo_CrossTab/demo_cross.lrf svneol=LF#text/xml eol=lf
components/lazreport/samples/Demo_CrossTab/project1.ico -text
components/lazreport/samples/Demo_CrossTab/project1.lpi svneol=native#text/plain
diff --git a/components/lazreport/samples/ChildBand_Example/ChildBand_Example.ico b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.ico
new file mode 100644
index 0000000000..0341321b5d
Binary files /dev/null and b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.ico differ
diff --git a/components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpi b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpi
new file mode 100644
index 0000000000..58e7a9568d
--- /dev/null
+++ b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpi
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpr b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpr
new file mode 100644
index 0000000000..db4780e1e0
--- /dev/null
+++ b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.lpr
@@ -0,0 +1,21 @@
+program ChildBand_Example;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Interfaces, // this includes the LCL widgetset
+ Forms, Unit1
+ { you can add units after this };
+
+{$R *.res}
+
+begin
+ RequireDerivedFormResource := True;
+ Application.Initialize;
+ Application.CreateForm(TForm1, Form1);
+ Application.Run;
+end.
+
diff --git a/components/lazreport/samples/ChildBand_Example/ChildBand_Example.res b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.res
new file mode 100644
index 0000000000..7c6cf3e4be
Binary files /dev/null and b/components/lazreport/samples/ChildBand_Example/ChildBand_Example.res differ
diff --git a/components/lazreport/samples/ChildBand_Example/unit1.lfm b/components/lazreport/samples/ChildBand_Example/unit1.lfm
new file mode 100644
index 0000000000..ae2ecabfc8
--- /dev/null
+++ b/components/lazreport/samples/ChildBand_Example/unit1.lfm
@@ -0,0 +1,68 @@
+object Form1: TForm1
+ Left = 569
+ Height = 147
+ Top = 247
+ Width = 486
+ Caption = 'Form1'
+ ClientHeight = 147
+ ClientWidth = 486
+ OnCreate = FormCreate
+ LCLVersion = '1.3'
+ object Button1: TButton
+ Left = 206
+ Height = 25
+ Top = 104
+ Width = 75
+ Caption = 'Preview'
+ OnClick = Button1Click
+ TabOrder = 0
+ end
+ object CheckBox1: TCheckBox
+ Left = 56
+ Height = 17
+ Top = 32
+ Width = 188
+ Caption = 'Child1 visible only if Number is even'
+ Checked = True
+ OnChange = CheckBox1Change
+ State = cbChecked
+ TabOrder = 1
+ end
+ object CheckBox2: TCheckBox
+ Left = 56
+ Height = 17
+ Top = 64
+ Width = 393
+ Caption = 'Child2 visibility is independent from Child1.Visible (Child1.PrintChildIfNotVisible)'
+ Checked = True
+ State = cbChecked
+ TabOrder = 2
+ end
+ object frReport1: TfrReport
+ InitialZoom = pzDefault
+ Options = []
+ PreviewButtons = [pbZoom, pbLoad, pbSave, pbPrint, pbFind, pbHelp, pbExit]
+ StoreInForm = True
+ DataType = dtDataSet
+ OnBeginBand = frReport1BeginBand
+ left = 16
+ top = 16
+ ReportXML = ''#13#10''#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10' '#13#10''#13#10
+ end
+ object frDBDataSet1: TfrDBDataSet
+ DataSet = BufDataset1
+ left = 24
+ top = 88
+ end
+ object BufDataset1: TBufDataset
+ FieldDefs = <
+ item
+ Name = 'FIELD1'
+ DataType = ftInteger
+ Precision = 0
+ Size = 0
+ end>
+ left = 256
+ top = 88
+ end
+end
diff --git a/components/lazreport/samples/ChildBand_Example/unit1.pas b/components/lazreport/samples/ChildBand_Example/unit1.pas
new file mode 100644
index 0000000000..1868d7f303
--- /dev/null
+++ b/components/lazreport/samples/ChildBand_Example/unit1.pas
@@ -0,0 +1,73 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils, FileUtil, LR_Class, LR_DBSet, Forms, Controls, Graphics,
+ Dialogs, StdCtrls, BufDataset, db;
+
+type
+
+ { TForm1 }
+
+ TForm1 = class(TForm)
+ BufDataset1: TBufDataset;
+ Button1: TButton;
+ CheckBox1: TCheckBox;
+ CheckBox2: TCheckBox;
+ frDBDataSet1: TfrDBDataSet;
+ frReport1: TfrReport;
+ procedure Button1Click(Sender: TObject);
+ procedure CheckBox1Change(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ procedure frReport1BeginBand(Band: TfrBand);
+ private
+ { private declarations }
+ public
+ { public declarations }
+ end;
+
+var
+ Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+var
+ i:Integer;
+
+begin
+ BufDataset1.CreateDataset;
+ for i:=1 to 10 do
+ begin
+ BufDataset1.AppendRecord([i]);
+ end;
+end;
+
+procedure TForm1.frReport1BeginBand(Band: TfrBand);
+begin
+ if CheckBox1.Checked and (Band.Name='Child1') then
+ begin
+ Band.Visible:=((BufDataset1.FieldByName('FIELD1').Value mod 2)=0);
+ Band.PrintChildIfNotVisible:=CheckBox2.Checked;
+ end;
+end;
+
+procedure TForm1.Button1Click(Sender: TObject);
+begin
+ frReport1.ShowReport;
+end;
+
+procedure TForm1.CheckBox1Change(Sender: TObject);
+begin
+ CheckBox2.Visible:=CheckBox1.Checked;
+end;
+
+end.
+
diff --git a/components/lazreport/source/languages/lr_const.cs.po b/components/lazreport/source/languages/lr_const.cs.po
index bc884274eb..58bb8dc426 100644
--- a/components/lazreport/source/languages/lr_const.cs.po
+++ b/components/lazreport/source/languages/lr_const.cs.po
@@ -87,6 +87,16 @@ msgid "Cross footer"
msgstr "Křížení patičky"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Není"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Není"
@@ -2232,6 +2242,10 @@ msgstr "Měřítko"
msgid "&Whole page"
msgstr "Celá stránka"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/languages/lr_const.de.po b/components/lazreport/source/languages/lr_const.de.po
index 28bc5fb4f0..43c432df96 100644
--- a/components/lazreport/source/languages/lr_const.de.po
+++ b/components/lazreport/source/languages/lr_const.de.po
@@ -96,6 +96,16 @@ msgid "Cross footer"
msgstr "Kreuz-Footer"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Keiner"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Keiner"
@@ -2224,6 +2234,10 @@ msgstr "Maßstab"
msgid "&Whole page"
msgstr "&Ganze &Seite"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#| msgid "Printer selected is not valid"
msgid "Selected printer is not valid"
diff --git a/components/lazreport/source/languages/lr_const.es.po b/components/lazreport/source/languages/lr_const.es.po
index bb289035bc..c2d7fbd2a0 100644
--- a/components/lazreport/source/languages/lr_const.es.po
+++ b/components/lazreport/source/languages/lr_const.es.po
@@ -89,6 +89,16 @@ msgid "Cross footer"
msgstr "Pie de datos cruzados"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Ninguno"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Ninguno"
@@ -2214,6 +2224,10 @@ msgstr "Escala"
msgid "&Whole page"
msgstr "&Toda la página"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#| msgid "Printer selected is not valid"
msgid "Selected printer is not valid"
diff --git a/components/lazreport/source/languages/lr_const.fr.po b/components/lazreport/source/languages/lr_const.fr.po
index 9074dee42f..1241decf7b 100644
--- a/components/lazreport/source/languages/lr_const.fr.po
+++ b/components/lazreport/source/languages/lr_const.fr.po
@@ -95,6 +95,16 @@ msgid "Cross footer"
msgstr "Pied de page tableau"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Aucun"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Aucun"
@@ -2245,6 +2255,10 @@ msgstr "Échelle"
msgid "&Whole page"
msgstr "&Page entière"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/languages/lr_const.hu.po b/components/lazreport/source/languages/lr_const.hu.po
index 16fb1f7aeb..8061ce3298 100644
--- a/components/lazreport/source/languages/lr_const.hu.po
+++ b/components/lazreport/source/languages/lr_const.hu.po
@@ -88,6 +88,16 @@ msgid "Cross footer"
msgstr ""
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Nincs"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Nincs"
@@ -2198,6 +2208,10 @@ msgstr "Átméretezés"
msgid "&Whole page"
msgstr "Teljes oldal"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
msgid "Selected printer is not valid"
msgstr "A kiválasztott nyomtató érvénytelen"
diff --git a/components/lazreport/source/languages/lr_const.id.po b/components/lazreport/source/languages/lr_const.id.po
index efcb4c8df4..1877cb0fd0 100644
--- a/components/lazreport/source/languages/lr_const.id.po
+++ b/components/lazreport/source/languages/lr_const.id.po
@@ -86,6 +86,16 @@ msgid "Cross footer"
msgstr "Footer silang"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Tidak ada"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Tidak ada"
@@ -2234,6 +2244,10 @@ msgstr "Skala"
msgid "&Whole page"
msgstr "&Seluruh halaman"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/languages/lr_const.it.po b/components/lazreport/source/languages/lr_const.it.po
index 9b0b165138..b0bf5b88f4 100644
--- a/components/lazreport/source/languages/lr_const.it.po
+++ b/components/lazreport/source/languages/lr_const.it.po
@@ -90,6 +90,16 @@ msgid "Cross footer"
msgstr "Pedice incrodiato"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Nessuno"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Nessuno"
@@ -2196,6 +2206,10 @@ msgstr "Scala"
msgid "&Whole page"
msgstr "&Intera pagina"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
msgid "Selected printer is not valid"
msgstr "La stampante selezionata non è valida."
@@ -2544,3 +2558,4 @@ msgstr "a capo parole"
#: lr_const.syes
msgid "Yes"
msgstr "&Sì"
+
diff --git a/components/lazreport/source/languages/lr_const.lt.po b/components/lazreport/source/languages/lr_const.lt.po
index de4005a114..80788d987c 100644
--- a/components/lazreport/source/languages/lr_const.lt.po
+++ b/components/lazreport/source/languages/lr_const.lt.po
@@ -88,6 +88,16 @@ msgid "Cross footer"
msgstr "Kryžmės poraštės"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Joks"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Joks"
@@ -2222,6 +2232,10 @@ msgstr "Mastelis"
msgid "&Whole page"
msgstr "&Visas lapas"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/languages/lr_const.pl.po b/components/lazreport/source/languages/lr_const.pl.po
index 539d29ab73..6a5080f454 100644
--- a/components/lazreport/source/languages/lr_const.pl.po
+++ b/components/lazreport/source/languages/lr_const.pl.po
@@ -89,6 +89,16 @@ msgid "Cross footer"
msgstr "Stopka krzyżowa"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Żaden"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Żaden"
@@ -2237,6 +2247,10 @@ msgstr "Skaluj"
msgid "&Whole page"
msgstr "&Cała strona"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/languages/lr_const.po b/components/lazreport/source/languages/lr_const.po
index 8cf9fcab88..1c267b602e 100644
--- a/components/lazreport/source/languages/lr_const.po
+++ b/components/lazreport/source/languages/lr_const.po
@@ -81,6 +81,12 @@ msgid "Cross footer"
msgstr ""
#: lr_const.sband22
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr ""
+
+#: lr_const.sband23
+msgctxt "lr_const.sband23"
msgid "None"
msgstr ""
@@ -2187,6 +2193,10 @@ msgstr ""
msgid "&Whole page"
msgstr ""
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
msgid "Selected printer is not valid"
msgstr ""
diff --git a/components/lazreport/source/languages/lr_const.pt_BR.po b/components/lazreport/source/languages/lr_const.pt_BR.po
index b8e09e65f1..cedb167c5f 100644
--- a/components/lazreport/source/languages/lr_const.pt_BR.po
+++ b/components/lazreport/source/languages/lr_const.pt_BR.po
@@ -87,6 +87,16 @@ msgid "Cross footer"
msgstr "Rodapé Ref.Cruz."
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Nenhum"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Nenhum"
@@ -2221,6 +2231,10 @@ msgstr "Escala"
msgid "&Whole page"
msgstr "Página &inteira"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/languages/lr_const.ru.po b/components/lazreport/source/languages/lr_const.ru.po
index d4b2c52b7d..7664f5d8e7 100644
--- a/components/lazreport/source/languages/lr_const.ru.po
+++ b/components/lazreport/source/languages/lr_const.ru.po
@@ -86,6 +86,16 @@ msgid "Cross footer"
msgstr "Cross-примечание"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Нет"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Нет"
@@ -2218,6 +2228,10 @@ msgstr "Масштаб"
msgid "&Whole page"
msgstr "&Вся страница"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#| msgid "Printer selected is not valid"
msgid "Selected printer is not valid"
diff --git a/components/lazreport/source/languages/lr_const.uk.po b/components/lazreport/source/languages/lr_const.uk.po
index 65bc727fb2..7c21a06a0c 100644
--- a/components/lazreport/source/languages/lr_const.uk.po
+++ b/components/lazreport/source/languages/lr_const.uk.po
@@ -89,6 +89,16 @@ msgid "Cross footer"
msgstr "Перехресний нижній колонтитул"
#: lr_const.sband22
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband22"
+msgid "Child"
+msgstr "Немає"
+
+#: lr_const.sband23
+#, fuzzy
+#| msgid "None"
+msgctxt "lr_const.sband23"
msgid "None"
msgstr "Немає"
@@ -2223,6 +2233,10 @@ msgstr "Масштаб"
msgid "&Whole page"
msgstr "Сторінка &повністю"
+#: lr_const.sprintchildifnotvisible
+msgid "Print child if not visible"
+msgstr ""
+
#: lr_const.sprintererror
#, fuzzy
#| msgid "Printer selected is not valid"
diff --git a/components/lazreport/source/lr_btyp.pas b/components/lazreport/source/lr_btyp.pas
index 8f6d1b7bda..47fe412bdf 100644
--- a/components/lazreport/source/lr_btyp.pas
+++ b/components/lazreport/source/lr_btyp.pas
@@ -71,7 +71,7 @@ var
First: Boolean;
begin
First := True;
- for bt := btReportTitle to btCrossFooter do
+ for bt := btReportTitle to btChild do
begin
b := TRadioButton.Create(GB1);
b.Parent := GB1;
@@ -80,7 +80,7 @@ begin
b.Caption := frBandNames[Bt];
b.OnClick := @bClick;
b.Enabled := (bt in [btMasterHeader..btSubDetailFooter,
- btGroupHeader, btGroupFooter]) or not frCheckBand(bt);
+ btGroupHeader, btGroupFooter, btChild]) or not frCheckBand(bt);
if b.Enabled and First then
begin
b.Checked := True;
diff --git a/components/lazreport/source/lr_class.pas b/components/lazreport/source/lr_class.pas
index 8867da3a83..f7ea526998 100644
--- a/components/lazreport/source/lr_class.pas
+++ b/components/lazreport/source/lr_class.pas
@@ -37,6 +37,7 @@ const
flBandOnFirstPage = $10;
flBandOnLastPage = $20;
flBandRepeatHeader = $40;
+ flBandPrintChildIfNotVisible = $80;
flPictCenter = 2;
flPictRatio = 4;
@@ -67,7 +68,7 @@ type
btSubDetailHeader, btSubDetailData, btSubDetailFooter,
btOverlay, btColumnHeader, btColumnFooter,
btGroupHeader, btGroupFooter,
- btCrossHeader, btCrossData, btCrossFooter, btNone);
+ btCrossHeader, btCrossData, btCrossFooter, btChild, btNone);
TfrBandTypes = set of TfrBandType;
TfrDataSetPosition = (psLocal, psGlobal);
TfrValueType = (vtNotAssigned, vtDBField, vtOther, vtFRVar);
@@ -535,13 +536,15 @@ type
fDataSetStr : String;
fBandType : TfrBandType;
fCondition : String;
-
+ fChild : String;
+
procedure P1Click(Sender: TObject);
procedure P2Click(Sender: TObject);
procedure P3Click(Sender: TObject);
procedure P4Click(Sender: TObject);
procedure P5Click(Sender: TObject);
procedure P6Click(Sender: TObject);
+ procedure P7Click(Sender: TObject);
function GetTitleRect: TRect;
function TitleSize: Integer;
procedure CalcTitleSize;
@@ -569,6 +572,7 @@ type
published
property DataSet: String read fDataSetStr write fDataSetStr;
property GroupCondition: String read fCondition write fCondition;
+ property Child: String read fChild write fChild;
property BandType: TfrBandType read fBandType write fBandType;
@@ -693,6 +697,7 @@ type
Positions: Array[TfrDatasetPosition] of Integer;
LastGroupValue: Variant;
HeaderBand, FooterBand, LastBand: TfrBand;
+ ChildBand: TfrBand;
Values: TStringList;
Count: Integer;
DisableInit: Boolean;
@@ -725,6 +730,7 @@ type
Typ: TfrBandType;
PrintIfSubsetEmpty, NewPageAfter, Stretched, PageBreak: Boolean;
+ PrintChildIfNotVisible: Boolean;
Objects: TFpList;
DataSet: TfrDataSet;
IsVirtualDS: Boolean;
@@ -1416,11 +1422,12 @@ function FindObjectProps(AObjStr:string; out frObj:TfrObject; out PropName:strin
const
lrTemplatePath = 'LazReportTemplate/';
- frCurrentVersion = 27;
+ frCurrentVersion = 28;
// version 2.5: lazreport: added to binary stream ParentBandType variable
// on TfrView, used to extend export facilities
// version 2.6: lazreport: added to binary stream Tag property on TfrView
// version 2.7: lazreport: added to binary stream FOnClick, FOnMouseEnter, FOnMouseLeave, FCursor property on TfrMemoView
+ // version 2.8. lazreport: added support for child bands
frSpecCount = 9;
frSpecFuncs: Array[0..frSpecCount - 1] of String = ('PAGE#', '',
@@ -1740,7 +1747,8 @@ begin
frBandNames[btCrossHeader] := sBand19;
frBandNames[btCrossData] := sBand20;
frBandNames[btCrossFooter] := sBand21;
- frBandNames[btNone] := sBand22;
+ frBandNames[btChild] := sBand22;
+ frBandNames[btNone] := sBand23;
frSpecArr[0] := sVar1;
frSpecArr[1] := sVar2;
@@ -4844,6 +4852,7 @@ begin
BandType := TFrBandView(Source).BandType;
DataSet := TFrBandView(Source).DataSet;
GroupCondition:=TFrBandView(Source).GroupCondition;
+ Child := TFrBandView(Source).Child;
end;
end;
@@ -4854,8 +4863,12 @@ begin
With Stream do
if frVersion>23 then begin
Read(fBandType,SizeOf(BandType));
+ if (frVersion<28) and (fBandType=btChild) then
+ fBandType := btNone; // btNone and btChild were swapped in version 29
fCondition :=ReadString(Stream);
fDataSetStr:=ReadString(Stream);
+ if frVersion>=28 then
+ fChild :=ReadString(Stream);
end else
begin
if StreamMode=smDesigning then begin
@@ -4872,6 +4885,7 @@ begin
RestoreProperty('BandType',XML.GetValue(Path+'BandType/Value','')); // todo chk
FCondition := XML.GetValue(Path+'Condition/Value', ''); // todo chk
FDatasetStr := XML.GetValue(Path+'DatasetStr/Value', ''); // todo chk
+ FChild := XML.GetValue(Path+'Child/Value', '');
end;
procedure TfrBandView.SaveToStream(Stream: TStream);
@@ -4883,6 +4897,7 @@ begin
Write(fBandType,SizeOf(fBandType));
frWriteString(Stream, fCondition);
frWriteString(Stream, fDataSetStr);
+ frWriteString(Stream, fChild);
end;
end;
@@ -4892,6 +4907,7 @@ begin
XML.SetValue(Path+'BandType/Value', GetSaveProperty('BandType')); //Ord(FBandType)); // todo: use symbolic values
XML.SetValue(Path+'Condition/Value', FCondition);
XML.SetValue(Path+'DatasetStr/Value', FDatasetStr);
+ XML.SetValue(Path+'Child/Value', FChild);
end;
procedure TfrBandView.Draw(aCanvas: TCanvas);
@@ -5033,7 +5049,7 @@ var
m: TMenuItem;
begin
if BandType in [btReportTitle, btReportSummary, btPageHeader, btCrossHeader,
- btMasterHeader..btSubDetailFooter, btGroupHeader, btGroupFooter] then
+ btMasterHeader..btSubDetailFooter, btGroupHeader, btGroupFooter, btChild] then
inherited DefinePopupMenu(Popup);
if BandType in [btReportTitle, btReportSummary, btMasterData, btDetailData,
@@ -5093,6 +5109,15 @@ begin
m.Checked := (Flags and flBandRepeatHeader) <> 0;
Popup.Items.Add(m);
end;
+
+ if BandType <> btPageFooter then
+ begin
+ m := TMenuItem.Create(Popup);
+ m.Caption := sPrintChildIfNotVisible;
+ m.OnClick := @P7Click;
+ m.Checked := (Flags and flBandPrintChildIfNotVisible) <> 0;
+ Popup.Items.Add(m);
+ end;
end;
procedure TfrBandView.P1Click(Sender: TObject);
@@ -5181,6 +5206,16 @@ begin
end;
end;
+procedure TfrBandView.P7Click(Sender: TObject);
+begin
+ frDesigner.BeforeChange;
+ with Sender as TMenuItem do
+ begin
+ Checked := not Checked;
+ Flags := (Flags and not flBandPrintChildIfNotVisible) + Word(Checked) * flBandPrintChildIfNotVisible;
+ end;
+end;
+
function TfrBandView.GetTitleRect: TRect;
begin
if BandType in [btCrossHeader..btCrossFooter] then
@@ -6921,6 +6956,8 @@ begin
else
begin
DoDraw;
+ if (ChildBand <> nil) then
+ ChildBand.Draw;
if not (Typ in [btMasterData, btDetailData, btSubDetailData, btGroupHeader]) and
NewPageAfter then
Parent.NewPage;
@@ -6931,9 +6968,13 @@ begin
// if band is not visible, just performing aggregate calculations
// relative to it
else
- if Typ in [btMasterData, btDetailData, btSubDetailData] then
- Parent.DoAggregate([btPageFooter, btMasterFooter, btDetailFooter,
- btSubDetailFooter, btGroupFooter, btReportSummary]);
+ begin
+ if (ChildBand <> nil) and PrintChildIfNotVisible then
+ ChildBand.Draw;
+ if Typ in [btMasterData, btDetailData, btSubDetailData] then
+ Parent.DoAggregate([btPageFooter, btMasterFooter, btDetailFooter,
+ btSubDetailFooter, btGroupFooter, btReportSummary]);
+ end;
// check if multiple pagefooters (in cross-tab report) - resets last of them
if not DisableInit then
@@ -7335,7 +7376,8 @@ begin
end;
end;
- for b := btReportTitle to btGroupFooter do // fill other bands
+ for b := btReportTitle to btChild do // fill other bands
+ if not (b in [btCrossHeader..btCrossFooter]) then
begin
FirstBand := True;
Bnd := Bands[b];
@@ -7370,6 +7412,7 @@ begin
InitDataSet(TfrBandView(Bt).DataSet);
Stretched := (Flags and flStretched) <> 0;
PrintIfSubsetEmpty := (Flags and flBandPrintIfSubsetEmpty) <> 0;
+ PrintChildIfNotVisible := (Flags and flBandPrintChildIfNotVisible) <> 0;
if Skip then
begin
NewPageAfter := False;
@@ -7527,6 +7570,26 @@ begin
end;
end;
+ for b := btReportTitle to btChild do
+ begin
+ Bnd := Bands[b];
+ while Bnd <> nil do
+ begin
+ if Bnd.View <> nil then
+ begin
+ s := TfrBandView(Bnd.View).Child;
+
+ for i := 0 to RTObjects.Count - 1 do
+ begin
+ bt :=TfrView(RTObjects[i]);
+ if (bt.Typ = gtBand) and (TfrBandView(bt).BandType=btChild) and (bt.Name=s) then
+ Bnd.ChildBand:=bt.Parent;
+ end;
+ end;
+ Bnd := Bnd.Next;
+ end;
+ end;
+
if ColCount = 0 then ColCount := 1;
ColWidth := (RightMargin - LeftMargin) div ColCount;
end;
diff --git a/components/lazreport/source/lr_const.pas b/components/lazreport/source/lr_const.pas
index e38a428598..94b5016580 100644
--- a/components/lazreport/source/lr_const.pas
+++ b/components/lazreport/source/lr_const.pas
@@ -186,7 +186,8 @@ resourcestring
sBand19 = 'Cross header';
sBand20 = 'Cross data';
sBand21 = 'Cross footer';
- sBand22 = 'None';
+ sBand22 = 'Child';
+ sBand23 = 'None';
sVar1 = 'Page#';
sVar2 = 'Expression';
@@ -223,6 +224,7 @@ resourcestring
sNotAssigned = '[None]';
sFormNewPage = 'Force new page';
sPrintIfSubsetEmpty = 'Print if detail empty';
+ sPrintChildIfNotVisible = 'Print child if not visible';
sBreaked = 'Breaked';
sPictureCenter = 'Center picture';
sKeepAspectRatio = 'Keep aspect ratio';