Tuesday, April 19, 2016

SharePoint: List filtering by date range

Setting up multiple date filters to filter a list by a date range is possible out of the box in SharePoint 2010.
Using date filter web parts to send values to a lists parameters we can get the list to filter by a date range.
Setting this up is rather simple…
In your browser create a new page and add your populated list to it via the web parts options on the ribbons. For this example I’m just going to use my tasks list.
On the same page add a date filter webpart
2011-08-17-ListFilterByDate-01.jpg
From the arrow drop down that appears when you hover over the new date filter web part, select edit web part.
2011-08-17-ListFilterByDate-02.jpg
In the options pane that appears, change the Filter name to ‘Start Date’, and change the default value to ‘offset from today : 30 days : Before today’. Then click ok.
2011-08-17-ListFilterByDate-03.jpg
Underneath that, add another date filter and change its filter name to ‘End date’, and change the default value to ‘offset from today : 0 days : After today’. Then click ok.
2011-08-17-ListFilterByDate-04.jpg
Now save the page in your browser, then open the page up in SharePoint designer (SPD) – in design view.
2011-08-17-ListFilterByDate-05.jpg
Once opened in SPD, click on the list web part to select it, then in the ribbon click on the list view tools > options > parameters icon.
2011-08-17-ListFilterByDate-06.jpg
Add two new parameters, one called ‘startdate’ and another called ‘enddate. Leave the parameter sources and default values as default and click ok when done.
2011-08-17-ListFilterByDate-07.jpg
The parameters on the list allow us a point for our date filters to pass their values to. Now we need to set up the connections between the list and the date filters.
Right click on the start date filter and click add connection. In the dialog that pops up change the dropdown value to ‘Send filter values to’, click next.
2011-08-17-ListFilterByDate-08.jpg
Ensure that ‘connect to a web part on this page’ is selected in the next dialog and click next.
2011-08-17-ListFilterByDate-09.jpg
Change the target action in the next dialog to ‘Get parameters from’ and click next.
2011-08-17-ListFilterByDate-10.jpg
In the next dialog, select ‘Start Date’ from the first box, and ‘Startdate’ from the second box and click next. Then click finish.
2011-08-17-ListFilterByDate-11.jpg
Go through the same process with the second date filter, but in the final step select ‘End date’ and ‘Enddate’ from the boxes.
2011-08-17-ListFilterByDate-12.jpg
Now we have our date filters feeding the list with its values but we still have to set up the filter on the list.
Click the list web part to select it, then in the ribbon click on the list view tools > options > filters icon.
2011-08-17-ListFilterByDate-13.jpg
The filter criteria box will popup. First add a rule ‘Created > Greater than or equal to > [Start date]’.
2011-08-17-ListFilterByDate-14.jpg
Then add another clause ‘Created > Less than or equal to > [Enddate]’. Click ok.
2011-08-17-ListFilterByDate-15.jpg
Now save the page and open it back up in your browser.
It will, by default, show all tasks created in the last seven days thanks to the default setting of the start date filter. Changing these filter will filter the list according to the date ranges set.
2011-08-17-ListFilterByDate-16.jpg
PS: This article is part of a post.

Fancybox on Sharepoint Home

In this article I will elaborate How to show a fancybox popup in SharePoint.
In my Scenario:
I need to show a fancybox popup window only once per session when I open a SharePoint site for the first time.
I  checked the type of modal popup and found the FancyBox is fantastic popup that meet my requirement.
The Output should be as shown below:
AD
Steps:
To achieve this Please follow the simple steps mentioned below:
  • First check what’s your Custom Master Page that used in your site.
  • Open your SharePoint site –> Site Action –> Site Setting –> Master Page.
masterpage
  • Click Master Page, now you know what’s the default master page for your SharePoint site in this case is V4.master.
setmasterpage
  • Open Style Library to upload FancyBox and JQuery files (You can download this files by click FancyBox JQuery).
stylelibraby
  • Open library via windows explorer to copy the downloaded files.
uploadfancyboxfile
  • Don’t forget to check-in and publish all the uploaded files as Major version.
checkin
  • Open SharePoint Designer –> Master Page –> Copy current master page in this page V4.master. (We recommend to take a copy of  your current Master Page).
copynewversionfromyourmaster
  • Rename the copied master page with an appropriate name in this case V4_Ad.master, edit Master Page in advanced mode.
editinadvancedmode
  • Add the reference to FancyBox, JQueryand CSS files in the Head Tag.
updatemasterpage

http://../../../Style%20Library/JS/JQuery/jquery-1.4.3.min.js


http://../../../Style%20Library/JS/fancybox/jquery.fancybox-1.3.4.pack.js
http://../../../Style%20Library/JS/fancybox/jquery.mousewheel-3.0.4.pack.js

