locked
How to send Date and Year to Crystal Report RRS feed

  • Question

  • Hi

    I've formula field in crystal report
    from vb code am passing a year like this

    dim y as integer
    y=2005
     crystal.DataDefinition.FormulaFields(0).Text=y

    But in report in the corresponding formula field
    it displays like this
    2,005.00

    How i can change the format
    there is no option in the formula field if i right click
    I didnt write anything in the formula editor also

    Another problem how can i send a date to report
    i tried like this

    dim d as new System.DateTime
    dim d1 as new DateTime
    d1=d.today
     crystal.DataDefinition.FormulaFields(0).Text=d1

    But in report it displays as 0.00
    Plz tell me how to get date in report

    Plz help me

    Thursday, October 20, 2005 7:19 AM

Answers

  • Hello,

    1) You can set the format for the formula field in the embedded report designer.  Right click on the formula field in the report and choose Format Object.  From here you can set the format for the field by clicking on the Number tab.

    2)  Any dates that are being passed to Crystal Reports must be in Crystal Reports Date format; Date(yyyy,mm,dd).  So in your case you will need to create a string to pass in that will concatenate the different elements together.

    Keith - Business Objects

    • Proposed as answer by neonprimetime Friday, July 25, 2008 6:12 PM
    Thursday, October 20, 2005 9:10 PM
    Moderator