tanks diasroshan,
i will try then replay the reslut..ok
orainy..
Main Topics
Browse All Topicscould you please help me to write a function to generate a barcode with powerbuilder application..
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
exported DW,
$PBExportHeader$d_barcode.
release 9;
datawindow(units=0 timer_interval=0 color=1073741824 processing=0 HTMLDW=no print.printername="" print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.canusedefaultprinter
summary(height=0 color="536870912" )
footer(height=0 color="536870912" )
detail(height=368 color="536870912" )
table(column=(type=char(10
)
text(band=detail alignment="1" text="Test:" border="0" color="33554432" x="37" y="4" height="64" width="137" html.valueishtml="0" name=test_t visible="1" font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="53687091
column(band=detail id=1 alignment="0" tabsequence=10 border="0" color="33554432" x="210" y="4" height="76" width="274" format="[general]" html.valueishtml="0" name=test visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="53687091
bitmap(band=detail filename="E:\Barcode\bc126
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" encodeselflinkargs="1" netscapelayers="0" )
export.xml(headgroups="1" includewhitespace="0" metadatatype=0 savemetadata=0 )
import.xml()
export.pdf(method=0 distill.custompostscript="
Cheers,
Rosh
Business Accounts
Answer for Membership
by: diasroshanPosted on 2007-09-22 at 23:51:38ID: 19943674
Hi,
e.com/Prog ramming/Ed itors_IDEs / PowerBuil der/Q_2157 6693.html
e_barcode. sru
(SQLCA)
eet_no, gs_company_code)
1, "sheet_no") 1, "sheet_no") ,"Arial Narrow",08,0,0,20,0,0,0,0, 0,0)
,0,20,20,l l_bar,ls_b c_text,ls_ bc_text2) ,0,20,20,l l_bar,ls_b c_text,ls_ bc_text2, ls_bc_quality, ls_fabric_type, ls_f_roll, ls_pl_dyelot, ls_shade, ls_grade, ls_pack_roll_no,ls_meter, ls_point)
+ "has occurred")
(ll_count, "bc_pic", ls_image)
y
ls_contrac tno)
plz refer,
http://www.experts-exchang
U need to download a DLL called bclw32.dll
U have to declare the following as Global External Functions
FUNCTION long CreateBarCode( long barcodetype, long rotation,long color, int barwidth, long barheight, long humanwhere,string humanfacename, long humansize, long humanstyle, long supplement,long ratio, long checksum, long pdfsecurity, long forcedRows, long forcedCols,long addDotsToSpace, long addDotsToBar )LIBRARY "bclw32.dll" alias for "CreateBarCode;Ansi"
FUNCTION Integer DrawBarCodeToHDC( int hdc, int x, int y, int alignment,long lpbarcode, string lpcodetext, string lphumantext)LIBRARY "bclw32.dll" alias for "DrawBarCodeToHDC;Ansi"
FUNCTION long DrawBarCodeToFile( string lpfilename,long filetype, long xdpi, long ydpi, long lpbarcode,string lpcodetext, string lphumantext )LIBRARY "bclw32.dll" alias for "DrawBarCodeToFile;Ansi"
FUNCTION integer DeleteBarCode( long hbc )LIBRARY "bclw32.dll"
i have created an NVO (uo_generate_barcode) and a function in it called fn_gen_barcode with argument contract_no
here is the export file...
$PBExportHeader$uo_generat
forward
global type uo_generate_barcode from nonvisualobject
end type
end forward
global type uo_generate_barcode from nonvisualobject
end type
global uo_generate_barcode uo_generate_barcode
forward prototypes
public subroutine fn_gen_barcode (string contract_no)
end prototypes
public subroutine fn_gen_barcode (string contract_no);long ll_bar , ll_count, ll_len, ll_start = 3000,ll_start2 = 2000, ll_cm = 0
long ll_nFactor = 0, ll_mtrs, ll_bcWidth = 0,lngBarcodeWidth = 0
long ll_bar_file, ll_delete_bar , ll_rows, ll_tot_rows, ll_astrx_pos,ll_width
long ll_rows_ret, ll_roll_no, ll_fin_rows
string ls_roll_from, ls_roll_to, ls_barcode, ls_rolltype
string ls_colour_name, ls_quality_name, ls_fabric_name, ls_qlty_text, ls_bc_text2,ls_dept_name, ls_image, ls_path, ls_roll_no, ls_bc_text
string ls_sheet_no
date ld_prod_date
datetime ldt_prod_date
blob lblob_file_image
integer li_label_printed, li_answer
//U can change the below code as per ur requirement
DataStore dw_bar_code
String gs_company_code
dw_bar_code.DataObject = "dw_barcode"
dw_bar_code.SetTransObject
//Till here
SetPointer(HourGlass!)
dw_bar_code.Reset()
ls_sheet_no = contract_no //trim(sle_pl_no.text)
ll_rows_ret = dw_bar_code.retrieve(ls_sh
if ll_rows_ret <= 0 then
messagebox ("Not Exist", "This Contract Sheet does not exist")
return
end if
ll_count = dw_bar_code.rowcount()
ls_path='C:'
ls_bc_text2 = dw_bar_code.getitemstring(
ls_bc_text = dw_bar_code.getitemstring(
//Creates barcode
/// original fonts.
ll_bar = CreateBarCode(5,0,0,1,50,2
if ll_bar = 0 then
messagebox("Create Error","Out of memory creating bar code ")
return
end if
//Image path and filename
ls_image = "c:\bc" + string(ll_count) + ".bmp"
//Saves the barcode as a JPEG
ll_bar_file = DrawBarcodeToFile(ls_image
//ll_bar_file = DrawBarcodeToFile(ls_image
if ll_bar_file <> 0 then
messagebox("Draw Error",string(ll_bar_file)
return
end if
long ll_ins_row
//Sets barcode label information
//I COMMENTED THIS LINE ,U CAN UNCOMMENT IT
// parent.dw_bar_code.SetItem
li_label_printed = li_label_printed + 1
long ll_job
//Prints the DataWindow
ll_job = PrintOpen()
PrintDatawindow(ll_job, dw_bar_code)
PrintClose(ll_job)
// parent.dw_bar_code.reset()
//dw_bar_code.print()
//p_1.picturename = ls_image
ll_delete_bar = DeleteBarCode(ll_bar)
if ll_delete_bar <> 1 then
messagebox("Delete Error ","Error while deleting barcode")
end if
end subroutine
on uo_generate_barcode.create
call super::create
TriggerEvent( this, "constructor" )
end on
on uo_generate_barcode.destro
TriggerEvent( this, "destructor" )
call super::destroy
end on
// NVO ends here
ok... now what u need is to do the necessary changes as per ur requirements...
also the close event can be added as a function in the NVO or wherever u like it to be...
the Global external functions need to be declared...
what i have done is in the NVO used it as a datastore.. another option is u can also pass the DW as an argument...
now for calling the function in the NVO the code is as follows...
uo_generate_barcode uo_barcode
uo_barcode = Create uo_generate_barcode
uo_barcode.fn_gen_barcode(
hope this is what ur lookin for...
Cheers,
Rosh