Thursday, May 15, 2008

Multiple Measures in Performance Point

Here is an interesting stuff I came across recently while working on the PP-Planning module. The deal was to create more than one measures in a model so that one could go beyond the basic "value" in the default measure group. Following are the various options that I came to know from the books\articles, the community experts and little bit of experimenting. My sincere thanks to all of them for sharing the knowledge. The intention here is that if someone comes across similar issues, he can find all the information in a single place and I think this is the best way of passing it on :-)

To start with in the current version there is only a single "value" field for measure created by default and I don't know of any way to add a new measure or even change the name from value to something else. There are couple of workaround for it though. Out of the three option that I am aware of and that are listed below, two of them are supported and are "gentlemanly" workarounds and third one is something that is not supported and maybe removed from the future versions, and there is a good reason for it (in a minute).

Option One: Structure does the trick

Structure here means the dimension's records, properties and the way they are used in the model. The idea is to create a dimension that would hold the "measures" and then use it in the input form (in excel) in the "columns" along with the other dimensions.

Say we have a dimension RoomMeasureDim which has two members\rows, ChairCount & PowerCount & another dimension Customer which holds some names, say ESP & Visa (for example sake). Using these two dimensions we create a generic model RoomModel. This model would have 4 dimensions; the above two and the default time & scenario dimensions. If one would create an input form using the RoomModel and "hide" the Value & the Scenario row (using excel), it would look something like the snapshot below (the gray band is due to the report formatting)...

RoomsInput

So in short we are using the structure to give an impression of two measures to the user. If we talk in DB terms, there would be two rows created for each value per row in the RoomMeasureDim.

Option Two: It's the Assumption

The trick is to create an assumption model and have the measure value in it. This assumption model when used along with the main model would bring along the measures present in the assumption model and expose them in the excel form in the value section.

Option Three: ExportXML\ImportXML (not supported)

This is an PPSCmd option that has not been published. The pseudo flow of this (command-line based) approach is as follows...

1. Run the ExportXML command and export the content into an XML file on the drive.

2. Edit the XML file and add the child-nodes (new measures) into the MeasureGroups node.

3. Delete the original model

4. Import the above updated XML file into PP using the ImportXML option.

Imp Note: The ImportXML is know to create new Ids internally for the objects when it is executed and this might create unknown problems.

 

Still exploring the interesting world of PP...will keep posted :-)

Monday, May 12, 2008

SQL Server 2005 Reporting Services - Reports Management & Execution Web Services

One of the important and interesting features in SQL Server Reporting Services is the web services support. They can be divided into two parts; one for the reports execution and one for the reports management.

The ReportingService2005 class is responsible for the reports management web service and contains all the required methods & properties for the same. Similarly ReportExecutionService class holds the methods & properties for the execution part. For all the member details and what each of them does, one can refer the MSDN docs; nicely documented so won't reproduce the same stuff again :-) For quick reference (http://msdn.microsoft.com/en-us/library/ms155071.aspx)

The example mentioned below is a small POC that I was working on recently and I thought that someone could benefit from what I learned during experimenting with the web services. The example is not very fancy and there are definitely better ways of doing the stuff...no arguments about that. If anyone feels that this code could be of any use to them, s\he is free to go ahead and do so.

Here is the storyline that is used. The reports server has all the reports published and organized in folders based on the sensitivity of the data that the reports holds. The user would only have access to the reports under a particular folders to which he has been granted access. Mostly, the administrator would allow\restrict access to the reports and\or folders using the management studio for reporting services, but over here we are dealing (and had to mimic) with a third party web access manager who decides the access to the reports\folder based on the current user login. Based on the logged in user it would decide what reports he can see and what not.

In other words the account used to access the reports on the reports server is different than the user login account. It has access to all the reports on the server. The "logged in user's" access is decided by the third party web access software and is "not" dependant on the windows login account.

This is different than the way it would have behaved if the rights access would have been done by the management studio. In that case the windows account and the role to which he belongs is used for deciding the access he has to a particular report.

SSRS Management Web Services

Based on the above mentioned story line, in this example we have two users Tom & Joe. They have access to the "AdventureWorks Reports" folder and "WellsReport" folder respectively. When a user is logged in and runs the app, he is only shown the respective folder\reports to which he has access. This control would be a characteristics of a web access manager and is mimicked by a dummy function (WebAccessManagerBlackBox), which takes a parameter of username. We get the current user by making a call to "System.Security.Principal.WindowsIdentity.GetCurrent().Name" and passing it as a parameter while calling the said function. The trick is that the report's path is set to the folder to which the current user has access and thus only the reports below in the hierarchy to which the user has access are displayed.

