I got this error when I tried to open the site in SharePoint Designer 2010. SPD is installed on the client.
The server could not complete your request.
An error occurred while trying to fetch data from your SharePoint site. Unexpected response from the server. The content type of the response is “”. The status code is “OK”.
The reason is that there can only be 1 binding on a web application. If you have more than 1, it will no longer work and you get this error.
One possible solution is to extend your web application (central administration – application management – manage web applications).
If you open the site of that extented web app, SPD will connect to that site again.
My basic challange was how to conditionally format rows on the SharePoint lists, that fulfil selected criteria. I have a column DueDate. If the task is delayed, I’d like to render it on the orange background.
Date format in my country (Slovenia) is different from the US format. By the way, Slovene date formatting is very similar to the German one and date formatting of other countries in Europe. So definitelly, they have the same problem.
Let’s go back to the challange. I concluded that the basic reason, why conditional formating doesn’t work, is different date formating. It compares US Format date with the date in Slovene format.
Besides that I found the basic idea, how to “build” the date comparing function. Idea is to convert both dates to numbers and thaen compare this two numbers. Numbers are bulid according to the following patern: yyyyMMdd. This pattern guarantees that dates are comparable. The post where I got the idea is here:
[number(translate(substring-before(@EventDate,’T’),’-‘,”)) >= number(translate(substring-before($Today,’T’),’-‘,”)) and number(translate(substring-before(@EventDate,’T’),’-‘,”)) <= number(translate(substring-before($Today,’T’),’-‘,”)) + 7]
What I can do now? I went through the available Date and String functions in the “Advanced Condition dialog box” and decided to re-format Slovene date to the US one.
Here are the functions, which I can use.
Function Today, TodayIso, FormatDateTime and Format Date are described here.
You can find LCID (Locale Identifier) values on this site
(LCID for Slovenia = 1060, LCID for USA = 1033)
Here is complete description of functions in ddwrt namespace (available in SPD advanced condition editor).
The biggest problem is how to re-format date. I found that the functions FormatDate and FormatDateTime work very specifically and are bad documented.
Here are some examples of the use of these functions.
Examples of FormatDate function (examples in read use TodayIso function; example in blue uses different LCID):
ddwrt:FormatDate(ddwrt:Today(),1060,3) 16. december 2010
ddwrt:FormatDate(ddwrt:Today(),1033,3) Thursday, December 16, 2010
ddwrt:FormatDate(ddwrt:Today(),1060,5) 16.12.2010 0:00
ddwrt:FormatDate(ddwrt:Today(),1060,7) 16. december 2010 0:00
ddwrt:FormatDate(ddwrt:Today(),1060,13) 16.12.2010 0:00:00
ddwrt:FormatDate(ddwrt:Today(),1060,15) 16. december 2010 0:00:00
ddwrt:FormatDate(ddwrt:TodayIso(),1060,15) 16. december 2010 10:58:41
Then I tried function FormatDate with some string. The function doesn’t like a dot as a delimiter in the date format:
ddwrt:FormatDate(‘3.1.2010’,1060,15) *** nothing displayed ***
By default the function recognizes the date as US version (MM-dd-yyyy). If the date is not logical e.g. ’13-1-2010′, then the function recognizes it as an european date ‘dd-MM-yyyy’. Very interesting, but nowhere documented. How can we use this function in Europe? The function is useless for us. Perhaps somebody knows something more about this.
ddwrt:FormatDate(‘3-1-2010′,1060,15) 1. marec 2010 0:00:00
ddwrt:FormatDate(’13-1-2010’,1060,15) 13. januar 2010 0:00:00
ddwrt:FormatDate(‘1-13-2010’,1060,15) 13. januar 2010 0:00:00
Function FormatDateTime has different parameters:
FormatDateTime(string szDate, long lcid, string szFormat);
string szDate – either an existing date column or a function (e.g. ddwrt:(Today())
long lcid – a number corresponding to the locale id (e.g. British English is 1033)
string szFormat – e.g. ‘yyyyMMdd’, ‘dd/MM/yyyy’ etc.
Here are some examples on FormatDateTime function:
I concluded that I can use function FormatDate only with Today and TodayIso functions, but I can’t convert dates in Slovene format. What I had to do is to convert both dates to numbers according to the ‘yyyyMMdd’ patern.
Here is my final solution.
number(concat(substring(string(@DueDate),7,4),substring(string(@DueDate),4,2),substring-before(string(@DueDate),’.’))) < translate(substring-before(ddwrt:TodayIso(),’T’),’-‘,”)
I used orange color for delayed tasks and yellow for the task that has to be completed today.
- Formatting Dates, Times and Numbers in ASP.NET (4guysfromrolla.com)