Tornado API Library - V12.30.08

z.dbMagicCell Property

Transform grid cell value to a variaty of formats. A highlight of the ASP-db tool.

Product Version

EP,Gold
[VisualBasic]
PublicPropertydbMagicCellAsString
[C#]
publicstringdbMagicCell{set;}

Property Value

Mydb.dbMagicCell="(;,[]#|~/+{})Field | tag | Macro ~ Repeat"

Mydb.dbMagicCell="(;,[]#|~/+{})Field | tag | (Extended Macro ~ Repeat)"

KeywordDescription
(;,[]#|~/+{})Default delimiters. (;)=Group (,)=Field ([])=Format brackets (#)=MagicMacro Wrap (|)=Extended Field (~)=XMagicGroup (/)=In Set Delimiter (+)=Replace delimiter ({})=Wrapper of Replace Text like {T1+W1+T2+W2} -> replace text (T1) with Text (W1) and text (T2) with (W2) etc...
FieldField name or number. Field=LastName, Field=0
MacroMagic filter macro. MUST BE THE LAST PARAMETER OF THE GROUP. Do not place this before field and tag. Macro=(...)

Macro=SQL:.... SQL statement = embedded Grid with Header

Macro=SQL0:.... SQL statement = embedded Grid without header

(Extended Macro)When macro=(...) then content ... with the () wrapper is the extended macro with advanced features.

e.g. Mag.dbMagicCell = "fi=1|mac=(#1#|GTN|#2#|class=green~|EL||class=red)"

Macros

TagDescription
#AspdbIndex#Current record pointer.

X.dbMagicCell="fi=1| Mac=Last Name of Record - #aspdbIndex#"

#Field:Length:FormatString#FormatString = All valid VB Format function strings.

Example -

X.dbSQL="SELECT ProductID, UnitPrice, Quantity, Discount, UnitPrice * Quantity * (1-Discount) as ExtPrice FROM [Order Details] WHERE OrderID=123

X.dbMagicCell="fi=UnitPrice| macro=#unitPrice:currency#, fi=Quantity| tag=right"

#Filename.#If Filename EndsWith "." then it is assumed a filename is the value. File extension will be discarded.
#FieldName or Number#Value of field after going through magic filter.
#(FieldName or Number)#URL Encoded value of field after going through magic filter.
#[FieldName or Number]#HTML Encoded value of field after going through magic filter.
#Me#ServerVariables("SCRIPT_NAME")
#SQL#Current SQL.
#(SQL)# Current SQL URL encoded. Any single quotes will be converted to double and original doubles will be preserved as it is assumed that URL encoded strings is begin passed to the next operation.
<CR>Chr(13)
<LF>Chr(10)
#PopText#This is the same as the Memo poptext except that the Text field is popped. Use the same dbPoptext property.

QuickProp Keyword Abbreviation

mc

Remarks

MagicCell filter is one of the unique and most powerful feature of ASP-db. No other products can offer such capabilities. The 'raw' cell value is transformed according a very rich set of logical rules.

See Also

z Class | Tornado Namespace | Special Topic - MagicCell | Special Topic - Regular Expression