I am looking for some advice. The best way to do label printing from a SQL Database.
I need to print utility bills from a Desktop Xojo app I created. The post cards are 4 cards to a sheet. The sheet is 11" x 8.5" (landscape) and each bill is 5.5" wide and 4.25" high. I have attached an image of the sheet.
I would prefer to do this in Xojo with the Report writer built into Xojo but I am open to other options. I have used Crystal Reports in the past but it has been years since I used it.
If I use a third party tool or report writer I would prefer the end user not know they are leaving my app to run the report.
Any suggestions would be appreciated.
Julian
Hi Julian,
I’ve only played around with the Xojo report writer briefly, so I cannot offer any advice on that. We use DynaPDFMBS for creating postcard utility bills and imposing them on the final print sheet very similar to what you are needing.
For your needs, you should be able to use Xojo’s built-in PDF functionality and draw out everything to a PDF file. It will be a bit of a pain programming this and getting everything lined up, but if you do it this way it will be more flexible in the long run. Your software can create the PDF, then open the PDF file in Acrobat and you can print from there. If you want to keep the user inside your app, you can also open the PDF in an HTML viewer.
In Xojo, create an 11" x 8.5" PDF. Then have a method with parameters of the top/left coordinates of a single postcard along with the row from the database of the information needed to print on the card. Then draw out everything for a single postcard relative to that point. This allows you to easily “place” the postcards on the sheet in the correct positions. You will just loop through 4 records to place 4 cards on a sheet.
In the future, if you have a need to create a single postcard, you can then use the same method to draw out a single postcard on a PDF that is 5.5" x 4.25" with your top left coordinates set to 0,0.
I’ve sent you a message in case you want to discuss other options as this is literally what I do every day. My company prints and mails documents and we use Xojo extensively.
Brandon