Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT REPORT/UPC - BARCODE(Generate a report from an HTMl with UPC/BARCODE)
BIRT REPORT/UPC - BARCODE [message #1008222] Mon, 11 February 2013 14:45 Go to next message
Leo Mising name is currently offline Leo Mising nameFriend
Messages: 10
Registered: July 2009
Junior Member
Hi guys,

I have a question hope someone can give me a heads-up.

I am using:

Birt 3.7.2
Tomcat6
Ubuntu 10
MySQL


I have a JSP which is called by the user. The JPS concatenates an HTML string which in turn is inserted into a MySQL table/field.

The concatenated HTML string uses a jQuery plugin to generate a UPC/barcode. Inside the HML Head I have:

<script type="text/javascript" src="http://[IP ADDRESS]/birt/webcontent/birt/upc/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://[IP ADDRESS]/birt/webcontent/birt/upc/jquery-barcode-2.0.2.min.js"></script> 


Then in the HTML Body I have:

<div id="bcTarget"></div>
<script>
	$("#bcTarget").barcode("012345678", "code39",{barWidth:1, barHeight:30}) ;  
</script> 


Finally, I call the Birt report which selects the appropriate HTML from the table. I place the HTML in a Dynamic Text field:

<VALUE-OF format="HTML">row["HTMLSTRING"]</VALUE-OF>


The HTML is rendered correctly but with no UPC/barcode. I try the HTML outside of Birt and it generates the barcode correctly.

I have also tried to place the jQuery files inside /webcontent/birt, but this does not work either.

Please help.
Re: BIRT REPORT/UPC - BARCODE [message #1008332 is a reply to message #1008222] Mon, 11 February 2013 23:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you post an example of the returned html?


Jason
BIRT-Exchange
Re: BIRT REPORT/UPC - BARCODE [message #1008339 is a reply to message #1008332] Tue, 12 February 2013 01:18 Go to previous messageGo to next message
Leo Mising name is currently offline Leo Mising nameFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Jason,

Here is the basic HTML. I had to block some content but other than that, it's identical.

Thanks in advance.

<?xml version="1.0" encoding="ISO-8859-1"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
	<HEAD>		
		<style type="text/css">			
			table.gridtable			
			{				
				font-family: verdana,arial,sans-serif;				
				font-size:11px;				
				color:#333333;				
				border-width: 1px;				
				border-color: #666666;				
				border-collapse: collapse;				}			

			table.gridtable th			
			{				
				border-width: 1px;				
				padding: 8px;				
				border-style: solid;				
				border-color: #666666;				
				background-color: #dedede;			
			}			

			table.gridtable td				
			{				
				border-width: 1px;				
				padding: 8px;				
				border-style: solid;				
				border-color: #666666;				
				background-color: #ffffff;			
			}		
		</style>		

		<LINK REL="stylesheet" HREF="http://[ IP ADDRESS ]/birt/webcontent/birt/styles/contractpage.css" TYPE="text/css"> 		
		
		<script type="text/javascript" src="http://[ IP ADDRESS ]/birt/webcontent/birt/upc/jquery-1.3.2.min.js"></script> 		
		<script type="text/javascript" src="http://[ IP ADDRESS ]/birt/webcontent/birt/upc/jquery-barcode-2.0.2.min.js"></script> 	
</HEAD>	
<BODY>		
	<table width="790" border="0"> 	 	
		<tr>				
			<td width="160">					
				<img src="http://[ IP ADDRESS ]/v1.0_dev/reports/images/[Content Blocked].png" width="150" height="90" />				
			</td> 	   		
			<td width="580" align="center" style="font-size:9px">					
				[Content Blocked]				
				
				<div id="bcTarget"></div>	
				
				<script>		
					$("#bcTarget").barcode("canvasTarget", "code39",{barWidth:1, barHeight:30});		
				</script>				
			</td>    			
			<td width="160" align="center">
				Mon, 11 Feb 2013				
			</td>  		
		</tr>		
	</table>			

	<table width="790" class="gridtable">  			
		<tr>    				
			<td  width="266" align="center" style="border-bottom-style:solid; border-bottom-width:1px;">
				02/11/2013					
			</td>   				 
			<td  width="266" align="center" style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]
			</td>   			 	
			<td  width="266" align="center" style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]
			</td>  			
		</tr>  			
		<tr>    				
			<td width="266" align="center">						
				Effective Date/Fecha de Inicio					
			</td>    				
			<td width="266" align="center">						
				Chart Number/Numero de Historia					
			</td>    				
			<td width="266" align="center">						
				Clinic Location/Localidad					
			</td>  			
		</tr>			
	</table>			

	<br />			
	<table widh="790" border="0">				
		<tr>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">
				05/31/1963					
			</td>					
			<td width="130" align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">					
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">					
			</td>				
		</tr>				
		<tr>					
			<td align="center">
				D.O.B/Fecha de Nacimiento
			</td>					
			<td width="130" align="center">
				Gender/Sexo
			</td>					
			<td align="center">
				S.S #/Seguro Social
			</td>					
			<td align="center">
				Driver's Licence #/Licencia de Conducir
			</td>				
		</tr>			
	</table>			

	<br />			
	<table width="790" border="0">				
		<tr>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">						
				<font size="-2">
					[Content Blocked]
				</font>					
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">					
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]
			</td>				
		</tr>				
		<tr>					
			<td width="210" align="center" style="font-size:18px">						
				Address/Direccion					
			</td>					
			<td width="90" align="center" style="font-size:18px">						
				Apt/Suit #					
			</td>						
			<td width="170" align="center" style="font-size:18px">						
				City/Ciudad					
			</td>					
			<td width="90" align="center" style="font-size:18px">						
				State/Estado					
			</td>					
			<td width="130" align="center" style="font-size:9px">						
				Zip code/						
				<br />						
				Codido Postal					
			</td>				
		</tr>			
	</table>			

	<br />			
	<table width="790" border="0">				
		<tr>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">
				[Content Blocked]				
			</td>				    
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">					
			</td>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">					
			</td>				
		</tr>				
		<tr>					
			<td width="266" align="center">						
				Phone/Telefono Recidencial					
			</td>					
			<td width="266" align="center">						
				Work Phone/Telefono de Trabajo					
			</td>					
			<td width="266" align="center">						
				Email/Correo Electronico					
			</td>				
		</tr>			
	</table>			

	<br />			
	<table width="790" border="0">				
		<tr>					
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">&nbsp;
									
			</td>	  				
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">&nbsp;
									
			</td> 				
			<td align="center"  style="border-bottom-style:solid; border-bottom-width:1px;">&nbsp;
									
			</td>				
		</tr>				
		<tr>					
			<td width="266" align="center">						
				Emergency Contact/						
				<br />						
				Contacto en Caso de Emergencia					
			</td>					
			<td width="266" align="center">						
				Address/Direccion					
			</td>					
			<td width="266" align="center">						
				Phone/Telefono					
			</td>				
		</tr>			
	</table>			
	
	<br />			
	<table width="790" border="1" class="gridtable">				
		<tr bgcolor="#dedede";>					
			<td width="200" align="center" style="font-size:9px">						
				Member Name/						
				<br />						
				Nombre					
			</td>					
			<td width="90" align="center" style="font-size:9px">						
				D.O.B/						
				<br />						
				Fecha de Nacimiento					
			</td>					
			<td width="70" align="center" style="font-size:9px">						
				Age/Edad					
			</td>					
			<td width="100" align="center" style="font-size:9px">						
				Gender/Sexo					
			</td>					
			<td width="180" align="center" style="font-size:9px">						
				Relationship/Parentesco					
			</td>					
			<td width="160" align="center" style="font-size:9px">						
				Chart #/Numero de Historia					
			</td>				
		</tr>			
		<tr>					
			<td style="font-size:xx-small"> 
				[Content Blocked]
			</td>					
			<td>
				[Content Blocked]
			</td>					
			<td>
				[Content Blocked]
			</td>					
			<td>
				[Content Blocked]
			</td>					
			<td>&nbsp;						
									
			</td>					
			<td>
				[Content Blocked]
			</td>			
		</tr>
	</table>
	
	<br />			
	<table width="790" border="1" class="gridtable">				
		<tr>					
			<td width="284" align="left" style="font-size:14px">						
				Payment Method/Metodo de Pago:					
			</td>					
			<td width="500" align="center" style="font-size:xx-small">
				[Content Blocked]
			</td>				
		</tr>			
	</table>			
	
	<br />			
	<table width="790" border="1" class="gridtable">				
		<tr bgcolor="#dedede";>					
			<td width="266" align="center" style="font-size:xx-small">						
				First Payment/						
				<br />						
				Primer Pago					
			</td>					
			<td width="266" align="center" style="font-size:xx-small">						
				Monthly Amount						
				<br />						
				Mensualidad					
			</td>					
			<td width="266" align="center" style="font-size:xx-small">						
				First Recurring Payment/					
				<br />						
				Primer Pago Periódico					
			</td>				
		</tr>				
		<tr>					
			<td width="266" align="center" style="font-size:18px;">
				[Content Blocked]
			</td>					
			<td width="266" align="center" style="font-size:18px;">
				[Content Blocked]
			</td>					
			<td width="266" align="center" style="font-size:18px;">
				[Content Blocked]
			</td>				
		</tr>			
	</table>				

	<br />				
	<div style="width:790px">					
		<font size="-2">						
			[Content Blocked]			
		</font>
	</div>
	</BODY>
