Method Community

 

Current Date in a formula for Method Report Designer

Last post 10-16-2009 9:03 AM by Anonymous. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-28-2009 8:39 AM

    Current Date in a formula for Method Report Designer

    I received the following question from Josh:

    I am trying to find a way to show the CurrentDate in a formula for report designer.  I have tried Date(), Get(), Now(), CurrentDate, and nothing seems to work.  Then I tried to look at the forums and everytime I click on a link, it gives me a page cannot be displayed error and my internet is running fine.

  • 07-28-2009 8:41 AM In reply to

    Re: Current Date in a formula for Method Report Designer

    Josh,  

    We tried this out, and got it to look great with the following formula:

    A: No formatting:
    Xrlabel1.Text = Microsoft.VisualBasic.DateAndTime.Now)

    B: Just the Month, Day, Year:
    Xrlabel1.Text = Microsoft.VisualBasic.DateAndTime.Now.ToString("MMM-dd-yyyy ")

    C: Month, Day, Year, Hours, Minutes and Seconds
    Xrlabel1.Text = Microsoft.VisualBasic.DateAndTime.Now.ToString("MMM-dd-yyyy HH:mm:ss")

  • 10-15-2009 11:08 AM In reply to

    Re: Current Date in a formula for Method Report Designer

    Sorry Amanda, I completely missed this reply originally.  I am still havign an issue here and not wuite sure what you mean above.  Do I create a label and add this formula to the text property?  Or do I create a calculated field?  Either way, I can't get it to work.

  • 10-16-2009 9:03 AM In reply to

    Re: Current Date in a formula for Method Report Designer

     Hi Josh,

    Yes, you’ll  create a label and add the formula that best fits your scenario into the properties area as a script.  I tested it out on the script event "Before Print" and it worked, you can use the event that best fits your scenario.  Change the label in the formula to match the label name on the screen. So for instance you added a new label to the screen and the name is xrLabel13 and assume you are using the formula I sent for option c, then you would change it to Xrlabel13.Text = Microsoft.VisualBasic.DateAndTime.Now.ToString("MMM-dd-yyyy HH:mm:ss"). Hope this helps.

Page 1 of 1 (4 items)