Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Formula

Status
Not open for further replies.
Dec 5, 2001
82
0
0
GB
Dear All,

Well there not really strange just not what I've seen before.

I've come across a couple of formulas in some sample Crystal Reports and I'm just wondering what it is they are doing and what language they are referencing.

Here is the first example, which I don't know what its doing:

Code:
whileprintingrecords;
shared numbervar objid;

"<script>"
+ "function openupcsp() {"
+ "var url ='/crystal/enterprise10/adhoc/mainframes.csp?isAdmin=false&mode=interactive&fromeportfolio=false&currID=" + totext(objid,0,"") + "&tab=report';"
+ "var features = 'scrollbars=no,status=no,location=no,resizable=yes,width=0,height=0,left=0,top=0';"
+ "window.open(url,'',features);" 
+ "}"
+ "</script>"
+ "<a class=EmbeddedLink href=""javascript:openupcsp()"" style='color: #1f4399'>"
+ ">> VIEW EMPLOYEE TERMINATIONS"
+ "</a>"
+ Chr(13) + "<A href=""javascript:"" style='display:none'"

and the Here is the second, which I've partly figured out is using wingdig format to display a colour coded circle on screen:

Code:
numbervar input;
numbervar lower;
numbervar upper;
lower:= 50;
upper:= 59;
input:= round({@Grading Alert Value},0);

stringvar S;
stringvar A;
stringvar G;
if input <= lower then (stringvar S:="cf1";stringvar A:="cf5";stringvar G:="cf6");
if input in lower to upper then (stringvar S:="cf4";stringvar A:="cf2";stringvar G:="cf6");
if input >= upper then (stringvar S:="cf4";stringvar A:="cf5";stringvar G:="cf3");

"{\rtf1\ansi{\fonttbl{\f0\fnil\fcharset2 Wingdings;}}" +
"{\colortbl;\red214\green34\blue38;\red220\green205\blue55;\red0\green142\blue50;\red0\green0\blue0;\red0\green0\blue0;\red0\green0\blue0;}" +
"\viewkind4\uc1\pard\f0\fs28\qc\" + S + " l" +
"\par\" + A + " l" +
"\par\" + G + " l?" +
"\par" + "}"


Cheers
[afro]
 
Looks like then first is creating some html and the other RTF.

Place the formula on report, right click and select format. On Paragraph tab, at bottom you will see text interpretation. Select html or rtf as appropriate.

Crystal's HTML interpretor is very basic so no idea if it can handle the code used in you formula.

Ian

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top