The web service method, ListChildren returns the list of the catalogs (report items) which is then passed to populate the tree control.

This would display only the reports to which the user has access and populate the tree view control on the left. Once the user clicks on one of the report, the adjacent reports viewer control would display the selected report. To add some spice to the story line it is assumed that the user might have to open more than one report or even the same report twice so that he can do some comparitative analysis. This feature is made available by the use of the tabbed controls along with multiple reports. When the user clicks on a report in the tree view the current tab control displays the report.

Also, when the user runs the application, he is shown a dummy report which has nothing but a message asking him to click on one of the report in the tree node.

Here is the code...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MServices.ReportingService;

namespace MServices
{
public partial class MServicesMain : Form
{
private static string reportServer = "
/reportserver" ;?=";?">/reportserver" ;?=";?">/reportserver" ;?=";?">/reportserver" ;?>/reportserver";'>http://<machine name>/reportserver";
private static char separator = '/';
private static char[] separators = { separator };
private static string separatorString = new string(separator, 1);
private static string reportPath = "/";

public MServicesMain()
{
InitializeComponent();
}

private void MServicesMain_Load(object sender, EventArgs e)
{
// added this peice to handle the restriction of the reports per user basis.
WebAccessManagerBlackBox(System.Security.Principal.WindowsIdentity.GetCurrent().Name);

ReportingService.ReportingService rService = new ReportingService.ReportingService();
rService.Credentials = System.Net.CredentialCache.DefaultCredentials;

CatalogItem[] catalogItems;
catalogItems = rService.ListChildren(reportPath, true);

PopulateTree(catalogItems);

// added this peice to handle the restriction of the reports per user basis.
if (!reportPath.Equals("/"))
{
ReportTreeView.Nodes[0].Text = reportPath.Substring(1);
}
ReportViewer1.RefreshReport();
}

private void WebAccessManagerBlackBox(string username){
if (username.Equals("ADV-SQL2\\Tom"))
{
reportPath = "/AdventureWorks Reports";
}
if (username.Equals("ADV-SQL2\\Joe"))
{
reportPath = "/WellsReport";
}
}

private void PopulateTree(CatalogItem[] catalogItems)
{
foreach (CatalogItem item in catalogItems)
{
if (item.Type == ItemTypeEnum.Report && item.Name!= "DummyReport")
{
string path = item.Path.Remove(0, reportPath.Length);
string[] tokens = path.Split(separators);
AddNodes(tokens, 0, ReportTreeView.Nodes);
}
}
}

private void AddNodes(string[] tokens, int index, TreeNodeCollection nodes)
{
TreeNode node = null;

for (int i = 0; i < nodes.Count; i++)
{
if (nodes[i].Text == tokens[index])
{
node = nodes[i];
break;
}
}

if (node == null)
{
node = new TreeNode();
node.Text = tokens[index];
nodes.Add(node);

if (tokens.Length - 1 == index)
{
node.Tag = String.Join(separatorString.ToString(), tokens);
node.Text = tokens[tokens.Length - 1];
}
}

index++;
if (tokens.Length > index)
{
AddNodes(tokens, index, node.Nodes);
}
}

private void ReportTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
string tag = String.Empty;

if (e.Node.Tag != null)
{
tag = e.Node.Tag.ToString();

((Microsoft.Reporting.WinForms.ReportViewer)tabControl.SelectedTab.Controls[0])
.ServerReport.ReportServerUrl = new Uri(reportServer);

((Microsoft.Reporting.WinForms.ReportViewer)tabControl.SelectedTab.Controls[0])
.ServerReport.ReportPath = reportPath + tag;

((Microsoft.Reporting.WinForms.ReportViewer)tabControl.SelectedTab.Controls[0]).RefreshReport();

tabControl.SelectedTab.Text = tag.Substring(tag.LastIndexOf("/")+1);
}
}
}
}

The image shows the form in action...

Reports

SSRS Execution Web Services

The sample in the online documentation does an excellent job of getting the concept across. Please refer to the same at the following URL for more details.

http://technet.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsexecutionservice2005.reportexecutionservice.render.aspx

Sunday, April 27, 2008

Microsoft Search Server (MSS) vs. Google Search Appliance (GSA)

