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
-
- Posts: 3
- Joined: Thu Apr 14, 2011 8:49 pm
- Location: Australia
Date formats and vaiables
Hello,
Perhaps, you may pass the variables with using the following code:
Thank you.
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