Print questions

Hi, I want to cleanup and maybe migrate my noncommercial VFP Apps to XOJO ( Windows only )
The apps are very simple and running now for almost 10 years printing certificates for Taekwondo belt exams.

The forms are very simple A4 Paper with preprinted values. Variables : Name, Kup Grade , Date…, and a graphic element

Can this be handled with the Xojo report engine?
In the past I gave the people using this app, the vip report designer, but the only one using it was me.
To make it flexible I will use a static report template.

Q1: Im also printing labels ( Brother QL) : one idea is to use the brother sdk and the brother report engine to setup the templates. And then let Xojo filling the print job with life…
The apps are still running and running,… so no hurry…
Up till now , its driven by the vip report engine and can be changed with the buildin report engine. But nobody is really using it, as the forms don’t change very often.

Stay healthy

Hello Rainer,

I’m an ex-VFP person myself. I think the consensus is that the Xojo Report Engine is fairly light weight. If you want to do more sophisticated reporting, I’d recommend looking into BKeeney Shorts which was recently purchased and can be found here:

For my part, I’ve come up with another approach. I’ve developed a HTML based reporting class where I develop a HTML based template, merge in the data and then use the wkhtmltopdf class to turn it into a PDF document. This works well on both Desktop and Web applications.

Good luck!

how do you include wkhtmltopdf in a xojo project, and how do you call it from code inside the project ? I would like that the user don’t have to install anything, just call the lib from my xojo app and the lib is inside my project.

Hello Kevin, thx for the tips.,
One reason why its still vfp, you can put it with some dlls on a stick, and as they do a lot belt exams every year, they can prepare it in advance… very very simple…

Stay healty

if you just need single pages without any groups the new xojo pdf class (2020r2) is easy to use.
(byeffect this version have a issue with hires images)
ok, pdf class have no designer but its faster and more handy than this xojo report engine.
and most of all os have a pdf viewer installed.
for qr/barcode i use mbs barcode.

1 Like

Danke Markus,
Soll halt einfach sein, die alte Version hatte noch Datenexport, Statistik etc. was nie verwendet wurde.
Zu meiner Zeit hies sowas Mailmerge, aber dann muß ich mich auch noch darum kümmern, welches Office installiert ist oder nicht.

Entstanden ist das ganze vor vielen Jahren, als jemand sich die Daten vom bestehenden Webinterface importierte und 1:1 an Word schickte.

Und die verdruckten Urkunden waren noch richtig teuer…
So hab ich halt was gebastelt Leider kannte ich da XOJO noch nicht…

Gruß Rainer

I am doing a lot of Xojo Web apps so installation of the wkhtmltopdf isn’t normally an issue. For distributed apps, I would just test the existance of the wkthmltopdf up front and give the appropriate message that it needs to be installed to run reports to PDF. Otherwise, HTML reports are still available to be displayed. Hope this helps.

VAR sCommand AS String = "c:\Apps\wkhtmltox\bin\wkhtmltopdf.exe --page-size Letter --margin-bottom 20mm -L 10mm -R 20mm --margin-top 35mm " + _
" --orientation " + sOrientation + _
" --header-spacing 10 --title testDoc --enable-local-file-access " + sFilePath + "\" + sFileNameHTM + 
" " + sFilePath + "\" + sFileNamePDF

Good old shell commands are still alive…

Hello Rainer,
If you build your application to a Windows exe, you still should be able to run it off of a USB Stick. I must admit that I haven’t tried it.

Yes, installl vfp,exe and runtime dlls in the same directory, that’s it…
Works as long you dont have external controls or UAC.

BR Rainer

i have a components under the app folder and include the mac and windows version of wkhtmltopdf.

and i use shell to call wkhtmltopdf and passed over all sort of parameter to print to A4 or letter, landscape or portrait… various margin etc and the finally the location of source html file and the destination pdf file

1 Like

Hello Kevin, here comes question no2.
If I use wkhtml2pdf , how to I set a field : exactly printed on a fixed position with html ?
Example : Name Field, from left 3cm, from top 8 cm

Thx Rainer

This is html. Therefore, you can try with CSS which is always no fun.

Genau… Danke. In old times we were sending funny sequences which were different for every printer manufacturer. Remember ESC/P

BR Rainer

Hello Rainer,

I’m reading between the lines for your intention. I’m thinking you are trying to print values into a pre-existing form? If you need this level of control, then I suggest you go the BKeeney Shorts. Or you can work with CSS but it will never be as exact as Shorts.

1 Like


sometimes its easy…
Installed latest XOJO, open sample folder ->reports…
Thats it, for 1 st test its more than I need…

Thx for all respones

BR Rainer

you can use a RowSet for Data from sqlite or just a class with this reports.dataset interface.
for testing the report print output i print to pdf printer driver.(if you not need a preview form)

1 Like

Danke… genau so einfach soll’s sein…And thanks to ARGEN from Tim, it will be very nice for the user on mac and win…

BR Rainer