How to create a report variable "datetime (Nullable)" in Vb.NET code

Stimulsoft Reports.NET discussion
Post Reply
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

How to create a report variable "datetime (Nullable)" in Vb.NET code

Post by Fabio Pagano »

I need to create through my Vb.Net Program a report variable of "datetime (Nullable)" type. Actually i only can create a report variable "datetime" (not nullable).

This is my code:

Code: Select all

Dim v As New Stimulsoft.Report.Dictionary.StiVariable
v.Name = "MyName"
v.Type = CType(GetType(Date), Type)
v.ReadOnly = False
report.Dictionary.Variables.Add(v)
Thanks.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to create a report variable "datetime (Nullable)" in Vb.NET code

Post by Edward »

Please use the following code:

for declaring:
Dim Variable1 As Nullable(Of DateTime)

for adding:
Report.Dictionary.Variables.Add(New Stimulsoft.Report.Dictionary.StiVariable("", "MyVariablename", "MyVariableAlias", GetType(Nullable(Of DateTime)), "5/27/2008", false, false))

Thank you.
Post Reply