Using helper_js.csp

There is a helper file that, in addition to other optimizations, compensates for many of the differences between UNIX and Windows operating systems. It is important that you include this file in your JavaScript CSP pages and include a copy of the file in the same directory as your CSP file. Add the following line to a CSP page to include the helper file:

<!-- #include file=helper_js.csp -->

The helper file, helper_js.csp, is placed by default in \ProgramFiles\Crystal Decisions\WebContent\Enterprise\ePortfolio\language. Replace language with the information appropriate to your version of Crystal Enterprise: use en for English or ja for Japanese.

Some key functions in helper_js.csp

The helper_js.csp file contains functions for commonly performed tasks that enable you to write CSP pages that will work on either UNIX or Windows without modifying the syntax. In addition to the functions listed here, the file contains other functions including those for date and string conversions. It is recommended that you review the helper file itself to see the complete list of functions available.

In this table, when multiple syntax entries are listed in the Replaces column, the first entry is Windows (VBScript) syntax and the second entry is for UNIX (JavaScript) syntax.
Function Replaces

GetSession(name)

Session.Value(name)

    or

Session.Value(name).Item

SetSession(name, value)

Session.Value(name) = value

    or

Session.Value(name).Item = value

GetCookie(name)

String(Request.Cookies.Item(name))

GetSubCookie(name, subkey)

Request.Cookies(name)(subkey)

    or

Request.Cookies.Item(name).SubItem(subkey)

SetCookie(name, value)

Response.Cookies(name) = value

    or

Response.Cookies.Item(name).Value = value

SetSubCookie(name, subkey, value)

Response.Cookies(name)(subkey) = value

    or

Response.Cookies.Item(name).SubItem(subkey, value)

SetCookiePath(name, path)

Response.Cookies.Item(name).Path = path

SetCookieExpires(name, expDate)

Response.Cookies.Item(name).Expires = expDate

GetQueryString(name)

Request.QueryString.Item(name)

GetFormItem(name)

Request.Form.Item(name)

GetServerVariable(name)

Request.ServerVariables.Item(name)



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com