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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declares for CR8.0 and CR8.5

Status
Not open for further replies.

Joebait

Programmer
Jun 3, 2003
5
US
Hi,
Does someone know if there's a way to declare var. in a formula in CR8.0 that CR8.5 will recognize? I have several reports that are written in CR8.0 but when the client runs them using CR8.5 he/she gets errors due to the declares.

Any Help will be greatly appreciated.

Joebait

 
There is no difference between 8.0 and 8.5. for example:

numbervar x := 123;
stringvar y := "abc";
datevar z := date(2004,3,29);
numbervar range := 1 to 10;

best,

Howard Hammerman,
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Thanks for your reply Howard,

I send the following message a couple of days ago, and got a reply that the declares were wrong. could you look at the problem and see if you can figure out why my client is getting this error.

Thanks so much for your help.

Joebait

Hi,

I need some help.

I have a report written in CR8 using a VB6 application. When one of our clients run the report
using cr8.5 he is getting the following error.


Error in formula <column5>
'//*********************************************************************************//'
the ) is missing


Below is the code in formula column5.
This works fine using CR8. I can't find anything wrong with the code. We don't have
CR8.5 so I can't test it to see what the problem is.

Any help will be greatly appreciated
Thank for your help

JoeBait

//**********************************************************************************//
//
// This field displays the data for the field chosen for this column...
//
//***********************************************************************************//
Stringvar sCol5Temp;
Stringvar sUnitPrice := TrimLeft (TrimRight (ToText( cdbl({A.pk_unit_price}),"###,###,###.0000000000", 10)));
NumberVar LengthToDecimal;

if {@DisplayOpt} [1] = "1" then
LengthToDecimal := instr(sUnitPrice, ".");
while (right(sUnitPrice, 1) = "0" and (len(sUnitPrice) > LengthToDecimal + 2)) Do sUnitPrice := Left(sUnitPrice, len(sUnitPrice) - 1);

if cdbl(sUnitPrice) = 0 then
sCol5Temp := ""
Else
sCol5Temp := Replace (sUnitPrice," ",chr(0));

if {@DisplayOpt} [1] = "2" then
if {@MarketValue} = 0 then
sCol5Temp:= ""
else
sCol5Temp:=ToText ({@MarketValue},2);

if {@DisplayOpt}[1] = "3" then
sCol5Temp:=ToText ({A.pk_price_date});

sCol5Temp;


smeyer56 (IS/IT--Manageme) Mar 25, 2004
I tried it in 8.5 and it doesn't like your declarations and types. I don't see StringVar as an option in 8.5.

Try:
Dim sCol5Temp as string:
Dim sUnitPrice as string:
sUnitPrice = TrimLeft (TrimRight (ToText( cdbl({A.pk_unit_price}),"###,###,###.0000000000", 10)));
 
I think the problem is in the cdbl part of the formula. I believe hat i isa UDF , a user formula. Someone in your organization created it.

Howard Hammerman,
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Howard,

Thanks for your reply. I will look into that.

Thanks so much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top