CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Custom HTML and barcodes

Print topic Send  topic

Author Message
Aaron


Posts: 145
Posted: 12/28/2006, 6:03 AM

Well, the barcodes part I've figured out by some trial and error with some free scripts from http://hotscripts.com. Getting this to work in a plain vanilla php file was easy. The hard part (at least for me) is getting CCS to handle it.

Basically what this script does is it will take text and create an image of a barcode in whichever format you tell it and whatever size you tell it. No prob. So I modified it to build this code dynamically with php parameters I fed it through the URL using $_GET. Ok, so on to my question; here is the code which I know works in a stand alone php file.

<IMG SRC="barcode.php?barcode=<?= $_GET['rxControlCode']; ?>&width=320&height=75">
Where width&height are the width and height of the barcode generated and passed to barcode.php

(You could replace <?= $_GET['rxControlCode']; ? with static text if you wanted the same barcode printed time after time, though I found that a bit pointless)

As you can see it is placed within an image tag since it uses GD on the server to create the barcode as an image. So ... how in the world do I get CCS to use this code? I've tried http://docs.codecharge.com/studio31/html/ProgrammingTec...omHTML.html?toc and tried various other things in both design view and html code view.

Any help would be most appreciative.

Regards & Happy New Year

Aaron
View profile  Send private message
Aaron


Posts: 145
Posted: 12/28/2006, 7:30 AM

Ok. Well, I've made a bit of progress. Using the examples from the above link to the manual I came up with a label called CustomHTML. I've added a beforeShow event which looks like this:
  
$CustomHTML->SetValue("Barcode <img src=barcode.php?barcode=<?=$_GET['rxControlCode'];?>&width=320&height=75");  

Now, this gives me an error of:
Quote :
PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /printPerson_events.php on line 21

(Note: The code above is line 21)

But! Replacing the above code with a static number; barcode=1234 and not $_GET it will put a proper barcode on the page, no errors. So I guess what I'm looking for is how to pass rxControlCode value to this and print to the screen. I'm guessing it has to do with escaping some how, but I've yet to hit on the right combination.

Regards,

Aaron
View profile  Send private message
Aaron


Posts: 145
Posted: 12/28/2006, 7:54 AM

Well, some people, when left to their own vices, will eventually figure something out. :-D

I was certainly on the right track, just on the wrong train. Here is the code if anyone cares; still in the BeforeShow event of the CustomHTML label

    $CCD = $_GET['rxControlCode'];  
    $CustomHTML->SetValue("<img src=barcode.php?barcode=".$CCD."&width=320&height=75");  

Basically, split the line up. Do the $_GET before trying to send it to the barcode builder.

Regards, mates. Happy New Year

Aaron
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.