System Functions

1. Common utility functions

Function Name Description
ew_SetDb(tablename) (v9+) Set up current database for table name
Parms
 tablename - table name
ew_GetDbId(tablename) (v9+) Return database id for table name
Parms
 tablename - table name
ew_DbType(dbid) (v9+) Return database type for database id
Parms
 dbid - database id
ew_IsAutoSuggest(fld) (v8+) Return if field is auto suggest field
Parms
 fld - field object
ew_UseForLabel(fld) (v8+) Return if field use for label
Parms
 fld - field object
ew_HasUserTable() (v8+) Return if user table used
ew_IsNotEmpty(val) (v6+) Return if value is not empty
Parms
 val - value
ew_IsEmpty(val) (v6+) Return if value is empty
Parms
 val - value
ew_InArray(val, ar) (v6+) Return if value is in array
Parms
 val - value
 ar - array
ew_FormObj(ctlid) (v6+) Return form object name
Parms
 ctlid - control id
ew_SqlSelect(sSelectLimit, sDistinct, sSelect, sFrom) (v6+) Return SQL SELECT statement
Parms
 sSelectLimit - SELECT LIMIT part
 sDistinct - use SELECT DISTINCT
 sSelect - SELECT part
 sFrom - FROM part
ew_CustomScriptRowCnt() (v8+)
Return custom template row count
ew_CustomScriptRowCntVar() (v8+)
Return custom template row count variable
ew_CustomScriptGroupVar() (v7+) Return custom template group variable
ew_CustomScriptRowVar() (v7+) Return custom template row variable
ew_CustomScriptGroupIndex(fld, cnt, grp) (v7+) Return custom template group index
Parms
 fld - field object
 cnt - group count
 grp - grouping field or not
ew_CustomScriptId(name, type ,idx) (v7+) Return custom template script id
Parms
 name - script name
 type - script type
 idx - row index
ew_CustomScriptTag(name, type, classname, idx) (v7+) Return custom template script tag
Parms
 name - script name
 type - script type
 classname - class name
 idx - row index
ew_GetJsScript(html) Return javascript from html
Parms
 html - html content
ew_RemoveJsScript(html) Remove javascript from html
Parms
 html - html content
ew_GetFieldHtmlTag(f) (v6+) Return field html tag
Parms
 f - field object
ew_NullIfFunction(fld) (v6+) Return SQL NULL IF function
Parms
 fld - field SQL
ew_CastFieldForLike(fld, type, dtfmt) (v6+) Return SQL that cast non-string field for LIKE statement
Parms
 fld - field SQL
 type - field type
 dtfmt - date format
ew_ContainsText(Str, Find) Return True if "Find" in "Str"
Parms
 Str - Source string
 Find - Find string
ew_HasTagValue(fld, val) Return if field contains tag value
Parms
 fld - field object
 val - tag value
ew_FldTagValues(fld) Return field tag values
Parms
 fld - field object
ew_SplitTagValues(str) Return an array of tag values
Parms
 str - "value 1","value 2",...
ew_IsBinaryField(Fld) Return True if field is binary
Parms
 Fld - field object
ew_SummaryValueName(id) Return summary value name
- (SumValue / AvgValue / MinValue / MaxValue)
Parms
 id (String) - Sum/Avg/Min/Max
ew_SummaryViewValueName(id) Return summary view value name
- (SumViewValue / AvgViewValue / MinViewValue / MaxViewValue)
Parms
 id (String) - Sum/Avg/Min/Max
ew_CssInherit(parm) Return "inherit" if parm is empty
ew_PageObj() Return page object name
ew_GetPageObjByCtrlId(ctlid) (v6+) Return page object name based on control id
Parms
 ctlid - control id
ew_GetCtrlById(id) (v6+) Return control object based on control id
Parms
 ctlid - control id
ew_Val(v) Return ASP.NET True/False value
Parms
 v - boolean value
ew_JsVal(v) Return JavaScript true/false value
Parms
 v - boolean value
