[Gambas-user] Printing TableView

Rolf-Werner Eilert rwe-sse at osnanet.de
Wed Oct 7 12:59:52 CEST 2020


Am 07.10.20 um 11:25 schrieb Dag Jarle Nerland Johansen - Gambas:
>   Hi,
> I am struggling a little with the printing abilities in Gambas.
> Two years ago I made some printing with Report, but it was not that what 
> I was looking for.
> What I want, is to print in the form of TableView, but on the ReportBox 
> there are no object for that, I only see Labels and Images.
> *Is there a way to print a TableView in a convenient way?*
> (With the printer, it is also easy to write a file in PDF-format. But I 
> need both, print and PDF)
> Thanks in advance,
> Dag
> 
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

Couple of years ago, I had a similar problem. I thought it might be nice 
to use a TableView to read out line breaks and so on, but there seems to 
be no way to do so. So I developed my own table printing including 
infinite tables which may spread over several pages.

The thing can be a bit tricky, but basically you have to size up each 
table cell (width, height) which makes for a single line. Then you 
measure the next one, and if it doesn't fit to the page, you open the 
next page. After testing this way, you delete everything and begin 
printing the real stuff using the notes you have stored along the way.

This sounds more cumbersome than it is actually, in fact I found it runs 
pretty fast. In my case, I decided to print into PDF only, and send the 
output to lp in the end. Making these PDFs is so fast I can use it for a 
preview.

Regards
Rolf


More information about the User mailing list