Results 1 to 7 of 7

Thread: Barcode

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893

    Barcode

    Hi all,
    is possible to insert barcode inside rsp page?

    I've try to set the fontface in the HTML
    Code:
    	? ('			<td style="vertical-align: top; font face="Code 128AB HR Normale">')
    	? ('				Barcode<br />')
    	? ('				' + barcode + '</td>')
    but not work..

    thanks
    Fabio

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,088
    Blog Entries
    22
    Try googling "display barcode in HTML"
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Thanks Barry,
    I've found this:
    http://www.barcoderesource.com/htmlB...shtml#download

    then I've try to:
    copy the js folder inside lianja\library folder
    htmlBarcodeOpenSource\openSource\code128b\js

    thenh, I've created a sample rsp page:
    Code:
    <%@ Language=VFP %>
    <html>
    <head>
    <Meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <%
    private m_libpath = libPath()
    
    	if isServer() or .t.
    		? "<link type='text/css' rel='stylesheet' href='../../library/report.css'/>"
    	else
    		? "<link type='text/css' rel='stylesheet' href='lib:/report.css'/>"
    	endif
    
    %>
      
    <script type="text/javascript" src="../../library/js/connectcode-javascript-code128b.js"></script>
    <style type="text/css">
    <%@ include="report.css" %>
    
      	#barcode {font-weight: normal; font-style: normal; line-height:normal; sans-serif; font-size: 12pt}
    
    </style>
    </head>
    <body>
     
    <%
    
    text raw
    <script>
    window.Lianja = window.parent.Lianja;
    
    <script type="text/javascript">')
    
    function get_object(id) {
    	var object = null;
    	if (document.layers) {
    		object = document.layers[id];
    		} else if (document.all) {
    			bject = document.all[id];
    		} else if (document.getElementById) {
    			object = document.getElementById(id);
    			}
    			return object;
    			}
    			get_object("barcode").innerHTML=DrawHTMLBarcode_Code128B(get_object("barcode").innerHTML,"yes","in",0,3,1,"bottom","center","","black","white");
    
    		
    </script>
    endtext
    
    
    ///////////////////////////////////////////////////////////////////////////////////////////////////////////
    
    	
    timeofday()
    set macros on
    set fixed on
    //--
    // report.rsp?parameter=value&parameter=value...
    //
    // parameters
    //--
    
    
    // declare some special symbols (html uses ampersand so do we for macros)	
    amp = chr(38) 
    nbsp = amp + "nbsp;"  
    
    // generate the html output 
    ? ('<table width="100%" style="overflow:auto;border-left:1px solid lightgray;border-right:1px solid lightgray;" cellpadding="0" cellspacing="0" bgcolor="white" border="0px">') 
    ? ('<caption class="tablecaption">Scheda articolo on &(date()) at &(time())</caption>') 
    
    
    // first row of the table
    gridlines = "true"  
    
    
    
    	
    	? ('<table border="1" cellpadding="2" cellspacing="2" style="text-align: left; width: 100%;">')
    	? ('	<tbody>')
    	? ('		<tr>')
    	? ('			<td style="vertical-align: top;">')
    	? ('				Articolo<br />')
    	? ('				' + "Articolo" + '</td>')
    	? ('			<td style="vertical-align: top; font face="Code 128AB HR Normale">')
    	? ('				Barcode<br />')
    	
    	? ('<div id="barcodecontainer" style="width:5in">')
    	? ('<div id="barcode" >' + "12345AB" + '</div>')
    	? ('</div>	')
    	
    	
    	? ('			</td>')
    	? ('		</tr>')	
    
    	? ('	</tbody>')
    	? ('</table>')
    
    	? ('				<p> <br /></p>')
    		
    
    ?? ('</table>')
    
    // delete temporary files
    
    erase '&tmpfile..dbf'
    erase '&tmpfile..dbt'
    
    // restore record position as the table may be open in many places
    if m_recno <> 0
    	select &table
    	if not empty(m_tag)
    		set order tag &m_tag
    	endif
    	goto &m_recno
    endif
    
    // reselect cursor that was active on entry
    select &m_selected 
    
    
    		
    </script>
    
    
    %>
    </body>
    </html>
    but not work... :-(

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Following the sample... work.
    Name:  2016-04-04 12_24_15-Film e TV.jpg
Views: 742
Size:  41.5 KB

  5. #5
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,134
    Nice work, Fabio.
    Thank you for sharing your success story.

    Josip

  6. #6
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Thanks Josip
    happy to contribute to the cause ..

    ciao
    Fabio

  7. #7
    Junior Member
    Join Date
    Jun 2014
    Posts
    2

    Barcode

    Quote Originally Posted by phabio View Post
    Thanks Josip
    happy to contribute to the cause ..

    ciao
    Fabio

    Hi Fabio,

    Forgive my ignorance, how did you call the sample rsp that you've created, and how the appbuilder able to output it. Can you please explain a little more detail.

    Thanks
    Elias

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us