<div dir="ltr"><div>'hRel.Brush.Color = ReportBrush.Color(Color.DarkBlue) I don't understand how do this sigh!</div><div><br></div><div>no ! :</div><div>hRel.Brush = ReportBrush.Color(Color.DarkBlue) I don't understand how do this sigh!</div><div><br></div><div>hRel.Brush receive a brush generated by ReportBrush... it work like Paint.Brush with (paint.Color/Paint.gradient/...)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 2 nov. 2019 à 12:50, Fabien Bodard <<a href="mailto:gambas.fr@gmail.com">gambas.fr@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>well because you use only the auto generated instance .</div><div><br></div><div>When you call Report1.Preview</div><div><br></div><div>in background it do a thing like</div><div><br></div><div>Report1 = New Report1<br></div><div><br></div><div>So the object Report1 theoretically is not callable directly. In the past ... in the beginning of gambas ... (well 20 years) You cannot do Form1.Show</div><div><br></div><div>You'll have to do a :</div><div>Dim hForm as new Form1 as "Form"<br></div><div>hForm.Show</div><div><br></div><div>All of that to say .... in your case do :</div><div><br></div>Public Sub Button1_Click()<br></div>  hreport = new Report1<br><div>  $hResult = MBase.ReturnDataNumber()<br>  If Not $hResult Then<br>    Message.Error(("Query result not available\n\nSorry but it is impossible to continue."))<br>    Me.Close<br>    Return<br>  Endif <br>hReport.Preview<br><br>End<br><br>Public Sub Button2_Click()<br></div><div>  hReport = new Report1<br></div><div>  $hResult = MBase.ReturnDataDate()<br>  If Not $hResult Then<br>    Message.Error(("Query result not available\n\nSorry but it is impossible to continue."))<br>    Me.Close<br>    Return<br>  Endif <br>  hReport.Preview<br><br>End</div><br><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 1 nov. 2019 à 18:24, Gianluigi <<a href="mailto:bagonergi@gmail.com" target="_blank">bagonergi@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Fabien,<br><br>inspired by a discussion on the German forum I wanted to see if I could make a report in that way.<br>I was unable to use the same report for two slightly different queries.<br>Should I use a different report for each query?<br>I can't change the color of the writing with the code.<br><br>Any suggestions?<br><br>Regards<br>Gianluigi</div>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr">Fabien Bodard </div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Fabien Bodard </div>