Forum > LazReport
Lazreport: Band only to print when a field has a certain value
MoellerCLaus:
Hi Sonar
I defined 2 bands as master in the report-designer.
Wrote the below handler.
It does not work :(
--- 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 TSuperPrintForm.frReport1BeginBand(Band: TfrBand);begin Case TypeRapport of 5: Begin // Schedule If (aUdskriv_source.DataSet.FieldByName('schedule_pause').AsString = '') and (Band.Name = 'MasterDataEvent') Then Band.Visible := True Else If (aUdskriv_source.DataSet.FieldByName('schedule_pause').AsString = '') and (Band.Name = 'MasterDataPause') Then Band.Visible := False Else If (aUdskriv_source.DataSet.FieldByName('schedule_pause').AsString = 'P') and (Band.Name = 'MasterDataEvent') Then Band.Visible := False Else If (aUdskriv_source.DataSet.FieldByName('schedule_pause').AsString = 'P') and (Band.Name = 'MasterDataPause') Then Band.Visible := True Else If (aUdskriv_source.DataSet.FieldByName('schedule_pause').AsString = 'M') and (Band.Name = 'MasterDataEvent') Then Band.Visible := False Else If (aUdskriv_source.DataSet.FieldByName('schedule_pause').AsString = 'M') and (Band.Name = 'MasterDataPause') Then Band.Visible := False; end; end;end;
Soner:
It is working on my example.
Maybe I didn't understand your question.
Look my example.
MoellerCLaus:
Hi Sonar
Thanks so much for your effort in helping and your example.
Yes I am afraid you misunderstood me.
I want the report to one format with a box when a value is X and another format of the band when value is Y.
Your example shows all of data on one format of band first and then the same on format second.
What I want to achieve is:
Record 1 Format 1 due to value = x
Record 2 Format 1 value x
Record 3 Format 2 value y
Record 4 Format 1 value x
::) Thanks I will try to find a way.
dseligo:
You didn't say you want to change format.
You could do it in script, something like this:
--- 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";}};} --- FontStyle:=[[FontStyle]]; FontSize:=[[FontSize]]; Visible:=[v6]; Adjust:=[a6];
This is from one of my programs. I then use OnGetValue event to set this values.
MoellerCLaus:
Hi dseligo
Yeah Maybe I was unprise - sorry for that.
No I was hoping for to be able to change the format of the band. Rectangles, colors, lines, images etc. A completely different band.
Still looking for it.
Navigation
[0] Message Index
[#] Next page
[*] Previous page