ew_RandomKey() Return random key
ew_FolderPath(id) Return folder path
Parms
 id - control id
ew_GetFileNameByCtrlID(id) Return file name based on control id
Parms
 id - control id
ew_RelFolder(f) Return relative folder to current output folder
Parms
 f - folder path
ew_RelPath(f1, f2) Return relative folder of f1 to f2
Parms
 f1 - folder path 1
 f2 - folder path 2
ew_OutputRelPath(f) (v8+) Return output relative folder
Parms
 f - folder path
ew_DestRelPath(f) (v8+) Return relative folder to destination folder
Parms
 f - folder path
ew_AppRootRelPath(f) (v8+) Return relative folder to application root
Parms
 f - folder path
ew_EscapeString(sSrc, sEsc) Return escaped string
Parms
 sSrc - source string
 sEsc - escape string
 (double quote for VB, backslash for JS)
ew_DoubleQuote(str, cnt) Return double quoted string
Parms
 str - source string
 cnt - quote count
ew_Quote(str) Escape double quote in string
Parms
 str - source string
ew_SQuote(str) Escape single quote in string
Parms
 str - source string
ew_UnQuote(str) Remove embracing single/double quotes in string
Parms
 str - source string
ew_GetFieldType(fType) Return field type based on ADO field type
Parms
 fType - ADO Field Type
Output
 1 - Numeric
 2 - Date
 3 - String
 4 - Boolean
 5 - GUID
 6 - Others
 7 - Time
ew_IsDbGrpFld(grptype) Return True if database group type
Parms
 grptype - "f", "i", "y", "q", "m", "w", "d", "h", "min"
ew_DbGrpSql(grptype, grpint) Return grouping SQL
Parms
 grptype - "f", "i", "y", "q", "m", "w", "d", "h", "min"
 grpint - grouping interval ("f" / "i" types only)
ew_BoolFieldTagValues(ftype, tagvalues) Return tag values for Boolean field
Parms
 ftype - ADO Field Type
 tagvalues - original tag values
ew_SQLPart(sSQL, sId) Return part of the SQL
Parms
 sSQL - original SQL
 sId - token for different part of SQL
(SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT)
ew_RecPerPageList(sList, iRec) Return record per page list (comma separated)
Parms
 sList - original record per page list
 iRec - default record per page
ew_ProjClassName() Return project class name ("AspNetReportMaker6_<Project>")
ew_ChartCount(Pos) Return number of charts in position
Parms
 Pos - 1 (Top), 2 (Left), 3 (Right), 4 (Bottom), Not specified (All)
ew_FieldSqlName(fld) Return the sql name for the field
Parms
 fld - field object
ew_TableName(tbl) Return the sql name for the table
Parms
 tbl - table object
ew_QuotedName(name) Return the properly quoted sql name
Parms
 name - table/field name
ew_IsDateFilter(f) (v6+) Return true if field is enabled for date filter
Parms
 f - field object
ew_IsPopupFilter(f) (v6+) Return true if field is enabled for popup filter
Parms
 f - field object
ew_IsFieldDrillDown(f) (v6+) Return true if field is enabled for drill down report
Parms
 f - field object
ew_FieldDrillDownUrl(f) (v6+) Return field drill down url
Parms
 f - field object
ew_IsChartDrillDown(cht) (v6+) Return true if chart is enabled for drill down report
Parms
 cht - chart object
ew_ChartDrillDownUrl(cht) (v6+) Return chart drill down url
Parms
 cht - chart object
ew_DateSql(f) (v6+) Return date SQL
Parms
 f - field object

2. System Functions (Overridable)

USAGE: SYSTEMFUNCTIONS.<FunctionName>

Function Name Description
Charset() Return meta tag for charset specified
FavIcon() Return <link> tags for favicon specified
CssFile() Return <link> tag for css file specified
GetScript(scripttype,codetype,scriptname) Return server/client scripts
Parms
 scripttype - script type (Server / Client)
 codetype - code type (Global / Table / Other)
 scriptname - script name
