[Gambas-user] Questions about gb.report

Willy Raets willy at ...2734...
Fri Sep 20 16:10:41 CEST 2013


On Thu, 2013-09-19 at 22:00 +0200, Fabien Bodard wrote:
> Gambas report is working like the forms

I've gotten that far :-)
> 
> 
> 
> 
> you need to open a new report
> 
> 
> then setup the padding of the report (it's margins)

Okay

> 
> Add a ReportHBox to create the table header
> Set it's height to  1 cm
> set the property fixed to true (it repeat the header on each page)

Now this is the stuff I find very useful to read.
What to use where and how to use it..
> 
> 
> in it add one report label for each column
>  for each label set the header text
>  give a width for each of then
>  set the border for each of them
> 
Clear
> 
> then
> 
> 
> on the report add another reporthbox (name=datalist)
> set it's height to 1 cm
> in it add a reportlabel for each column (datalabel1, datalabel2, etc)
> set theire text to null
> set theire width to the same size as those of the header
> set theire border

Clear
> 
> 
> then
> 
> 
> in _new
> hresult=.....
> 
> 
> datalist.datacount=hresult.count
> 
> 
> 
> 
> for each datalabel : 
> example :
> 
> 
> Public Sub DataLabel1_data(index as integer)
> 
> 
> hResult.Moveto(Index)
> Last.Data = hResult!myfield
> 
> 
> end

Thank you, this makes a lot more clear. Need to wait until Monday (at
work) to give this a try in my test situation.

Meanwhile I'll be studying your attached example in detail. 

> 
> to test the report set it as main class (first launched form of the
> project)
> 
> 
> i give you a demo with some extra such as page header, title and page
> footer

Page header and title and page footer are very useful. Thanks for adding
it to the example, very useful.
> 
> 
> you need to play with all the properties to know exactly what they are
> doing.
> 
> 
> all the array in my example is in an extra vbo with expand to true.
> it's to enforce the footer to be at the end of the page even on the
> last one (when datas not fill the page)
> 
> 
> remember that a report is a multi container i call it sections. you
> can get a new section by increase the property count of report. A
> section is like a new report (or a new page)
> 
> 
> for exemple with that a report can have a title page, a summary, the
> data , the aknowlegement...

That sounds cool. So how do you determine in what order the sections get
printed or is it the order they are on the tab of the report in IDE?
> 
> 
> gb.report have not a good doc as i've not the time to inprove it. but
> it's really powerfull. And since now not so many people use it.

I never used gb.report because of it's scarce documentation, maybe more
people don't use gb.report for the same reason.
It is a bit of a 'who was first the chicken or the egg' situation:
- Developer doesn't write component docs because of little users
- Users don't use component because of lack of documentation :)

Just a hint: If you would make some comments in the example code on what
you are doing (I mean in the Report Example installed with Gambas), that
could make a world of difference with little effort on your side.


> In a short time (some month i will adda grid widget to simplify the
> simple table making)

Looking forward to that feature.
> 
> 
> Have fun

Thanks, I will ;)

-- 
Kind regards,

Willy (aka gbWilly)

http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org








More information about the User mailing list