http://../../../Style%20Library/JS/JQuery/jquery.cookie.js
  • Pick your URL based on your location that you upload FancyBox and JQuery files.
pike
  • Add the following code in Head Tag too.
function openFancybox() {
setTimeout(function () {
$('#yt').trigger('click');
}, 500);
};
$(document).ready(function () {
var visited = $.cookie('visited');
if (visited == 'yes') {
return false; // second page load, cookie active
} else {
openFancybox(); // first page load, launch fancybox
}
$.cookie('visited', 'yes', {
expires: 7 // the number of days cookie will be effective
});
$("#yt").click(function () {
$.fancybox({
href: this.href,
type: "image",
transitionIn: "elastic",
transitionOut: "elastic"
});
return false;
});
});

  • Add the following code in Body Tag.
  • Check-in your Master Page as Major Version.
checkinmasterpage
  • The following dialog will be shown to publish your Master Page as Major Version.
publishasmajor
  • Open your site –> Site Action –> Site Settings –> Master Page
masterpage
  • Click Master Page and change your master page with the new Master Page.
selectnewmasterpage
  • Apply this master page to all subsites.
applumasterpagetoallsubsite
  • Try to browse your site you will note the popup window will be showed onload only once per session.
AD
Note: If you need to show it when you load only a home page you can type the previous code in your home page layout.
Enjoy:)
PS: This article is part of this post.

Document Set Limitations and Considerations in SharePoint 2010

So time again for some more limitations that you should be aware of in SharePoint 2010. This time I am going to be tacking Document Sets.

1) Cannot declare document sets as In-Place Records
Since document sets are based on folders you cannot declare an entire Document Set as a record. You can however send it to the Records Centre to then have it declared. This is a little annoying for end users since they have two ways of declaring records.


2) Cannot nest Document Sets within Document Sets
No nesting of Document Sets is possible through the SharePoint UI. Therefore you can only have a single level of Document Sets available. It’s not necessarily a bad thing (otherwise most people would simply use Document Sets as folders and nest the things) but it’s well worth considering.

3) You cannot send a Document Set larger than 50MB using the Send To Command
If you use the send to feature with a Document Set, the sum for all documents in a Document Set cannot be larger than 50MB. This can be a major pain if you have a large Document Set and want to route it to a Records Center, it won’t work.

Note: Can anyone confirm that this has been fixed in SP1 or a CU? Rumor is that the June CU lifted this to 250MB.


4) Cannot create folders within Document Sets
You cannot create a Folder within a Document Set from the Web UI. However you can open up the Document Set in Explorer view and dump a folder in that way. Don’t do that, it is not supposed and likely will not work as you think it should.

5) Document Set routing requires time jobs to run
When using Document Set routing, Document Sets that are sent to a content organizer will remain in the drop-off library and be moved to the appropriate location by the content organizer processing timer job, which by default runs daily.

6) Routing Content into Document Sets can be tricky
A common practice is to set up a series of Document Sets and then use the Content Organizer to route content into them. This is possible, however there is a bit of configuration that is required.

7) Document Sets are available in SharePoint Server only
Document Sets are only available in SharePoint 2010 Server and are not part of the SharePoint Foundation 2010. This also means that the programing object model (SPFolder) is part of the SharePoint 2010 Server API and not available in the SharePoint Foundation Object Model. Sorry all those users of SharePoint Foundation.

8 ) Cannot create Document Sets in Lists
They are called Document Sets after all but you cant create Document Sets on lists, only libraries. It also seems that you can’t create Document Sets in the default pages library as well with pure configuration.

9) Be Careful of performance with lots of Document Sets
There is no limit on the number of documents that can exist in a Document Set. However, display load times may be limited by the list view threshold which by default is set at 5,000 items and the aforementioned lack of metadata navigation

In general, beware when you create and use very large Document Sets (thousands of items), as the limitation and performance factor of viewing and displaying the list will be a factor.

10) Downloading the entire Document Set
If you remember this feature was available in the SP2010 Beta but it didn’t make it into the actual release. It’s not a major issue though as Microsoft is happy enough to provide you with the source code on how to do this here.

11) Shared Columns may not update instantaneously
When using shared columns, if there are more than 10 items in a Document Set, metadata updates will be run by a timer job every 15 minutes. So never fear if it isn’t updated straight away. Incidentally the Timer Job is called ‘Document Set fields synchronization job’


12) Be careful with Content Type Syndication
Content Type syndication of document sets is supported, but if the destination site collection does not have the Document Sets feature enabled, then you risk a dependency issue. Fortunately content type publishing provides a warning for this situation.

Also be aware that not only will the Document Set be published out to the Site Collection but so will all of the Content Types that are attached to the Document Sets

That is all that I have been able to come up with. Would love some input again like the last two limitations articles so fire away

Some great work by others!

PS: This text is part of a post from this page.