Crystal Report formatting problem..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zoury

    Crystal Report formatting problem..

    Hi there ! :O)


    I'm having a two strange behaviors with Crystal Report which seems to have
    the same cause..

    All the fields used in the reports comes from some SQL Server views.


    *** 1st Problem :
    We created some formulas that make calculations on these fields. ex :
    ---
    {my_view.my_dou ble_field} * 100
    ---

    The report builds properly.

    When we "execute" it (using ExportToStream) we get a FormulaExceptio n
    telling something like this :
    ---
    A number or currency amount is expected here.
    ---

    If we cast the field explicitly to a double the problem is solved. ex :
    ---
    CDbl({my_view.m y_double_field} ) * 100
    ---
    ***


    *** 2nd Problem :
    Whenever we set a format (like the default number format for instance) on
    these fields, the format is not honored.

    If we create a formula that returns a field value and use that formula in
    the report instead of the field itself, the format is still not honored.

    If we create a formula that cast the field value into its own type using
    CDbl() (crystal syntax) and use that formula in the report, only then is the
    format honored.
    ***


    Why do we have to cast the fields into their own type in each of these cases
    ? I don't recall having seen this behavior before..

    Thanks for your input.

    --
    Best Regards
    Yanick Lefebvre


Working...