Last week we were working on Google Search Application (GSA) to Microsoft Search Server(MSS) migration engagement for a client. The client in this case provides several hosted service and one of the key service they provide is to execute hosted search on behalf of their customers (Search as a Service if you will). The point of interest in this engagement was that the client was not evaluating GSA vs. MSS – they already had GSA running for some time and were considering moving to MSS. Now why would someone want to move away from a product that was developed by *Google*? Particularly when the product is Googles domain - Search.

The pain points around GSA as expressed by the client were:

1. GSA was extremely unstable, leading to downtime and perpetual Google support requirements.
2. Many a times Google support cannot fix the problem via remote diagnostics hence the client would have to ship the physical box back to Google. Duh!! Imagine the downtime management and hardware redundancy requirement if this happened frequently as in case of this client. (Google provides a physical box with GSA preinstalled on a locked down Linux box)
3. The only option for backup is the configuration file which can be exported to an XML file. However there is no disaster recovery option for the crawled index files. If the server crashes it takes the log files down with it. (this client had to crawl around 7-9 million URLs this could take a long time to re-index)
4. When Google makes any updates to the box, the client would have to re index the whole set of URLs again.
5. GSA has some problems crawling certain sites, hence does not index all the URLs specified in configuration.

Wow… imagine if you had to live with these issues.. would you choose GSA? Would one accept this type of a solution from a company like Google?

With GSA Google is treading in uncharted territory - the enterprise. Google does extremely well with their online model, thanks to many of its application being in the perpetual beta state and all products being hosted and managed online by Google customer never had any issues. But the enterprise - this is a different ball game the on premise model is one where Google cant play the perpetual beta cards. And then Google customer support - hmm not a very pleasant experience either. Makes you wonder does Google understand its customers?

On the other had Microsoft with MSS understands the enterprise, and MSS does not suffer from the same problems as GSA. The concern the client had with MSS was on search result relevancy provided by MSS. However initial MSS relevancy metrics (reciprocal relevancy, Precision @N etc) were promising. Does that mean MSS walks away with all the brownie points? Sadly no. The search space is something Google understands well and Google has build GSA with the intension that some of GSA clients will implement search as a service and hence have provided several capabilities that support this type of deployment out of the box (pure multitenant isolated indexing is not supported) however MSS doesn’t come out of the box with these capabilities – the primary limitation being that MSS supports only a single Shared Service Provider (SSP). If like its cousin MOSS, had MSS supported multiple SSPs thing would have been great. SSPs give you the capability of servicing all the hosted clients in a more multitenant manner (administration, provisioning, configuration, isolation – client specific requirements could not be met leveraging Search Scopes alone) and SSPs also allow you to scale better with different physical indexing server that can be assigned to individual logical SSPs and a more distributed index log file management (most of these capabilities are not in GSA right now). Its sad that Microsoft didn’t plan to include multiple SSP support for MSS. Were MS just plain shortsighted or was there a good reason not to include multiple SSPs in MSS? Either ways Microsofts SSP decision on MSS didn’t help this client. The client is now leaning towards the MOSS solution – though now the cost of implementation had gone up several folds since we are leveraging MOSS instead of MSS. Next stop – performance testing. The final test – if that goes well its hasta la vista to GSA.

Google being who they are will surely bounce back with a better/stable product and support, but that could take time even the mighty Google is vulnerable. In the meanwhile GSA isn’t getting a lot of word of mouth advertising from their existing customers and Microsoft is sure to leverage that. As with most things in life you don’t get a second chance to make the first impression :).

Technologies that have gone “Cold”

Couple of day’s back we were in technology discussion with a client to discuss the the implementation technology of their product. They were primarily a Cold Fusion shop and we were recommending them to implement the new product on the .NET framework via ASP.NET.

Since we have access to several Microsoft resources, had posted the question to some of the architects in Microsoft if they had any material on Cold Fusion vs. ASP.NET, interestingly couldn’t find an MS architect who was up-to date on the Cold Fusion compete scenario. That’s odd if you think about it cause most of the client facing MS folks walk around carrying MS Tech vs. X technology “battle-cards” around with them and are ready to pounce on the topic. Apparently it seems that these days Cold Fusion is not on Microsoft’s compete radar, hmm…how important is a fact like that? Note that that’s not to say Microsoft doesn’t compete with Adobe. Interestingly other than Microsoft the only other company which has the broadest vision on Rich vs. Reach software delivery is Adobe. In case of MS the Rich vs. Reach extends from WPF->Silver Light->AJAX.NET Asp.NET, in case of Adobe its Flash->Cold Fusion. However on the pure web technology Cold Fusion doesn’t seem to be on MS radar – from what we have seen the other technologies that are on MS radar on the pure web technologies include PHP and Rails (it seems that even JSP has started moving out on the outer periphery of MS radar). From what we gather, the last time Cold Fusion was on MS compete radar was 2004-2005.

