Forum > FPC development
[Solved] Lazreport - How to really make duplicates disappear
(1/1)
janhsh:
Hello
I have a problem with lazreport
I created a "Master data" band with a field A, and a child band with a field B. Both fields are in the same dataset
My display is as follows
A Value 1B value 1.1 A Value 1B value 1.2 A Value 1B value 1.3 A Value 2B value 2.1 A Value 2B value 2.2
When I set HideDuplicates=True, the display becomes
A Value 1B value 1.1(Blank line)B value 1.2(Blank line)B value 1.3 A Value 2B value 2.1(Blank line)B value 2.2
I would like to make these white lines disappear to obtain
A Value 1B value 1.1B value 1.2B value 1.3 A Value 2B value 2.1B value 2.2
I tried with a script to reduce the size of the "Master data" band when the A field is not visible, but it doesn't work
How can I do this?
GAN:
Hello, I had similar issue and I solved using the event handler frRepBeginBand, there i can manage the heigth of the band. May be this help you.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TFLibCompras.frRepBeginBand(Band: TfrBand);begin if ((Band.Name='MasterData1') and (ZQ.FieldByName('cnetogravado2').AsCurrency<>0)) then begin Band.Height:=45; Exit; end; if ((Band.Name='MasterData1') and (ZQ.FieldByName('cnetogravado1').AsCurrency<>0)) then begin Band.Height:=30; Exit; end; if ((Band.Name='MasterData1') and (ZQ.FieldByName('cnetogravado1').AsCurrency=0)) then begin Band.Height:=14; Exit; end;end;
paweld:
use grouping. to the report you add a Master data band with a field with value B, add a Group header band with a condition for value A, and on this band you put a field with value A. Sample in attachment.
janhsh:
For layout reasons, I placed this part in a subreport. Grouping does not seem to work with a subreport.
Navigation
[0] Message Index