GetServerScript(codetype,scriptname) Return server scripts
Parms
 codetype - code type (Global / Table / Other)
 scriptname - script name
GetClientScript(codetype,scriptname) Return client scripts
Parms
 codetype - code type (Global / Table / Other)
 scriptname - script name
ScriptExist(scripttype,codetype,scriptname) Return if server event / client script exists
Parms
 scripttype - script type (Server / Client)
 codetype - code type (Global / Table / Other)
 scriptname - script name
ServerScriptExist(codetype,scriptname) Return if server event exists
Parms
 codetype - code type (Global / Table / Other)
 scriptname - script name
ClientScriptExist(codetype,scriptname) Return if client script exists
Parms
 codetype - code type (Global / Table / Other)
 scriptname - script name
CustomTemplateExist() (v7+) Return if custom template exists
GetCustomTemplate() (v7+) Return custom template codes
ParseTemplate(template,templateid) (v7+) Pase and return custom template content
Parms
 template - template source codes
 templateid - template id
RenderCustomTemplate() (v7+) Return codes that render the custom template
GetTemplateScript(CodeType,ScriptName) (v7+) Return template scripts
Parms
 codetype - code type (Table)
 scriptname - template name
GetCustomViewTemplate(fld) (v7+) Return custom view template for field
Parms
 fld - field object
IsBoolFld() Return if field is boolean
NoCache() Return ASP.NET no cache codes
IncludeFile(id,parm) Return ASP.NET include file statement
Parms
 id - control id
 parm - "compat" to generate compat header/footer
ConnectionString() Return database connection string
Security() Return security checking codes
ScriptSummaryViewRefer() Return ASP.NET codes for rendering summary field for VIEW (HREF)
ScriptViewRefer() Return ASP.NET codes for rendering field for VIEW (HREF)
ScriptGroupView() Return ASP.NET codes for rendering grouping field for VIEW
ScriptGroupSummaryView() Return ASP.NET codes for rendering grouping field for VIEW (Summary)
ScriptView() Return ASP.NET codes for rendering field for VIEW
ScriptSummaryView(id) Return ASP.NET codes for rendering field for VIEW (Summary)
Parms
 id - Sum/Avg/Min/Max
ScriptViewCall(cv, vv, dtl) Return ASP.NET codes for rendering field for VIEW
Parms
 cv - current value
 vv - view value
 dtl - detail field
ScriptViewNo(cv, vv) Return ASP.NET codes for rendering field for VIEW (AutoNumber field)
ScriptViewText(cv, vv) Return ASP.NET codes for rendering field for VIEW (TEXT field)
ScriptViewFormat(parm) Return ASP.NET codes for field VIEW TAG format
Parms
 parm - field to be formatted
ScriptViewPassword(cv, vv) Return ASP.NET codes for rendering field for VIEW (PASSWORD field)
ScriptViewValues(cv, vv) Return ASP.NET codes for rendering field for VIEW (Lookup Value field)
ScriptViewTextarea(cv, vv) Return ASP.NET codes for rendering field for VIEW (TEXTAREA field)
ScriptViewHidden(cv, vv) Return ASP.NET codes for rendering field for VIEW (HIDDEN field)
ScriptViewFile(cv, vv) Return ASP.NET codes for rendering field for VIEW (FILE field)
ScriptViewHref(cv, vv) Return ASP.NET codes for rendering field for VIEW (HREF field)
FieldSummaryGroupView() Return field control for Summary Group VIEW
FieldGroupView() Return field control for Group VIEW
FieldSummaryView(id, lvl) Return field control for Summary VIEW
Parms
 id - summary id
 lvl - group level