Microsoft has just one primary goal - to ensure that Windows is the platform of choice, and they invest huge amount of money into doing comparative analysis on other competing platforms and technologies and are quick to either adopt the new trends or via their internal R&D engine stay ahead of the curve. The compete documents from MS provide insightful cases when MS technologies are better than other etc. In many ways looking at MS radar for technology comparison is like referring to the reports of some of the IT industry analysts like Gartner/IDC/Forrester etc ie instead of spending a lot of our time into investigating the right technologies we can leverage the R&D effort done by someone else. But still, how important to select from a product that’s on Microsofts compete radar? To put it in a different way - imagine your going to direct a movie and you have chosen the lead actor because you have worked with him in the past and he is a friendly guy..however the paparazzi doesn’t care about him and don’t even want to take his pictures… he is just not on the paparazzis radar. Would you still go ahead and direct the move with the same cast? :)

Jokes apart selecting the right platform is a critical first step. We might sometimes be religious of our preferred technologies but at the end of the day the technology you select should be able to give you the best ROI on your investments and a faster time to market. Cold Fusion (CF) by the way is a great technology, several years back it was a very compelling product and was light years ahead of other vendors particularly in terms of productivity (CF abstract a lot of the technical details away from developers). Productivity still continues to be the #1 reason most companies choose CF. But other vendors have caught on productivity side, ASP.NET with Visual Studio.NET and AJAX.NET offer the same level of productivity. However the .NET platform has much more to offer. In many way it does not abstract the details from the developers so there might be a more steeper learning curve, however abstracting too many things is also not a good thing. I still remember the time I was coding in VB (classic VB ie not VB.NET) – VB was a high productive environment that was extremely productive but the moment you had do to something out of the ordinary/required more performance/threading etc you wished you had developed the product in VC++ - i.e. productivity alone should not determine the selection of a technology unless productivity itself is the primary goal (as in case of most departmental level IT projects). Given this clients solution was to be hosted on the internet performance was a key driver for the selection of the technology ie higher performance implies running more on less hardware -> reduce the operational cost, this is where ASP.NET had a clear advantage over CF also since the hardware they already had were Windows based no additional software cost had to be incurred when running ASP.NET however in case of CF they had to purchase the Cold Fusion Application Server. This along with other factors made ASP.NET a more compelling choice.

If you were to build a web application and had to choose a web technology keeping in mind good balance of performance, ROI, productivity etc what technology would you adopt? And would you keep the paparazzi in mind when selecting the technology :)?

Thursday, April 17, 2008

Successful SharePoint Deployments

Microsoft Office SharePoint Server (MOSS) has undoubtedly exceed the expectations of early adopters, even Microsoft must have underestimated the potential of SharePoint (MOSS is the fastest growing server side product in Microsofts history). SharePoint is one of those rare products we get to see that can almost certainly be a great investment for organizations, but there have been several cases of “SharePoint casualties” interestingly most of these had nothing to do with technical aspects of SharePoint. We have been working with several customers on SharePoint implementations and have found common patterns that can ensure the success of MOSS deployment. Listing out all factors that can lead to a successful implementation can result in a humongous blog so instead of on discussing on what-to-do style this blog post will focus on a what-not-to-do style. (Note that this blog focuses only on MOSS when leveraged as a collaboration solution within the enterprise)

Major causes for SharePoint failures:

1) Cultural issues: Every organization is unique and has a different culture, unlike implementing transactional Line-of-Business systems like ERP, SCM, CRM etc, implementing a collaboration system like SharePoint has to also consider how people currently collaborate and how the implementation of the collaboration system will improve their productivity and overall collaboration levels– this would invariably hit organizational-cultural issues (you cant replace existing collaboration mechanism like email etc). Implementing a SharePoint solution also raises questions on the type of governance model – the collaboration solution must reflect how the organization is currently collaborating and extend it. Very tight governance will result in a difficult to use/grow solution and governing the system loosely will result in the solution being unmanageable and loosing value over time. Getting it right should be the first step and an ongoing process. Nothing worse than investing on a portal system and no one wanting to use it.

