B4J Question Best way to Print from B4J

Mikelgiles

Active Member
Licensed User
Longtime User
My app is using a small B4XTable of under 100 rows and I need to loop through the table and print most of the rows. I will only print some of the columns and a few columns will print some calculations rather than what is in the table. The table represents one month of data and the table will be printed multiple( for a quarter or a full year) times with modified dates and values.
So far I have run across JavaFX8 print and PrintHtml. I have never used either and my printing experience is mainly based in VB6. I need to know if there are other methods, which method is the preferred method, which method is the easiest to learn, and which is best long term. Any input is appreciated.
 

Peter Simpson

Expert
Licensed User
Longtime User
. I have never used either and my printing experience is mainly based in VB6. I need to know if there are other methods, which method is the preferred method, which method is the easiest to learn, and which is best long term. Any input is appreciated.

Print lists, charts etc etc etc using JavaFX8, nuff said

Also
 
Upvote 0

emexes

Expert
Licensed User
Or generate a .html file and display it for preview and (optional) printing in a browser window. HTML <TABLE> "command" is pretty straightforward, columns are autosizing, you can align left/right/center, use color and fonts, etc. Plus if your users copy-paste from the browser window into a spreadsheet, the table structure should be maintained. Bonus!
HTML:
<HTML>

<H1>Brian was here</H1>
<H2>June 2020</H2>

<TABLE BORDER=1>

<TR>
<TH>One</TH>
<TH>Two</TH>
<TH>Three</TH>
<TH>Four</TH>
</TR>

<TR>
<TD>Now</TD>
<TD>Is</TD>
<TD>The</TD>
<TD>Time</TD>
</TR>

<TR>
<TD>For</TD>
<TD>All</TD>
<TD>Good</TD>
<TD>Men</TD>
</TR>

<TR>
<TD>To</TD>
<TD>Come</TD>
<TD>To</TD>
<TD>The</TD>
</TR>

<TR>
<TD>Aid</TD>
</TR>

<TR>
<TD COLSPAN=2>Of</TD>
</TR>

<TR>
<TD COLSPAN=3>The</TD>
</TR>

<TR>
<TD COLSPAN=4>Party</TD>
</TR>

</TABLE>

</HTML>

1592645827040.png
 
Last edited:
Upvote 0
Top