Hi All,
what do I need to do to add data source which will have column set to datetime(nullable)?
I tried to set AllowDbNull = true for the column but that didn't work.
Any ideas? Thank you!
Pavel
Data source - datetime(nullable)
Re: Data source - datetime(nullable)
Hello.
What Data Source do you use?
Where do you set the AllowDbNull property?
Could you provide any details else to reproduce the issue.
Thank you.
What Data Source do you use?
Where do you set the AllowDbNull property?
Could you provide any details else to reproduce the issue.
Thank you.
Re: Data source - datetime(nullable)
Hi Aleksey,
I am using method RegData of StiReport and passing System.Data.DataTable.
something like this:
The problem is on the second added row where the value is null and the report fails to render with message :
Thanks for your help!
Pavel
I am using method RegData of StiReport and passing System.Data.DataTable.
something like this:
Code: Select all
var report = new StiReport();
report.Load("myreport.mrt");
var data = new DataTable();
data.Columns("Date", typeof(DateTime)).AllowDbNulls = true;
data.Rows.Add(new DateTime(2003, 10, 25));
data.Rows.Add(DBNull.Value);
report.RegData(data);
If I change the type for the given column in the report designer to datetime(nullable) it works fine. But I need to set it from code. I thought that setting AllowDbNulls will make the effect but it doesn't.Expression in Text property of 'TableNumberOfEntriesByNoc_Cell12' can't be evaluated! Object reference not set to an instance of an object.
Thanks for your help!
Pavel
Re: Data source - datetime(nullable)
Hello,
DataSet does not support System.Nullable<>.
In this case, you can set the DateTime(Nullable) type of column in dictionary in designer.
Thank you.
DataSet does not support System.Nullable<>.
In this case, you can set the DateTime(Nullable) type of column in dictionary in designer.
Thank you.
Re: Data source - datetime(nullable)
Hello,
Any updates on this one
We need the column to have datetime(nullable) which should be set from the code and not in the designer. We are using the same method mentioned above by 'pvasek' to get datasource for the report.
We are using version 2019.1.1.0.
Thanks & Regards,
Zalak
Any updates on this one
We are facing the same issue.
We need the column to have datetime(nullable) which should be set from the code and not in the designer. We are using the same method mentioned above by 'pvasek' to get datasource for the report.
We are using version 2019.1.1.0.
Thanks & Regards,
Zalak
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Data source - datetime(nullable)
Hello,
Please try to set the following option:
StiOptions.Dictionary.UseAllowDBNullProperty = true;
Thank you.
Please try to set the following option:
StiOptions.Dictionary.UseAllowDBNullProperty = true;
Thank you.