logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
eric776  
#1 Posted : Sunday, July 22, 2018 3:21:34 AM(UTC)
eric776

Rank: Newbie

Groups: Registered
Joined: 7/19/2018(UTC)
Posts: 6
China
Location: shannxi

my restiction values:
restriction value:today
restriction data-type:Date & Time
format:Short Date (or custom format >yyyy'-'MM'-'dd)

I want to where clause like: Convert(char(10),callrecord.SegStart_UTC,121) in ('2018-07-21')

but model's sql statement is "Convert(char(10),callrecord.SegStart_UTC,121) in ('2018-07-21 00:00:00')"

I don't understand what's going on here.can you help me?

Edited by user Sunday, July 22, 2018 4:10:18 AM(UTC)  | Reason: Not specified

epf  
#2 Posted : Sunday, July 22, 2018 5:49:30 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
The date time format used for building the SQL is defined in your Connection Data Source.
Select your Data Source, then Connection.

The other format is for the display format only.
eric776  
#3 Posted : Wednesday, July 25, 2018 8:08:07 AM(UTC)
eric776

Rank: Newbie

Groups: Registered
Joined: 7/19/2018(UTC)
Posts: 6
China
Location: shannxi

I know what you mean.It's my fault that I didn't express it clearly.

I mean if my datatype is text, but I want to my restriction value is datetime.

Simply say:I just want to use the datepicker control in the textbox and the value is yyyy-MM-dd.
epf  
#4 Posted : Wednesday, July 25, 2018 9:50:41 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
yes, you are right, to have the DateTime Picker, you need to have a restriction of type DateTime
the html is built in 'Report.iRestrictions.partial.cshtml'

then the format is either Date or DateTime, it is set in common.js:
//Date Picker
$(".datepicker_datetime").datetimepicker({
showClose: true,
showClear: true,
format: shortDateTimeFormat,
});

$(".datepicker_date").datetimepicker({
showClose: true,
showClear: true,
format: shortDateFormat
});

So the format of the picker is not taken from your restriction...it could be an enhancement but might be complicated to handle all format.
you can change the DatePicker format in your Root View:
Additional JavaScript
Code:
shortDateFormat= 'MM.YYYY';


But after, the validation of the date will not work...
So I added this point in the wish list (perhaps in 4.1)

Edited by user Wednesday, July 25, 2018 11:47:05 AM(UTC)  | Reason: Not specified

eric776  
#5 Posted : Wednesday, July 25, 2018 11:52:42 AM(UTC)
eric776

Rank: Newbie

Groups: Registered
Joined: 7/19/2018(UTC)
Posts: 6
China
Location: shannxi

Thank you for your reply. I seem to understand.

I have a little question at last.You say I can change the DatePicker format in my Root View.Whether or not it means in the root Views->define->Init script.

Thank you very very very much~!!!!
epf  
#6 Posted : Wednesday, July 25, 2018 12:01:57 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Actually, select your root View in the tree view.
Then edit the property 'Additional JavaScript'. This allow to insert JS in the result.

You can do that, it will work for the picker but it will not pass the validation on the server....so it won't work.

eric776  
#7 Posted : Wednesday, July 25, 2018 12:36:56 PM(UTC)
eric776

Rank: Newbie

Groups: Registered
Joined: 7/19/2018(UTC)
Posts: 6
China
Location: shannxi

That's the truth. The data type of the restricted value cann't be fully customized, and it depends on the data type of the database field that is really understand...
ansar.javed.859  
#8 Posted : Tuesday, August 7, 2018 2:20:07 PM(UTC)
ansar.javed.859

Rank: Newbie

Groups: Registered
Joined: 3/16/2018(UTC)
Posts: 7
Pakistan
Location: Islamabad

Thanks: 2 times
Hi,

I am trying a similar thing but not getting the results. I have put date in restriction and I want it to automatically set current date in restriction value. I need to get results of date when someone executes the report. Lets say if execute today the result should be for Aug 07, if execute tomorrow then result should be of date Aug 08. How it can be done?
epf  
#9 Posted : Sunday, August 12, 2018 12:06:53 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Did you try date keywords in your restriction ?
Like 'Today+1'
Users browsing this topic
Guest (2)
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.