What’s new in SQL Server 2008 Analysis Services

Lynn Langit is presenting this one.  Her main career focus is Business Intelligence and has a book coming out.  I’ll have to pick this up.

This is an area that has always been of fascination to me yet I don’t know anything about it other than simple data reporting.  Working at the Val Verde Unified School District we have vast amounts of data and could really take advantage of BI.  Hopefully I’ll be able to use some of this with our new SQL 2008 install and start introducing it to various departments.  Maybe we could even use it in IT to analyze our support trends.  That would be sweet!

Excel has a great add-in to act as a client to BI data.  Excel is one of the primary tools used at our organization, especially by our business office, so this would be a great sell.

Wow!  Lynn just showed how she took her Excel spreadsheet of local data and analyzed it using Microsoft’s own services.  She asked Excel to analyze it, it reported she wasn’t connected to SSAS, she said she wanted to use Microsoft’s data services in the Cloud, and then it sent the results back.  This took only a few seconds.  Yes you are sending your data to Microsoft and yes this service is only free during beta testing, but this is amazing.  Could really open doors for cheap introduction to SSAS and BI in general.

Check out SQL Server Data Mining in the Cloud for details on how to do this.

At VVUSD we have the mentality that we’d rather pay up front had host our own services, but using this might be a great way to sell research in this area in the beginning.

Lynn gave a great explanation of SQL Data Services.  It is SQL Server that has been optimized for performance and high-availability.  Thus many features have been removed and interaction has been restricted.  There are schemaless containers via Authorities, Containers and Entities (think property bags).  Also, the only query language currently is LINQ.  This all may change but that’s the current state.

Wow!  Once you have a validated and fairly good model Lynn showed how this can be used real-time.  You can hit your model real-time, such as from a form your sales guy is using, and get instant prediction about your current state.  For instance, if you’re selling bikes, and in the first 3 questions your sales guy finds that this potential customer is in the bottom 10% of likelihood to buy a bike, they can thank the customer and hang up right there.  Instantly, in real time, they have found out the likely results of their work.  We could use this in our school and, based on grades, get instant feedback as to how successful a student might be.  Education organizations spend millions in this area so I think our work would be cut out for us! :)  In the IT dept, for example, we could possibly instantly predict the support costs we’ll incur from a department (or specific user) and hardware (laptops, phones, etc) based off of previous support calls.  So if a user who travels a lot and is particularly rough with their equipment asks for a new laptop we may find that it’s more cost effective to buy a better warranty or a tougher laptop (or deny the request all together).

This is definitely a large area (full careers in themselves) but something that would definitely be worth spending some time on if possible. 

OK, I’m definitely going to have to pick up a book.  This is all so new to me that most of this is over my head, but the demos are absolutely amazing.

Real World SQL Data Services

James Johnson is hosting this one.

The interesting thing about SDS is it sounds like more of a property bag storage.  That brings a whole host if questions like how do you manage millions of rows, indexing, querying, etc. 

The Entity itself is the property bag, whish is within a container.  Each container is contained within an authority.  It really sounds like an Authority relates to a database, a Container relates to a table and the Entity is the item.  This is exactly how we shouldn’t think about this though! :) 

I’m assuming that once in production the containers will be distributable and “replicatable” across datacenters.  If you also have your app and services in the cloud then you could really take advantage of multiple instances and distribution across the globe.  This would really be amazing.

James suggested checking out Mike Amundsen’s SDS utility.  It allows you to create and view your Authorities and what Containers and Entities they contain.  You can also see the raw XML response.  One nice thing this shows is that SDS is fairly responsive as it was a pretty smooth running app.

SDS uses XML (through REST) to transfer all its data.  LINQ and XPATH should be very useful to process this data.  I wonder what’s the best way to hydrate this data into an actual object that you can pass around.

There were some questions as to whether this data is also available as JSON, since it’s ultimately handled by WCF.  Since your authentication (token and password) are required to access the data I don’t see this being done in an open channel, such as through AJAX on the user front end.  Since this will most likely be used entirely within the .Net backend I don’t see a reason to use anything other than XML.

James wasn’t able to upload a BLOb and its metadata in the same Entity.  He had to create/upload one Entity with the EntityID and the file data and then another with the metadata and a “foreign key”.  I wonder if this is really a limitation of SDS.  If so it will probably be addressed before RTM, but in the mean time maybe a multipart XML upload would work.  This may also be a limitation of REST and WCF, where again a multipart message body would probably work.

So now James has these two containers which need to be “joined” together.  He downloaded both containers and then used LINQ to join and manipulate them.  That works but it means that you have to download all the data prior to getting to LINQ.  What would be better is if you could use LINQ-to-SDS. 🙂