FieldView() Return field control for VIEW
FieldViewCall(cv, vv, id, lvl) Return field control for VIEW
FieldViewCheckbox(cv, vv, id, lvl) Return field control for VIEW (CHECKBOX field)
FieldViewText(cv, vv, id, lvl) Return field control for VIEW (TEXT field)
FieldViewFile(cv, vv, id, lvl) Return field control for VIEW (FILE field)
FieldViewHref(ctl, vv) Return field control for VIEW (HREF field)
Parms
 ctl - control to be HREF
FieldSearch() Return extended filter textbox 1
FieldSearch2() Return extended filter textbox 2
FieldSearchLookup(autopostback) Return field control for search lookup field
Parms
 autopostback - auto post back the search form after selection
FieldSearchRadio(ctl, autopostback) Return field control for search lookup field (RADIO)
Parms
 ctl - field control
 autopostback - auto post back the search form after selection
FieldSearchCheckbox(ctl, autopostback) Return field control for search lookup field (CHECKBOX)
Parms
 ctl - field control
 autopostback - auto post back the search form after selection
FieldSearchSelect(ctl, autopostback) Return field control for search lookup field (SELECT)
Parms
 ctl - field control
 autopostback - auto post back the search form after selection
FieldSearchAjax(ctl, autopostback) Return field control for search lookup field (AJAX)
Parms
 ctl - field control
 autopostback - auto post back the search form after selection
FieldEditText(ctl, val) Return field control for EDIT (TEXT field)
Parms
 ctl - control
 val - value
FieldOperator() Return extended filter field operator 1
FieldOperator2() Return extended filter field operator 2
FieldOperatorCall(ctl, val, opr) Return extended filter field operator based on parameter
Parms
 ctl - control
 val - value
 opr - operator
FieldSearchCondition() Return extended filter condition
GroupByFieldNames() Return group by field names (separated by CrLf)
OrderByFieldNames() Return order by field names (separated by CrLf)
ParmFieldNames() Return drill down parameter field names (separated by CrLf)
JsValidator() Return JS validator for extended filter
JsValidatorCall(ctl) Return JS validator for extended filter based on parameter
Parms
 ctl - control
JsDefaultMsg() Return JS default error message for extended filter
AspValidator() Return ASP.NET (Server Side) validator for extended filter
AspValidatorCommon(fld, msg) Return ASP.NET (Server Side) validator for extended filter based on parameters
Parms
 fld - field name
 msg - error message
AspDefaultMsg() Return ASP.NET (Server Side) default error message for extended filter
RowFieldNames() Return row field names for crosstab report (separated by CrLf)
ColumnFieldNames() Return crosstab column field name
SummaryFieldNames() Return crosstab summary field name
CrosstabSql(sqlpart) Return crosstab SQL part
Parms
 sqlpart - SQL part token
SELECT, FROM, WHERE, GROUP BY, ORDER BY, SELECT AGGREGATE, GROUP BY AGGREGATE
CrosstabYearSql() Return crosstab SQL to get distinct year values
DistinctColumnSql(sqlpart) Return crosstab SQL part to get distinct column values
Parms
 sqlpart - SQL part token
SELECT
ReportSql(sqlpart) Return summary/list SQL part
Parms
 sqlpart - SQL part token
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, SELECT AGGREGATE, AGGREGATE PREFIX
LookupSql(bDistinct, sSelect, sFilter, sRunTimeFilterVar, bAddUserIDFilter, sSelectLimit, sDefaultOrderBy) Return codes for lookup SQL
Parms
 bDinstinct - use DISTINCT
 sSelect - SELECT SQL part
 sFilter - filter SQL
 sRunTimeFilterVar - run time filter variable
 bAddUserIDFilter - add user id filter
 sSelectLimit - SELECT LIMIT
 sDefaultOrderBy - default order by
SelectionList() Return selection list in JSON
ConnectionString(db) (v9.0+) Return database connection string
Parms
 db - database object
DatabaseConnection(db) (v9.0+) Return database connection array
Parms
 db - database object

 

 

 ©2007-2016 e.World Technology Ltd. All rights reserved.