Page 1 of 1

Date formats and vaiables

Posted: Tue Jun 21, 2011 6:38 pm
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?

Date formats and vaiables

Posted: Wed Jun 22, 2011 2:10 am
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.