It looks like there’s no official LINQ-to-SDS, however, if you check out the PhluffyFotos example there is a LINQ-to-SDS provider.  I’ll have to look at this.  In a previous session Bret Stateham showed how to embed lambda expressions in the REST query, which I’m told is called Dynamic Language Invocation.  Definitely worth checking into.

 

What is the Microsoft Cloud Platform?

Woody Pewitt is giving this talk.  It’s another intro talk for the rest of the Cloud topics through out the weekend.

Honestly, regarding Cloud computing as a concept, rather than any particular vendor’s platform, is a game changing shift.  Much like hardware virtualization is a game changing concept for data centers and development/testing (this is a whole other topic) the Cloud concept is changing the way the web works from a hosting point of view.

While in large corporate environments you have network managers, server administrators, DBA’s and they handle the resources at a fundamental level for the most part developers still have to dabble in these areas.  That’s a great thing because I’m still in the camp that developers should understand what platforms they are dependent on, be it IIS, Windows server 2008, .Net 3.5, SQL 2008, etc.  However, once I am intimately familiar with my platforms I don’t want to have to spend 50% of my time provisioning servers, installing patches and service packs, doing routine optimizing, hardening against intrusion, replacing drives or power supplies, migrating to new servers, etc.  Having the Cloud allows me as a developer to offload all this work to a 3rd party. 

OK, so that’s no big.  I do that now with inexpensive hosting such as GoDaddy, colocation of my own servers, or my own data center managed by server admins.  What’s so new about the Cloud?  The great thing is the services I use (hosting, data access, etc) are now abstracted.  If I host my site on GoDaddy or any other of the examples above I still have to interact with my web hosting software and databases as if I was still directly connected to them.  I still have to work with the mindset that my web app is hosted on a single server, connecting to a single database at a single datacenter.

What the Cloud does is abstract all of this.  I can code my app to have a light weight UI that passes requests to small chunks of service code which hits a abstract data store.  This allows my Cloud vendor to not only store all these parts in different locations but also mange multiple instances of them.  If my app starts getting a large number of hits and the data store is slowing down, they can replicate this data across multiple hosts.  If my UI starts to get sluggish they can host the front-end across multiple web hosts.  This allows my app to scale almost indefinitely without my direct involvement.  Not only can it scale in the number of running instances, but geographically as well.  Let’s say I have an airline ticking company that services flights from the USA to Europe.  In the off season it may receive a fairly light amount of hits.  However, come Christmas time I may get thousands of hits per hour.  Not only that, half my customers may be in the USA and the other half in Europe.  Allowing my application to scale out to multiple instances and multiple geographic locations, automatically without my direct involvement, is absolutely amazing.

This is where web hosting is going.  In 10 years almost no one will be hosting on individual web servers except for in specialized locations.

OK, off the starry-eyed platform.  Back to the talk.

Woody, and Lynn Langit who is in the audience, just mentioned the sign on process.  It’s a nightmare!  Even some of the internal MS people don’t have keys.  I think with all the talent that’s in MS they could have designed and built out the whole sign-up and beta key process much better.  It’s terrible to put it lightly.  The forums are filled with disgruntled users that can’t log in and have no idea what state their application process is in.  This is one of those examples where a little more time and care up front would have saved hours and hours of support calls/emails/postings and upset and confused users.  OK, that being said check out Lynn’s post on this very subject.

Microsoft is not publishing any dates what-so-ever, however, Woody said there is another PDC planned that will announce the RTM availability of Azure.  His guess, and that’s all it is, is that Azure will not be ready for commercial release for another year.

Woody was putting forth the idea that this really abstracts and commoditizes the data center.  These are things that web app designers (large and small) will not have to worry about.  In fact, Microsoft is in reality commoditizing their data centers.  Check out Woody’s post here showing a great little video on how they are doing this.  The grand plan is to literally order a “truck”, which is a fully self contained datacenter with just three “plugs”: power, internet and A/C.  These trucks will be sent to a warehouse built for this capacity by Microsoft.  These centers can be quickly deployed to any area that Microsoft’s researched has deemed a high volume area.  If a trailer starts to sense that it’s at a specified failure load, like 20%, it will be decommissioned, degaussed (as it leaves the facility) and replaced by a brand new truck.  Pretty amazing!

LINQ 101

Daniel Egan is giving this talk.  He was one of the ones in charge of setting up the Code Camp schedule.  He noticed that while there were several LINQ topics there were no intro topics so he decided to give this one.