</HTML>

Re: BIRT REPORT/UPC - BARCODE [message #1008485 is a reply to message #1008339] Tue, 12 February 2013 17:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I believe the issue has to do with these lines:

<script type="text/javascript" src="http://[ IP ADDRESS ]/birt/webcontent/birt/upc/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://[ IP ADDRESS ]/birt/webcontent/birt/upc/jquery-barcode-2.0.2.min.js"></script>

I see you tried to add them to the viewer. Where did you put them? Also Rob Murphy developed a BIRT library to work around dynamically including JS files and posted an example of BIRT-Exchange. You can find it here:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1576-dynamic-javascript-loader/

Jason
BIRT-Exchange
Re: BIRT REPORT/UPC - BARCODE [message #1008655 is a reply to message #1008222] Wed, 13 February 2013 12:56 Go to previous messageGo to next message
Leo Mising name is currently offline Leo Mising nameFriend
Messages: 10
Registered: July 2009
Junior Member
Thanks Jason,

I will take a look at that link.
Re: BIRT REPORT/UPC - BARCODE [message #1020497 is a reply to message #1008655] Mon, 18 March 2013 10:11 Go to previous messageGo to next message
Kanly Thai is currently offline Kanly ThaiFriend
Messages: 1
Registered: March 2013
Junior Member
The below UPC barcode SDK for Java that can easily create UPC barcodes in BIRT report may be helpful.
www.avapose.com/java_barcode/upca_generator.shtml
Re: BIRT REPORT/UPC - BARCODE [message #1077055 is a reply to message #1020497] Thu, 01 August 2013 07:35 Go to previous messageGo to next message
mariah sharp is currently offline mariah sharpFriend
Messages: 6
Registered: July 2013
Junior Member
and is www.keepautomation.com/online_barcode_generator/upca/ helpful?

[Updated on: Mon, 30 June 2014 13:49] by Moderator

Report message to a moderator

Re: BIRT REPORT/UPC - BARCODE [message #1220326 is a reply to message #1020497] Wed, 11 December 2013 06:51 Go to previous message
leona lewis is currently offline leona lewisFriend
Messages: 2
Registered: October 2013
Junior Member
Kanly Thai wrote on Mon, 18 March 2013 06:11
The below UPC barcode SDK for Java that can easily create UPC barcodes in BIRT report may be helpful.
www.avapose.com/java_barcode/upca_generator.shtml

thanx for sharing this good site ,useful!
Previous Topic:url to list available reports
Next Topic:Barcode Fonts Support, Status?
Goto Forum:
  


Current Time: Tue Mar 19 04:04:18 GMT 2024

Powered by FUDForum. Page generated in 0.01919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top