Showing SQL Reporting Services reports in Microsoft Office SharePoint Server 2007-08-31

Today I was working with a customer who wanted to show their SSRS 2005 reports in SharePoint. As many of you might be aware, from SP 2 of SQL 2005 there is an option of storing you reports on the SharePoint Server. Very nice, but I havn’t really tried getting that to work with MS CRM 3, so the SSRS I was using ran in normal mode, i.e. not SharePoint integration. However, I did want to show the reports and the reports explorer in SharePoint. For SharePoint v2 there has long existed RSWebparts.cab, which is a web part package consisting of two web parts; report viewer and report explorer.

After a bit of looking I couldn’t find it for SharePoint v3, and found some information saying that the old webparts actually still worked well. So, after the always so tedious work of trying to locate the file, RSWebparts.cab (it cannot be downloaded from the Internet as far as I know) I installed it using stsadm –o installwp -o addwppack -force –filename “C:tempRSWebParts.cab” –globalinstall (use stsadm –help addwppack to see possible syntax), and adding the RSWebparts.dll as a safecontroll (with the correct strong name). I got it to work, just as nicely as it did in SharePoint v2. So, my suggestion to you, if you have the same need, use the old one.

And where can you find the file? It is installed in some impossible path bellow c:program filesSQL Server of a SQL 2000 SP2 (or greater) server. So, get your hands on it, and don’t let go. I don’t think I can publish it here though, due to copyright reasons.

Gustaf

How to stop infinite recursions/loops in PostUpdate Callouts

As many of you who work with development in Microsoft CRM know, callouts is a great tool. Lots of different tasks can be left to be handled by callouts and they are even run when offline data is resynced to the main system. However, a common problem when working with PostUpdate callouts is that the code wants to update the object that created the callout, hence executing the calloutcode again, which might result in an endless recursion.

I recently ran into this problem working at a customer of mine, and found a nice generic way of solving it using the thought behind the design pattern object factory or single instance.

I guess you want some code! Well, the basis of this solution is to have a static instance of a collection that keeps track of if a certain key just has been run. I use the collection StringCollection. It is simple, and just what I needed in this case:

private
static System.Collections.Specialized.StringCollection justtreated;

 

Then I created a method that is supposed to return false the first, third, fifth… time it is called and true every second, fourth, sixth… time it is called with a certain key.

 

private
bool JustDone(string key)

{

    if (justtreated == null)

    {

        justtreated = new System.Collections.Specialized.StringCollection();

    }

    if (justtreated.Contains(key))

    {

        justtreated.Remove(key);

        return
true;

    }

    justtreated.Add(key);

    return
false;

    }

}

The method is not very complicated. First off, it makes sure that the static variable has been created. Then it checks if it can find the key string in the string collection. If it can it will remove it and then return true. If it cannot find the key, it will add it to the collection and return false.

Since, this method is working with a static variable that will remain in memory between instantiations of the class, hence the data will remain between PostUpdate calls.

Then in the beginning of the PostUpdate method just call JustDone() with the object key (or some other unique key) and if it is true, just “return”.

Gustaf Westerlund

Humandata AB

August 2007 MS CRM VPC is here!

I’ve been bad at reading all blogs recently. Full of work and my private time is now mostly filled with my daughter Nora, hence less time to read up on blogs.

We have all (?!) been waiting for the new MS CRM VPC and it has now been released. It can be downloaded from here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=57394bc8-5ecc-422e-a066-34189f48f8c8&displaylang=en

I havn’t downloaded it myself yet, but I will soon.

Gustaf Westerlund
CRM and SharePoint Consultant

Humandata AB
www.humandata.se

Java, javascript, jscript and so forth

When developing software customizations for SharePoint and MS CRM 3, javascript is often used. It can easily be confused with the totaly unrelated language java. Mennotk’s blog has a posting linking to another blog that describes in a bit more detail what javascript, jscript and so forth really is. Being a developer in MS CRM and SharePoint, where this is one of my main tools, I found this quite enlightening and it sheds some light on some question marks I personally had on the subject of javascript and client side scripting.

Please have a look if you are interested: http://blogs.msdn.com/gauravseth/archive/2007/08/15/the-world-of-jscript-javascript-ecmascript.aspx

Gustaf Westerlund
CRM and SharePoint Consultant

Humandata AB
www.humandata.se