Focal Point
Bar Codes Generated in Reports?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6177044336

September 13, 2013, 04:40 PM
cdeal
Bar Codes Generated in Reports?
We are looking into putting bar codes instead of a numerical code on our mailings. Ideally we would like to have the bar codes generated and exported in a WebFocus report. Does anyone do this? I found one link that mentioned briefly how to do this in a PDF format, but we would need a specific bar code for each person in an address list. Is this possible with WebFocus?

Thanks in Advance!


WebFocus 7703
September 14, 2013, 03:18 AM
Alan B
We used to do this with an image generator into HTML, but that software disappeared, but the original code still works.

A different approach I've seen is here which generates Code 39 barcodes with js and css.


Alan.
WF 7.705/8.007
September 15, 2013, 01:18 PM
dhagen
I haven't done this, but you could use a free java bar code generator like barbecue and build a CALLJAVA routine to generate the images in your TEMPDISK, FOCCACHE or whatever. Then reference them in whatever output format you are looking for.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 15, 2013, 09:23 PM
StuBouyer
You can do this within WebFOCUS quite simply - once you have the fonts installed for PDF use anyway.

If you are just doing HTML then it's even easier.

1) Grab your self a barcode font - the Open Source barfonts (http://www.karrman.org/barfonts/) works well and can be set up for PDF easily.

2) Write your FEX. Note: for all the Code 39 fonts I found you needed to start and end your string with '*'

Here is an example from CAR

DEFINE FILE CAR
SERIAL/A50 = '*HAPPY-FROG-7856956*';
CNTRY_CODE/A50 = '*' || COUNTRY || '*';
END
TABLE FILE CAR
SUM 
     SALES
     CNTRY_CODE
BY  COUNTRY
HEADING
"<SERIAL"
" "
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
$
TYPE=REPORT,
     GRID=OFF,
$
TYPE=DATA,
     COLUMN=N3,
     FONT='BARCODE39',
$
TYPE=HEADING,
     LINE=1,
     OBJECT=FIELD,
     ITEM=1,
     FONT='BARCODE39',
     SIZE=42,
$
ENDSTYLE
END  


When I scan the barcodes with my phone I get the names of the Country for each row. Shouldn't take to much to create individua; mailing labels.

Regards

Stuart


WebFOCUS 8.2.03 (8.2.06 in testing)
September 16, 2013, 03:52 AM
Wep5622
quote:
Note: for all the Code 39 fonts I found you needed to start and end your string with '*'


I think I know why that is. If a scanner sees an '*' at both sides of the scanned code, then it knows it read the entire code and not just part of it.

For HTML; I know that in modern HTML you can embed fonts, which would allow directly using the font in your HTML report. I haven't looked into that yet, but this seems a good reason to do so. That seems preferable to drawing barcodes using spans of different widths...

Well, this guy seems to have worked most of it out for us: http://taggedzi.com/articles/d...edding-fonts-in-html
Now it's just a matter of adding the right CSS for the fields that you want to use barcodes for and make sure the stylesheet gets referenced correctly in your mailed messages.

This message has been edited. Last edited by: Wep5622,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
September 16, 2013, 10:30 AM
JALDbaDev
This is what we do:
1. Define the bar code format:
POLICYN_BAR/A26=IF POL_LEN EQ 11 THEN '*' || '0' || POLICY_NUMBER || '00' || 'MCGCORR' || '===*' ELSE '*' || '0' || POLICY_CO || POLICY_NUM || '00' || 'MCGCORR' || '===*';
2. Put it in the letter footing:
FOOTING
"ON TABLE NOTOTAL
3. Format it:
TYPE=FOOTING,
FONT='IDAUTOMATIONHC39M',
SIZE=8,STYLE=NORMAL,
POSITION=(4.000000 11.00000),
$

Just remember that you need to load the bar code font on the server you're using.
September 16, 2013, 10:31 AM
JALDbaDev
oops. step 2 should be:
FOOTING
double quote - less than sign - bar code name - closing double quote
ON TABLE NOTOTAL
September 16, 2013, 10:35 AM
Wep5622
Yes, but that doesn't work for HTML I think? Unless you installed that particular font on all user PC's?

BTW, your markup broke; you need to put your code between code tags (the button marked </> in the toolbar).


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
September 16, 2013, 10:43 AM
neuro
YEs you can have a font in HTML that is not on the PC... Custom Font in HTML


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11
September 16, 2013, 10:44 AM
cdeal
Thank you all! We first need to install the font, so I will start there. Thank you for help!


WebFocus 7703
September 16, 2013, 10:55 AM
neuro
If you are doing it via HTML then you wont need to install it just call the font file. Though not sure from a PDF perspective. Sometimes we have to end up displaying to HTML and then printing to PDF because we just cannot get PDF output from Focus to do what we want.


Currenly working @ Learning Circle Education Services
Previously worked @ Nationwide Insurance
Prod: WebFOCUS 7.6.11


Test: WebFOCUS 7.6.11


Dev: WebFOCUS 7.6.11