Daniel is doing a great job, however, it’s a 3 hour talk condensed into one so he’s having to skip a few things.  Couple that with projector problems and we’re really short on time.  We’re going over basic ORM concepts and new properties in VS 2008.  I don’t know that he’s actually going to get to LINQ! 🙂

I saw a talk about a year ago at the Microsoft Irvine offices where the presenter went through about an hour and a half of seemingly disconnected features of VS 2008.  Then suddenly when he started talking about LINQ in depth under the covers it all made sense why these features made it into VS 2008 and how LINQ really works.  I think Daniel is going through the same talk, but as I said I don’t think there is a lot of time.  Man I wish I remembered who that presenter was.  The presentation was one of the best I’ve seen.

Daniel did mention automatic properties.  He doesn’t like them either! 🙂 They are fun, quick and do enhance readability, however, the instant you need to add checks or some business logic you have to rip apart the auto property.  So it doesn’t really do you much good.  ReSharper sort of tries to help but not really (maybe I just don’t know the right command).  If ReSharper could take an auto property and change it to a fully fleshed out get and set that would be great.

He’s going over extension methods now.  This is one of the most usable enhancements of .Net 3.5 in my opinion.  This can create a huge amount of dependent code and a big mess if not used properly.  However, if a corporation has an internal shared library of extension methods that can be great.  If you are working on open source projects then you have to make sure the extension methods are included in the build.  I think there will eventually be a lot of “common” extension libraries, much like Apache Commons for Java, on CodePlex and other sources for people to download and use.  Then everyone can make use of common extensions that are freely available and help everyone to code consistently. 

Daniel doesn’t like var!  :)  There are definitely mixed feelings about this.  I haven’t used it enough to weigh in on one side or the other.  It’s just interesting to hear different reactions.

Unfortunately that’s all the time I have.  I have to run to the next session.  Daniel is going to try and squeeze every minute he can but I have to be in another building by 10am.  He’s not finished yet and hasn’t gotten to actual LINQ but did cover some of the foundation behind the scenes. In depth LINQ will be covered by many of the other sessions.

I’m off to “What is the Microsoft Cloud Platform?” by Woody Pewitt

Technorati Tags:

The Beginnings of Code Camp 2009

I’m at Code Camp 2009 at Cal State Fullerton this weekend.  If you don’t know what this is and have the weekend free drop by.  There are a lot of great sessions from very talented speakers.  Chances are there are at least a few (if not dozens) of topics that you’ll want to know more about.

There are too many sessions that I want to attend so I’m trying to keep this a little more real world.  As I’m starting a project that is going to be using Microsoft Windows Azure and SDS I’m attending a few of of those.  Also, we’ve just installed SQL 2008 at my work so I really want to check out the BI And SSIS portions.

Here’s the schedule I’m following:

Saturday – Jan 24

  • 8:45 AM – LINQ 101 by Daniel Egan (Room: H 123)
  • 10:00 AM – What is the Microsoft Cloud Platform? by Woody Pewitt (Room: UH 339)
  • 11:15 AM – Azure Cloud Application Model by David Pallmann (Room: UH 339)
  • 1:15 PM – Real World SQL Data Services by James Johnson (Room: UH 335)
  • 2:30 PM – What’s new in SQL Server 2008 Analysis Services by Lynn Langit (Room: UH 335)

Sunday – Jan 25

  • 9:00 AM – A Journey Through SQL Server Analysis Services – From Planning to Implementation by Ben Aminnia (Room: UH 335)
  • 10:15 AM – SQL Server Integration Services Control Flows by Bret Stateham (Room: H 110)
  • 11:30 AM – Asterisk The Open Source PBX by Mike Roth (Room: UH 250)
  • 1:30 PM – Active Directory Programming for Developers: Level 1.5 for .Net 3.5 by Steve Evans (Room: UH 339)
  • 2:45 PM – Active Directory Programming for Developers: Level 2.0 by Steve Evans (Room: UH 339)

 

Technorati Tags:

Technical and Developer Podcasts Worth Listening To

A fellow member of the IE .Net User Group asked me what podcasts I listened to.  He expressed taht there are so many it’s hard to sift through what is actually good quality, both in content and actual production.  Some podcasts are great sound quality, however have very little content that is worth while.  In contrast, some podcasts have great content, but are so hard to hear or are of such poor audio quality that it is really frustrating to ferret out what they are actually talking about.

Here’s the list I usually listen from:

The two I listen to the most and are of very high quality (both in production and content) are .Net Rocks (http://www.dotnetrocks.com/) and Hansel Minutes (http://www.hanselminutes.com/).  Both can be subscribed to via iTunes.

ASP.Net Podcast (http://aspnetpodcast.com/CS11/) is another one I will listen to if they have a good topic but the quality is pretty lousy so they have to have someone really good for me to bother.

If you’re interested in good podcasts that aren’t necessarily just .Net development, but all around technology check out TWIT: http://twit.tv/.  I haven’t listened to them in a while but they are all very high quality (Leo Laporte, the main host, has been in radio for 30 years) and they have a lot of very good content.  Almost anything technical you’d want, other than .Net development, is covered by one show or another.  Here are just a few that I’ve listened to (not in any particular order):

  • net@night is a good all around what’s happening in tech this week.  A little more of a social bent but a lot of good info and a very open topic of conversation.
  • The Tech Guy is Leo’s actual call-in radio show helping users.  Lots of good general information on anything tech, but probably more for the general consumer.
  • Security Now is a good in depth security podcast.  I think that Steve Gibson is a little too proud of himself but the actual knowledge and explanations of complicated subjects are quite good.
  • MacBreak Weekly is a really great podcast if you are a Mac guy or have Mac friends.  It’s funny and has wonderful content. 
  • TWiT (This Week in Tech) is a very good open discussion podcast with a few regular experts.  Really interesting with the different viewpoints given.  Very good listening.
  • FLOSS Weekly is an complete open source driven podcast.  Usually on things Linux and such but on fairly broad open source projects that do appear in the Windows world.  Very good interviews, however, despite the name it is not weekly.

I don’t listen to every edition of these podcasts, only those that are actually interesting.

If you come across any others that you like let me know!

Verifying code with Pex

I’m a very TDD yourself type guy. I don’t like generated tests, which totally conflicts with the first D in TDD, Test Driven Development.

 

Anyway, Maarten Balliauw had a really nice short post on using Pex

 

Stealing from Maarten’s post, here’s an abstract from a recent session on Pex:

“Pex is an automated white box testing tool for .NET. Pex systematically tries to cover every reachable branch in a program by monitoring execution traces, and using a constraint solver to produce new test cases with different behavior. Pex can be applied to any existing .NET assembly without any pre-existing test suite. Pex will try to find counterexamples for all assertion statements in the code. Pex can be guided by hand-written parameterized unit tests, which are API usage scenarios with assertions. The result of the analysis is a test suite which can be persisted as unit tests in source code. The generated unit tests integrate with Visual Studio Team Test as well as other test frameworks. By construction, Pex produces small unit test suites with high code and assertion coverage, and reported failures always come with a test case that reproduces the issue. At Microsoft, this technique has proven highly effective in testing even an extremely well-tested component.”

 

In the simple example Maarten used he showed how Pex may be a great tool to run after your TDD tests are finished just to possibly catch any edge cases you missed. 

 

However, make sure you refactor after including any code Pex suggested.  In Maarten’s post the last check ( if(length < 0)) is never entered because it is included in the check by Pex ( if (length < 0 || current.Length < length)).  This entire block can be removed.  It’s not harmful in anyway, but can be a little confusing and should be cleaned up.  ReSharper probably would catch it.

 

I’m going to have to give Pex a try!

Commercial Reporting Framework Comparisons

I was responding to a recent CodeProject forum question and my response got so long and detailed I just thought I’d blog it instead.

If you haven’t been by CodeProject check it out.  It’s a great site with an incredible wealth of very useful information in the articles and forum communities.

Anyway, the topic in question was this:

http://www.codeproject.com/Lounge.aspx?msg=2828212#xx2828212xx

“I’ve been tasked with researching some alternatives to SQL Server Reporting Services and was wondering what experiences and recommendations anyone out there has?

I’ve also seen a couple of add-ons for reporting services, some of which look quite promising – has anyone got any experience of these?

PS Ideally not Crystal Reports – I had to use this in an old job and *hated* it!!”

 

I’ve used various reporting frameworks as a developer and end user in various projects for the past 7 years.  While I am not up on the extremely current (such as developing in CR XI or SSRS 2008 yet) I hope this information will prove useful.  If you have any corrections or suggestions you would like to make please chime in!

As a side note my organization will be installing SQL 2008 (waiting for a couple of months now for our purchasing process to get the license through) and I’ll have a chance to really play with SSRS 2008.  I’ll post an update at that time.

Another side note; this is strictly a comparison of reporting, not business intelligence.

Another side note (how many of these can I have? :)).  There are some very good open source frameworks (such as Jasper for Java) that I have not had the opportunity to use.  Commercial products like those listed here are not the only alternative.  Plus, as several users have stated in the forum, rolling your own may be well suited to your project if you have very customized requirements, have a small reporting needs or restrictions on funds or use of open source limit your options.

Now, on to the comparison!

In several projects over the last 7 years I’ve used Crystal Reports (v8.5 and some limited XI), Active Reports (v3) and SSRS (v2005).  All have their pros and cons, however, they are in completely different areas.  Note that there are now newer versions of each product so I can’t speak for new features.  These also were the base products.  No 3rd party controls or such were used.

Here’s my very brief summary:
CR: Best designer and overall most professional output of static reports.
AR: Best tool from a strictly development perspective and most friendly to integration.
SSRS: Free, fairly decent but still an “early” product.

All three had their definite "quirks" (i.e. bugs, hacks, required massaging, etc).

Here’s my take in different areas:
Report Design (manual):
CR had the best designer I have seen.  Incredibly easy to use and I could create very rich and professional looking reports in a matter of minutes.  CR actually replaced my quick and dirty T-SQL result printouts when a supervisor asked for some quick numbers.  I could do a very professional layout in 2 minutes ready for use in a meeting rather than the dry text print of a result screen. However, extreme dilligence must be placed on good design.  It is very easy to scatter formatting and calculation code all over the place.  It can quickly become a mess of spaghetti and make debugging a report almost impossible.  If you exercise good design such as using base functions that are called by other functions, basing formatting of functions rather than inline code, using well documented code or good function/variable names then this can be mitigated.  XI comes with a new function and formatting explorer that really made hunting for customizations very easy.  This was a real “pain” in 8.5.

Active reports had no real designer other than a VB form like designer built into .Net.  I believe they have upgraded this in newer versions.  With AR I found that it was often easier (and more accurate) to edit the design in code.  Definitely not a rapid report development tool. However, I did find that of the three this tended to produce the most accurate results since I could almost hand code it myself.  As an example images were exactly where I placed them and with the exact right dimensions the first time.  That being said getting a very professional looking report really depended on your code/design skills there wasn’t really any help from AR in this department.

SSRS’s designer leaves a lot to be desired.  It is very rigid, has no real-time editing, and overall lacks a lot of the usability features of CR.  I could design decent reports much faster than AR, but it was difficult (if even possible) to get the same professional output of CR.  I believe this has been somewhat upgraded in 2008, but I’m not sure to what degree.

Advanced Design (i.e. functions, custom code, etc):

CR lets you create functions for almost any UI area of the report and this could be coded in a VBScript like syntax or their own.  I say UI area because there really was no control over the various events or rendering loops.  You could really only alter cell values, do running functions or change formatting.  That being said in the 8.5 version not all UI elements could be customized on a granular level.  For instance, you may be able to bold or hide something with a function but then couldn’t change the font or size. (Don’t quote me verbatim on this.  It’s just a example and my memory may not be accurate as to the actual specific limitations)

AR is pretty much a wide open playground for developers.  I love the amount of control you have.  It is pretty much entirely built with integration from the ground up.  Almost anything you’d ever want to customize you have full ability (and the .Net language) at your disposal.

SSRS is a love/hate situation.  You can use custom code in three different ways.  You can enter “expressions” almost anywhere you would want to manipulate data or formatting.  This is all in a VB like syntax so C# developers may not like that.  Plus, expressions are written in a single line so if you want do do anything other than simple manipulations or conditionals expressions won’t work.  Another con with expressions is much like CR pre vXI days, it’s very easy to “lose” a function because there is no one explorer tool like in CR XI that shows you all the different expressions that are embedded into the report.

A step above expressions is code embedded in the document.  Here you can create full fledged functions that are callable by the expressions, which is a preferred method if you are doing the same thing more than once.  However, in v2005 the embedded code has no designer.  It literally is a textbox with all the code at the same time.  There is no syntax highlighting, no IntelliSense and no debugging.  You simply run the report and if it doesn’t successfully execute you try and decipher the exceptions thrown.

Beyond that you can write your own code in C# (or whatever .Net language you choose), compile these into an assembly and then reference them in the report.  This is great because you get the full robust quality of the CLR and Visual Studio to create your functions.  However, this does slow down the development process as you’re now working in several different places and (at least with VS2005) each time you made a change to the assembly you had to close the reporting solution and re-open it for VS to reference the updated assembly dll.

Report Design (dynamically generated (even partially) within code):
Sometimes people want to be able to generate reports from scratch or even partially depending on the use of the application.  For instance, if you have a billing department, you may have several different reporting requirements based on the type of bill, who the bill-to party is, etc.  In this case you may have a base report template with a header and footer and on the fly add different “parts’ to generate the completed report.  This would be beyond static reports but not ad-hoc in the sense that the user is creating their own report.  I don’t really have experience in this area but I’ll state what I believe to be true.  Feel free to correct me.

I don’t believe that CR has any ability to do this what-so-ever.  Correct me if they have a new feature or product out by my experience is you either use a static report or a completely user-driven ad-hoc report.

I really don’t know if AR has this ability.  The reports are ultimately stored in XML (I believe) and it’s completely development driven so I would almost assume you could do this.  However, because the reports are really .Net objects you get full capability such as inheritance.  In v2 we created a template “base” report that had a header and footer.  Then we simply created several different static reports that were derived from the base report.  Almost like a master page scenario in ASP.Net.  The designer, however, didn’t show the master page elements and didn’t give any indication you were using a derived report class so you just had to remember things like not to make use of page headers or footers.  In v3 they broke this ability.  I created a support issue on their bug tracker but it hadn’t been resolved when the project was finished a couple of years ago.  I’m sure they’ve fixed this in the current version.  It was handy though!

The above solution is not quite the same as using sub-reports.  With sub-reports you create the base reoprts and include any sub-reports.  A sub-report may be reused several times.  In the above solution I created the base report and used that several times, which you can’t do in the sub-report scenario.

SSRS is based on XML, so theoretically you can design a complete report in code at run-time, however, I’ve yet to hear of anyone doing this in a practical sense. 

Ad Hoc Report Design (for end users):
CR: There was no ad-hoc ability in CR 8.5 other than putting an actual designer control in your windows forms app.  If you were selling the app I believe there were licensing restrictions around this and often software vendors had to sell a fully licensed copy of CR with their product, adding another $500 to the bill just for the ad-hoc ability.  Business Objects may have relaxed this in the later versions.

I have used the Business Objects InfoView XI R2 web based ad-hoc system as an end user.  It may be just the way the vendor set it up but in my opinion this is a terrible interface.  It is very clunky and constantly returns useless errors if a field no longer exists on a database, if a function is syntactically incorrect, etc.  A very un-user friendly product for non-technical users. In this day and age with web-based designers from almost anything such as designing a scrapbook like ShutterFly or Google Maps mashups, BO’s interface is a far cry from a well designed UI.  As a web developer myself I would have to state that this mostly is a lack of a good web 2.0 or Java development staff.  They use Java applets.  While Java applets (and UI in general) have gotten a bad rap there are some very good designs that show it is possible.  There is no real fundamental difference between what an applet vs a full blown app can do regarding UI.  If you have ever used IntelliJ (from JetBrains, the makers of ReSharper) or Eclipse (yes they fudge on their UI rendering and it’s not really Java that finally draws the screen) then you’ve seen some outstanding interfaces.  I’ve seen some incredible Java applet games (even in 3D 7 years ago) if you think Applets are different.  There’s no reason why BO couldn’t do the same if they had developers with the proper skills.

Active Reports also gives ad-hoc ability in the sense of putting a designer control in the Windows Forms app.  however, unlike Business Objects there is no licensing fee to to this.  This is largely one of the biggest draws to AR. As a developer you can purchase it and use it in all your apps without having to worry about licensing issues with your customers.

AR has no web designer, at least not as of v3.

SSRS: Comes with Report Builder.  It is a fairly easy to use system but may be confusing the way they "navigate" relationships.  All in all it’s probably the easiest ad-hoc system I’ve seen, however, v2005 offers only the most basic functionality.  For instance you cannot conditionally format text.  A very promising first release and I’m excited to see where they take this.

As a side note, while SSRS 2005 is free in the SQL Server Standard edition, they do leave some cool features for the Enterprise edition.  For instance, SSRS can dynamically generate views of a table showing field values, aggregates for foreign-key relationships and links to foreign key tables.  As an example, if you have a database of customers, orders, products, etc, you could view an order, navigate to the items, navigate to the base item, navigate to inventory, navigate to the invoices, navigate to the vendors, and on and on, without any development.  If you wanted a customized view of a particular table you simply create it and reference it.  Then SSRS will dynamically generate the table views as normal but use your definition when viewing that particular table.  This is a great way to “drill-down” into an app quickly when you need to check on the data rather than diving into the Query Analyzer.  But, alas, this is only offered in SQL Enterprise, <sigh>.

UI Controls:
CR has fairly decent UI controls.  Lines, boxes and other shapes worked fairly well if you navigate around the rendering quirks (like page breaks through shapes, etc).  Their charts were fairly decent but did not have near the granularity of something like Excel.

I didn’t use the AR controls on the projects we used it on so I can’t really speak to this.

SSRS has very basic user controls such as shapes, images and charts.  I haven’t really used these other than the image control.  It worked as expected. 

I will say that the chart control had some definite quirks in Report Builder.  When demonstrating RB to a group of co-workers we built a chart, viewed it, changed some formatting, viewed the changes, etc.  We eventually got to a point where I asked it to chart an invalid sum or result.  RB complained as expected, but we couldn’t simply change the values back to their valid settings.  It somehow remembered and said “Nope.  I don’t care what changes you make I’m not showing this chart again!”  The only way to get rid of the error was to drop the chart all together and re-create it.

All three packages have 3rd party vendors who sell very nice UI controls.  If your final intention is a very flexible and professional looking report you would probably want to explore these options.

Developer Take:

This is just a small section on how it is to develop with these various reoprting tools.

CR (as of v8.5) has almost no real report manipulation beyond their built-in functions.  As a developer you can change various run-time things such as page setup, the target database, etc but the actual report must be pre-built.

AR is a developer’s dream!  It is entirely created for .Net.  You have full access to the reporting life-cycle.  Just as you have access to events for web forms or ASP.Net web pages like Init, Dispose, etc you have the same abilities with AR.  You can run code during the report init phase, the before or after retrieving a record from the db, before or after rendering a page, etc.  Anything you want to do you can do.  It’s definitely a breath of fresh air for any developer.

SSRS really has no other abilities than what was talked about above in the Advanced section.  Like CR you can change a couple of run-time settings but you don’t have near the control of AR.  Again, I suppose you could intercept the xml and manipulated it on the fly before passing it to the rendering engine, but again, you have no control other than basic formatting/calculation functions while in the actual generation process.

Distribution:

I’ve used four basic ways to distribute my reports: give the report file to the user, embed it in my Windows Forms app, embed it into my web app or upload it to some Reporting Server.

  1. Give the report to the user(s).  With the web this is becoming less and less of a desired option.
    CR: The user must have either the full CR product or a report viewer.
    AR: I don’t think this is an option at all.
    SSRS: With Report Builder you can export the report as an xml file, which you can share with co-workers or give to a developer who can use it as a base in SSRS to expand on the functionality.  Comes in handy when an end user designs a report the way they want in RB but then requires some more advanced functionality so they give it to the developer to make the changes and deploy on the Report Server.  This gives some freedom to the end user while taking some of the labor off the developer.
  2. Embed it into the Windows Forms app.  All three products can do this and usually without any problem what-so-ever.  Since most of the security restrictions have been removed by running it in an application and the referenced reports/dlls are always available this is relatively straight forward.  In all three cases a “report viewer” control will be embedded in the app.  There is no licensing restrictions with using the report viewer with any of the there companies.
  3. Embed it into the web app:
    I haven’t done this with CR but I know they have web controls for this.
    With AR you can render the app in a variety of different ways.  I especially like that I can, in code, render the report in a variety of formats, such as pdf, and stream it to the user as a download.
    SSRS has a web viewer control but its very problematic.  For instance parameters for linked reports or sub-reports don’t seem to carry through well.  Dynamically assigning parameters is a head ache all together.  On one app where we use forms authentication we simply unlinked the reports and created separate urls.  Really lost a lot of nice dynamic functionality when we did that but it was the only we could find to adequately give data to only the users who should be able to view it.
  4. Reporting Server:
    As of v8.5 BO had a wonderful Crystal Reports Server web based server.  It was very easy to use and was free if you only needed 5 concurrent users.  This worked great for small departments.  We had a reporting server crash and rebuilding the settings from backup was a pain.  It took about a day and could have been made much easier but all in all the server was a pleasure to use when it was up and running.  It offered all the normal functions such as deploying reports, distributing them via on demand, sending to email, caching, scheduling, etc.  It even served as more of a document server in that it would let you upload other documents like PDFs, Word docs, etc. 
    Read the quirk below regarding the ActiveX report viewer control.  It was the only sore point of the system.  Unfortunately BO changed the licensing and now you can only use it for free with 5 named users.  Now its really only good as a test server or a very very small department.  To buy it is several thousands of dollars which makes it prohibitive for some groups and not really worth the money.  A good development team could recreate the web app if they really wanted to use CR reports.
    AR has no server.
    SSRS has their Reporting Server.  This is also an excellent system.  It mirrors much of the functionality of the CR server (except that it only serves SSRS documents).  This also is a pleasure to use and is very easy to implement.  In 2008 they have revamped the server and now it no longer depends on IIS. 

Quirks:

This is just all around quirks.  There are a multitude for each app and you’ll just have to learn how to work around each one.  Here are just a few I can remember off the top of my head.

CR:

  • As of version 8.5 the browser web control used by CR Server (the web server) was a real pain.  It was an ActiveX object and often would become corrupt or not download properly.  Also, BO would regularly release new versions of the control and only half the browsers would correctly download the new version.  The only way to manually re-install the control was to log in as an administrator (we had IE locked down fairly tight at that company), go into IE, view the downloaded objects and manually remove the control.  Then we had to see if IE would correctly download the control the next time, which was up to chance again.
  • Using the API in v8.5 for web forms was somewhat problematic.  Not all reporting capabilities that were available in the designer were available in the API.  Also, sometimes the order or inclusion of specific calls determined the output.  For instance, you could not change some of the page setup settings without first telling it what size of paper you wanted.  If the report was built for 8.5×11 (Letter) and I didn’t specifically state that in code none of my settings would be applied.  If I applied all my settings and then set it for Letter it would wipe out all my previous settings. 

AR:

  • Again, as of version 3 they broke report inheritance.  I’m sure it’s fixed by now, but what troubled me is they broke it from v2 to v3 and never fixed it for several months.  This force our project at the time to go back and use v2.  this could be quite a problem if you had already developed several reports in v3 and now had to run v2 and v3 on the same computer (which was a headache in itself).

SSRS:

  • The web report viewer control doesn’t use standard printing functionality.  They rely on their own control.  This is a large hassle because in many large organizations they don’t let their users download and install software on their machines.  This causes a very obscure error to appear on the screen causing help desk calls (usually to me).  The only thing we can do is train users to export the report as PDF and print it through Acrobat Reader.

 

Anyway, that’s my take.  While some of these products are older the general sentiment is still the same.  CR has the best designer, AR is the best for developer integration, and SSRS is free and coming along.

I’ll try and post an update once I’ve had a chance to use SSRS 2008.

Getting things done – Sometimes simpler is better

I’m working on a new project for my work.  I’m using S#arp Architecture started by Billy McCafferty, which is a framework using ASP.Net MVC, NHibernate for database persistence and Ninject for dependency injection.  It’s really shaping up to be a great framework and I’m learning a lot.

With NHibernate, you often come to the point where you have to map subclasses to your database.  The two prevailing strategies are one table per class or one table per class hierarchy.  You can look up any several dozen documents on these strategies.  For my project I chose one table per class hierarchy for one of my classes and its subclasses.

If you’re not familiar with Hibernate mapping documents, if you have one table per class hierarchy you have a single table storing the parent class and any subclasses all together.  This has its advantages, however, you have to have a column in the table (the discriminator) which holds a value telling Hibernate which class this record belongs to.  For instance, if I have a parent class of Person with two subclasses of Employee and Client, my discriminator field may hold “P” for Person, “E” for employee and “C” for client.

S#arp Architecture makes use of Fluent Nhibernate, which allows you to create Hibernate mapping documents in code in a fluent style.  Very nice.  It makes full use of generics and has been a pleasure to use once I dusted off my knowledge of mapping documents.

The problem is Fluent has a bug where it puts in discriminator elements for the subclasses.  There should only be one element describing the discriminator field and that goes in the main class definition.  For some reason Fluent also puts it in the subclass definitions causing Hibernate to throw an error.

So, what do you do?  Well, the great thing about open source is you can open up the code and find the problem.  I did just that but I hit another snag.  I love using Generics in my code, however, I’m not experienced at all at creating classes that use them.  After spending about a half an hour to find the problem and think about how to solve it I realized I didn’t have time to refactor the bug and relevant pieces to a logical usage.

So, I did the next best thing.  I added two lines of code to remove the element during the generation and fixed the issue.

The code to generate and return the mapping in xml ends with this:

1: writeTheParts(classElement, visitor);
2: return document;

So, I added the following:

1: writeTheParts(classElement, visitor);
2: foreach (XmlNode discriminator in document.SelectNodes("//subclass/discriminator"))
3:   discriminator.ParentNode.RemoveChild(discriminator);
4: return document;

In the code above, document is an XmlDocument type.  I used an XPath expression to find all the subclass elements that had a child discriminator element and then removed them.  The nice thing is this doesn’t affect any code that doesn’t have the bug.  It’s fairly clean and doesn’t get in the way at all.

While this certainly isn’t a true fix it does solve the problem in a very orderly and understandable way.  I still think it’s a hack but it helped me get back to my project.  I did submit the test (always create a test first!) and the patch to the project incase they wanted to fix the bug.  I also suggested that it still be refactored correctly by someone who is a little more experienced with Generics and the project.

So, in a case like this, I’d advocate simple when the solution is fairly clean, does exactly what it is supposed to do and there may not be time (or experience) for the alternative.