Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
method run(var eventInfo Event)
var
tc TCursor
oldString, newString String
ar Array[] String
r Report
n ReportPrintInfo
p PrinterOptionInfo
endVar
if not tc.open("test.db") then errorShow() return endIf
tc.edit()
scan tc :
message(strVal(tc.recNo() + " of " + strVal(tc.nRecords())))
oldString = tc.CompanyName
oldString.breakApart(ar) ; by default, breaks string on spaces
newString.blank()
for i from 1 to ar.size() ; combine the parts to make a new string w/o spaces
newString = newString + ar[i]
endFor
oldString = newString ; oldString does not contain any spaces
oldString.breakApart(ar, "!@#$%^&()_+-={}|[]:;',./<>?") ;break on special chars
newString.blank()
for i from 1 to ar.size() ; combine the parts to make a new string w/o special chars
newString = newString + ar[i]
endFor
tc.newCompanyName.blank()
tc.newCompanyName = upper(subStr(newString,1,4)) ;truncate and convert value
tc.newCompanyName.view("newCompanyName")
endScan
tc.endEdit()
tc.close()
p.orientation = prnLandscape
p.paperSize = prnLetter
printerSetOptions(p)
n.name = "myreport.rsl"
n.masterTable = "test.db"
n.orient = prnLandscape
if not r.print(n) then errorShow() endIf
endMethod
[\code]