Forum > LazReport

Lazreport: Band only to print when a field has a certain value

(1/3) > >>

I have generated one sqllite datase with all the fields and data that is needed in a report.
However I want to display different band layouts dependant on the value in one of the fields.

If there a way to have 3 masterbands where they only print on a certain conditions?

Any hints highly appriciated.

Jurassic Pork:
have a look to this

Friendly, J.P

Thanks for the hint Jurassic.
Maybe it shows a possible way through - I now got introduced to script.
The reports I need here are more advanced then displaying a table. I just make a deep-dive into LazReport.

Use the event TFrReport.OnBeginDoc i.e:

--- 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 TForm1.frReport1BeginBand(Band: TfrBand);begin  if (Band.Name='MyBand1')and(DBFieldValue=1) then  Band.Visible:=true  else if (Band.Name='MyBand1')and(DBFieldValue<>1) then  Band.Visible:=false  else if (Band.Name='MyBand2')and(DBFieldValue=2) then  Band.Visible:=true  else if (Band.Name='MyBand2')and(DBFieldValue<>2) then  Band.Visible:=false  else .... end;  

Hi Sonar

I will try too - the suggestion from Jurassic works fine but a lot of script has to be made. Further scripts does not work with rectangles, lines etc..

 With your tip I suppose I could have several master-bands and swich them on and of..

Thanks  8-)


[0] Message Index

[#] Next page

Go to full version