Barcode

Q:

is possible to insert barcode inside rsp page?
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

%>
  
http://../../library/js/connectcode-javascript-code128b.js
<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

window.Lianja = window.parent.Lianja;

')

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");

        

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 />')
    
    ? ('
') ? ('
' + "12345AB" + '
') ? ('</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>

A:
Following the sample… work.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s