Blog of an overweight SharePoint addict

Tue 26 Feb 08

SQL Reporting Services. Installing BIDS as an afterthought!

Filed under: Installation, SQL, Visual Studio 2005 — Reginald @ 10:15 am

I hit a slight problem with the SQL install on the dev box today. When I first installed SQL, I included a lot of the workstation tools, but I didn’t include the tools required for designing reports in VS 2005.

In addition, since I did the install, I’ve put SP2 on the server. So now, when I try to introduce BIDS onto the system, I get an error stating that it’s the wrong version and I need to use Control Panel, Add/remove programs and then Change the existing SQL2005 install.

Well, I tried this and guess what, I hit the same error as trying to install from the CD. After a quick trawl around the forums, I found the solution, When you go into Change the existing, You must make sure you select only the workstation tools to amend. Add BIDS through the checklist and Bingo.. BIDS installs quite happily, and the tools are now available in VS2005.

Reg.

Tue 19 Feb 08

On the subject of disposal.

Filed under: Programming, SharePoint, Visual Studio 2005 — Reginald @ 3:09 pm

I came cross a very good Blogpost by Roger Lamb on he subject of Object disposal within the SharePoint namespace.

For anyone even contemplating traversing the object model within Webparts, ASPX pages or workflow, then I would recommend having a very good read!!

Roger Lamb’s Object Disposal blog post..

Reg.

Thu 14 Feb 08

Encore en fois.. Home again..

Filed under: Excel, Programming, SharePoint, Visual Studio 2005 — Reginald @ 4:45 pm

After a very eventful weeks snowboarding, I’m back in Blighty again and once more on the SharePoint development trail. The project suffered a minor set-back as I return from holiday with a broken nose and a re-injured back from a couple of bad falls. Nothing too major, but I also picked up a chest infection on the plane home, and ended up collapsing at home as a result of coughing too much!!!

So anyways, a week extra holiday later and I’m back at the grindstone..

This weeks project is to revisit the KPI forecasting that I set-up back in November. At the time we were trying to be quite fancy using Excel services, the idea being to be able to have a nice pie chart from the stats produce. If you’ll remmber I waxed lyrical at the time about the lack of support for SharePoint as a data source to excel.

Well in the revisit, I’ve dropped Excel services for the meantime and written a couple of webparts to provide the same functionality. The first provide two simple dropdowns and a submit button that allows the user to select a Month an Year. This then delivers the selected date in the format MMM-YY to the receiving webpart.

In this case, the receiving webpart takes this date and uses it in a cyclical calculation that iterates through an array of library url’s and counts the total of items returned by a CAML query.

This data is then used to display the require KPI data for the business.

The basic process I’ve used is to firstly check that we’re receiving an input fro the other webPart. If we are, then we create the 3 main objects that we need, An instance of KPIreports class to hold our results, A hashtable of CAML queries and a String array of library URL’s to iterate through in the calculations.

The first collection of results is done using a For Each loop and the library array. For each of the URL’s, we connect to the list, Submit the require CAML query restricting the data returned to just the dates that we want. Capture the totals into the class instance, and then move on to the next query.

Following this, we then run a few seperate queries against the Cancellations library to count which stages the cancellations occured, and finally we trap items that have been billied.

Once all the data is in place, we can then output the results to the webpart.

The gotchas? Well anyone using CAML is going to hit the odd problem, although the U2U caml creator tool is very helpful. The main problem is the error “A field is not installed properly”. What this basically means is that the CAML query can’t find the column by the name you’ve given. Make sure that you’re using the internal name with the wonderful format like so “Internal_x0020_Approval_x0020_Month”.

To make the CAMl queries a little bit more readable, I added them to the hashtable as a concatenated string over several lines:-

NB: Each of the CAML statements should have the ole greaterthan/lessthan signs around them, but Wordpress strips them out.. I’ll re-edit this tommorrow once I know what I need to use to make them display..!

CAMLQueries.Add("cancellationsImplementation", "Where And" +
" Eq FieldRef Name='Cancellation_x0020_Month' Value Type='Text' " + returnKPIResults.DateToCheck + " /Value /Eq" +
"Eq FieldRef Name='Current_x0020_Stage' / Value Type='Text' Implementation /Value /Eq" +
"/And /Where");

Powered by WordPress