Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Please help, what should I set to defaultvalue in DVWP filter parameter if it should be ISO8601 date format of the actual date?

It only works now if I manually enter current date like <ParameterBinding Name="Param1" Location="Control(DropDownList1)" DefaultValue="2013-01-02T12:00:00Z"/>

I am also wondering, if the DVWP is linked to a drop-down list, even if the dropdown shows actual date, filter is working only if the entire page is reposted / so only once I change the drop-down selection.

So the other question is, if there is any possibility withouth using scripts to postback value automatically once the page is initialized? I have similar problem I think which I could read here: Dynamically setting Default Value in ParameterBinding through Javascript, still waiting resolution.

share|improve this question
    
Any update? It seems to be an easy question. –  user13825 Dec 29 '12 at 21:46
    
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. –  ali Sharepoint Dec 29 '12 at 22:26
    
How can I bounty if there is no bounty button? I have asked a question almost a week ago and cannot see any response - is it the normal way asking the same question again and again? –  user13825 Dec 29 '12 at 22:31
    
If you are not getting any answers to your question you might consider trying to improve the question to increase the chance of a response. There is further advice in our FAQ: sharepoint.stackexchange.com/questions/how-to-ask –  SPDoctor Dec 29 '12 at 23:30
    
Got it, thanks for the suggestions, and the reply. Let me check how it works and get back soon, friends! –  stoneclub Jan 2 '13 at 15:55
add comment

1 Answer 1

i think this might help you, I have taken the part out that is relivant to you and posted the link:

Sharepoint works with default dates in the ISO8601 format: yyyy-mm-ddThh:mm:ssZ. When you create a DVWP, by default SPD will get the date field value using “ddwrt:FormatDateTime(string(@datefiled), 1033,5)”. This is hard code, you can’t manage them globally.

So please check your DVWP for date fields, make sure you have used this kind function. For more information, please refer to

http://autosponge.spaces.live.com/blog/cns!D7F85948C20F0293!378.entry http://blog.metrostarsystems.com/2009/11/13/performing-datetime-calculation-in-dvwp-using-xslt/

http://social.msdn.microsoft.com/Forums/en-CA/sharepointcustomizationlegacy/thread/83bd5949-106e-47ac-8375-692f3c474db6

I hope this answers your question :)

share|improve this answer
    
Hi @almostSharepointMaster I tried this tag: code<ParameterBinding Name="Param1" Location="Control(DropDownList1)" DefaultValue="CurrentDate"/>code alternatively as described above: code<ParameterBinding Name="Param1" Location="Control(DropDownList1)" DefaultValue=ddwrt:FormatDateTime(string(CurrentDate), 1033,5)/>code However it does not properly return the actual date. –  stoneclub Jan 2 '13 at 16:45
    
what does it return? –  ali Sharepoint Jan 2 '13 at 18:00
    
both tag codes return empty row for the data view webpart. However, it should return all the rows where the date is equal or later than CurrentDate –  stoneclub Jan 2 '13 at 19:03
    
It only works if I manually enter current date like code <ParameterBinding Name="Param1" Location="Control(DropDownList1)" DefaultValue="2013-01-02T12:00:00Z"/> code –  stoneclub Jan 2 '13 at 19:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.