Hi there csnet,
To use your barcode on a font, you need to select that font in the report writer. At the moment the report builder is limited to a limited set of fonts, based primarily on those that are available in FPDF. In the next release of nuBuilder this will be changing to use a dynamic list that can be updated in in the Lists screen. In the mean time, you can modify nureportbuilder.php as follows, starting from line 2053:
Code: Select all
print "\nvar theFamily = new Array()\n";
print "theFamily[0] = 'Arial'\n";
print "theFamily[1] = 'Courier'\n";
print "theFamily[2] = 'Georgia'\n";
print "theFamily[3] = 'Impact'\n";
print "theFamily[4] = 'Tahoma'\n";
print "theFamily[5] = 'Times'\n";
print "theFamily[6] = 'Verdana'\n";
print "theFamily[7] = 'Symbol'\n";
print "theFamily[8] = 'Webdings'\n";
print "theFamily[9] = 'Wingdings'\n";
print "theFamily[10] = 'YourBarcodeFontNameHere'\n"; //Use the file name of your font here
Once that is done, the implementation depends on the format you want for your report.
HTML
All users who wish to print the report with barcodes must have the font installed on their computer, and it must have the same name on their system as you have given it in the code above. This works if your affected users are on a local intranet and you can easily install the font to their computers or make it available to them for download. If they don't have the font installed, their browser will just show the barcode as text in the default browser font.
PDF
For PDF reports you will need to create font definition and metrics files with fpdf/fonts/makefont/makefont.php. For detailed instructions on how to do this see
this tutorial.
Producing the report
Once either of these is in place, just add a text field in the report builder and set the font to your barcode font. Finally, be aware that some barcode fonts require you to add some extra markup to the ends of your barcode number/string, such as exclamation marks or hashes, and filter out any other punctuation marks or spaces. You will need to add this in the SQL code that generates your report data, e.g.:
Code: Select all
SELECT
productID,
prdName,
prdDescription,
CONCAT('!',prdBarcode,'!') AS barcode
FROM product
I hope this helps!
Regards,
Christopher