Seal Report Forum
»
Report Edition
»
Reports
»
How can I set my Date/Time type Restrictions with empty value?
Rank: Newbie
Groups: Registered
Joined: 4/1/2022(UTC) Posts: 1 Location: Taiwan
|
Hello I have two Date/Time type Restrictions in my report, Both of the Restrictions back time value I set Operator with 'Is between' AND the back value set up the time for 23:59:59 like this code in my `Pre Load Script`, Code:
@using System.Data
@{
ReportModel model = Model;
ReportExecutionLog log = model.Report;
List<ReportElement> elements = model.Elements;
List<ReportRestriction> restrictions = model.Restrictions;
var time = new DateTime(1,1,1);
var commenttime = restrictions.FirstOrDefault(m=>m.Name == "commenttime");
if(commenttime != null) {
if(commenttime.Date2 != null){
commenttime.Date2 = new DateTime(commenttime.Date2.Year,commenttime.Date2.Month,commenttime.Date2.Day,23,59,59);
}
}
var replytime = restrictions.FirstOrDefault(m=>m.Name == "replytime");
if(replytime != null) {
if(replytime.Date2 != null){
replytime.Date2 = new DateTime(replytime.Date2.Year,replytime.Date2.Month,replytime.Date2.Day,23,59,59);
}
}
}
And the second Restrictions I need to set the empty Value , but when I was execute the report , the second Restriction's back value became '0001/1/1 23:59:59' automatically How can I solve it??
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
I made a quick sample with Northwind and this seems to work. you can find it in attachment sample date.srex (8kb) downloaded 4 time(s).
|
|
|
|
Seal Report Forum
»
Report Edition
»
Reports
»
How can I set my Date/Time type Restrictions with empty value?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.