B4J Question [SOLVED] Print Tableview with jFX8print Library

Magma

Expert
Licensed User
Longtime User
Hi there...

I want to print a tableview to a printer using jFX8print...

So tried:
B4X:
    Dim PJ As PrinterJob = PrinterJob_Static.CreatePrinterJob
    PJ.ShowPageSetupDialog(Null)
    PJ.ShowPrintDialog(Null)
    PJ.PrintPage(TableViw) 'TableViw - i named like this because of many tabless... :-)
    PJ.EndJob

But this is like printing screen... So what is the best way printing the whole tableview (Has 200 lines - not 20...)...

I must loop through rows and print page by page...

Or there is other way better ?
 

stevel05

Expert
Licensed User
Longtime User
The Javafx print API will only print what is in a view, it doesn't all have to be visible. You could try making the Tableview big enough to hold all of the content, then print that. You can set the size back afterwards, or create a second table and copy the contents.

I haven't tried it if the Tableview is bigger than it's containing pane, it may not print all of it, but it might. If not, you could temporarily remove it from the parent . You'll need to test it.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
No it won't split it. Details of the layout including Pagination are up to the developer.
 
Upvote 0

Magma

Expert
Licensed User
Longtime User
@Daestrum ... is a solution - but every time need to change headers .. i will keep that in mind - now will go with javafx8 print lib - looped through tableview in a different form that i will have it for printing only...

Thanks to all.
 
Upvote 0
Top