Page 1 of 1

DateTime Variable

Posted: Sun Oct 04, 2009 5:41 pm
by mbaker
Hi,

I'm trying to set up a DateTime variable in my report (well two a StartDate and EndDate). I've tried running the report via my VB.Net code as well as straight from the Stimulsoft Designer, neither work!

How can I change the datetime format to DD/MM/YYYY rather than american format?
How do I then pass in the two dates from my VB.Net code to the report. I've tired the following code:

Dim report As New StiReport()
Dim fs As FileStream
fs = New FileStream(Server.MapPath("/Reports/MyReport.mrt"), FileMode.Open, FileAccess.Read)

Dim buffer(fs.Length) As Byte

fs.Read(buffer, 0, buffer.Length)
fs.Close()
report.Load(buffer)
report.Dictionary.Databases.Clear()

report.Dictionary.Databases.Add(New StiSqlDatabase("EasyBuildConnection", MyConnectionString))
report.Compile()

'format the parameters
StartDate = GetDate(StartDate)
EndDate = GetDate(EndDate)

'give the report it's parameters
report("StartDate") = StartDate
report("EndDate") = EndDate

report.Render()

It's looking at a SQLServer dbase, with the dates set as datetime though i would rather just pass in a date.
Currently when i try to run it via the Designer it tells me that '12' is invalid, so for some reason doesnt seem to like the time?

Cheers,
Michelle

DateTime Variable

Posted: Mon Oct 05, 2009 12:08 am
by jayanthi
Hai,

If you use query then you can format date using below code

select convert(varchar(100),getdate(),103)

Thank You
Jay