Skip to Content
author's profile photo Former Member
Former Member

Error running report in Crystal Enterprise 11

I am getting the following error when I run a report that contains Basic Syntax:

( Error in File Shipments by Waste Code: Error in formula . 'dim FromUnit as string ' The ) is missing. Details: errorKind)

The syntax is:

dim FromUnit as string

dim Density as number

FromUnit = iif({MFITEM.UNIT} & "" = "" ,"POUNDS",{MFITEM.UNIT})

if isnull({HWPROFIL.GAL2LBS}) then

Density = 8.34

else

if {HWPROFIL.GAL2LBS} = 0 then

Density = 8.34

else

Density = {HWPROFIL.GAL2LBS}

end if

end if

formula =1

formula =round(FormatRecalculate1CalculateQuant ({MFITEM.QUANTITY},FromUnit ,"POUNDS" , Density,0 ) , 1)

Do I need to convert to Crystal sytax or is there a setting I can change? If I need to convert, can anyone help with that?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2008 at 03:46 PM

    which version of vb are you using?

    I don't know if I am correct but I can't see where you declared "formula"?

    Additionally I would try with Crystal syntax and check it throws an error still.

    Regards

    Jehanzeb

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I did not write the code, but this is what I need it to do:

      I need to convert all the data in MFITEM.QUANTITY field to pounds. To do this, it is looking to see if a density has been entered in the HWPROFIL.GAL2LBS field, if it has not, or it equals 0, it will use the value of 8.34.

      I think the formula is performing the calculation and rounding the value to the tenths place. Any help would be greatly appreciated.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.