2) Big Bang Approach: Ok your company has invested in SharePoint, you have spent a good investment on implementation and you want the whole company to know about the portal and have all the employees start using it overnight. Wrong. Lets learn from the mistakes of SOA projects, most SOA projects have been implemented using the big bang approach (rolling out everything in one shot with extremely lengthy implementation cycle) big bang SOA implementations have almost always failed (giving SOA a bad name :) ). The best implementations are done iteratively over a period of time prioritizing on features that are important to end users, however its equally important that the focus should be on portal features that give the most visibility to stakeholder and provide highest returns on investments (many a times its good to look for the lowest hanging fruit).

3) Poor rollout strategy: Most non technical organization have hired external contractors to build the SharePoint portals however these contractors just build the solution and packed out, there is no internal knowledge with the organization how to use the solution and how it works. No SharePoint implementation is complete without a proper end user training of the solution and without setting up a team that will champion the portal initiative and train other knowledge workers. The rollout strategy should also take into consider the owners and stakeholders for the portal initiative and how stake holders are given periodic reports on various portal metrics (these are metrics that can justify the ongoing support and maintenance costs of the portal, cost center management etc). Last but not least its important to create a buzz around the portal initiative, this ensures that people in the organization (particularly if it’s a geographically dispersed org) know that the portal is a major and serious initiative (were talking of creating a buzz here not creating hype :) ), would be plain silly to have made a huge investment on a portal and not have people know about it.

There are several other small factors that can ensure a successful SharePoint implementation however the above 3 should provide you good guideline. Sure enough there are technical design considerations to be made for a successful SharePoint implementation but will leave that for another post. Making things MOSSible :) one step at a time.

Friday, April 11, 2008

Cloud computing – the next big thing

Subscription based delivery models such as Software as a Service (SaaS)/ Software + Service (S+S) model are no longer a hype, its reality and the sheer number of adoption of subscription based applications by organizations tells you that SaaS/S+S a viable option for most ISVs and end consumers. Market analysts and the IT community are always looking for the “next big thing” and this time around it looks like everyones got their eyes (and big bucks) on cloud computing.

So what is cloud computing? Practically any application/service that’s hosted outside the organizations firewall has been referred as “in the cloud”, so what the deal with cloud computing and what makes it different from hosted applications we have been building?
In many ways you can think of cloud computing as a form of utility based computing that’s available on demand, ie a subscription based service. The appeal of could computing is that you no longer have to plan way ahead for hardware capacity (and redundancy) – if you need more hardware capacity all you do is subscribe for additional resources. Instant infrastructure if you will. This is a boon for many startups, as they can start and stay lean on both infrastructure and headcount, it reduces the bar for entry. Typically services that are infrastructure intensive/ involve number crunching are good examples of services that could be offered in the cloud. Some of the well known examples of cloud computing can be seen from the services provided by Amazon such as their Elastic Compute Cloud (EC2) and its Simple Storage Service (S3). Other major players such as Sun (with its grid computing service) and IBM are also entering the market. Many other heavyweights have committed towards the cloud computing initiative, everyone seems to want a piece of the action. Several enterprises are already subscribing to cloud services for image processing, address processing etc.

So whats happening on the Microsoft front you may ask? Microsofts Oslo initiative (see earlier post) along with the BizTalk Service and its virtualization and System Center management products will provide the back bone to building cloud computing infrastructure also Microsofts High Performance Computing (HPC) 2008 is in its early stages but looks promising, you can expect several companies to provide cloud services for doing grid computing by leveraging MS HPC, similar to the grid computing service provided by Sun.

Cloud computing may be known by different names already you can hear people interpreting it as “platform as a service” and “infrastructure as a service” and each vendor is carving out a keyword that they can associate with cloud computing and riding the hype wave. Regardless in the next few years cloud computing will change the way we build and consume software just as SaaS/S+S is changing the way we use applications. This should be an exciting space to watch.

Saturday, April 5, 2008

User Experience(UX)

Couple of days back, was with some architects at clients place and was disussing about their application architecture. The discussion soon turned to UX. Fortunatately they were architects so whiteboarding was easy (unlike getting into PPT mode with business folks :) ) - the outcome of the whiteboard discussion seemed like a good mind-dump of our thoughts. Recreated here - you guessed it ..via PPT :)

click for larger image