Date formats and vaiables

Stimulsoft Reports.WEB discussion
Post Reply
agriffiths
Posts: 3
Joined: Thu Apr 14, 2011 8:49 pm
Location: Australia

Date formats and vaiables

Post by agriffiths »

I use dates of Australian format dd/mm/yyy and i seem to be able to pass these to parameters fine but when i try and pass to a variable in the same report i get invaild date for dates like 20/4/2011

So I do this.

Dim fromd As Date
Dim tod As Date

fromd = CDate(txtDateFrom.Text)
tod = CDate(txtDateTo.Text)
rpt.Item("@DateFrom") = fromd
rpt.Item("@DateTo") = tod

rpt.Dictionary.Variables("DateFrom").Value = fromd.Month.ToString & "/" & fromd.Day.ToString & "/" & fromd.Year.ToString
rpt.Dictionary.Variables("DateTo").Value = tod.Month.ToString & "/" & tod.Day.ToString & "/" & tod.Year.ToString

Is this by design?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Date formats and vaiables

Post by Alex K. »

Hello,

Perhaps, you may pass the variables with using the following code:

Code: Select all

rpt.Dictionary.Variables("DateFrom").Value =  fromd.Day.ToString & "/" & fromd.Month.ToString & "/" & fromd.Year.ToString
rpt.Dictionary.Variables("DateTo").Value = tod.Day.ToString & "/" & tod.Month.ToString & "/" & tod.Year.ToString
Thank you.
Post Reply