Skip to main content

U2U Blog

Go Search
U2U Blog
U2U website
  

Other Blogs
There are no items in this list.
Creating a Table Of Content in Reporting Services 2008

In Reporting Services 2005 we have document maps which creates an interactive table of content (TOC): every entry is a hyperlink. Nice for interactive use, but nearly useless when you render your report for printing. In print, we want page numbers, which is very, very hard to get in SSRS2005.

In Reporting Services 2008, it is still very hard to get a TOC with page numbers... unless you render to Word!

So, go ahead, deploy the Adventureworks Sample reports, open up the Product Catalog report and verify it has a document map in it. Next, export this to a Word file (it uses Word 2000, which can easily be used by Office 2002, 2003 and 2007 as well). Open up the Word file. There is no TOC in there, but we can create one explicitly. Only, do not be to hasty! If you create a regular TOC, it will use the Heading styles to place them in the TOC, and the Word export does not have Heading styled elements. So we have to create the TOC. In Word 2007, go to the References ribbon, click the Table Of Content button, and select Insert table of content. Next, click the Options... button, and in there, deselect Styles and select Table entry fields. Next, click twice the OK button and enjoy your TOC!

image

The U2U Analysis services documenter starts the year with a new version

Best wishes for 2008! And for those who are using Microsoft's OLAP and data mining database, analysis services, we have a new year's gift for you: a new release of our documentation generation tool. We added support for data mining structures and data mining models, so that they show up in the generated HTML documentation as well. Have fun!

Nico

(PS: download it at http://www.u2u.be/res/SQL05_ASDoc.aspx)

Approximate search in Linq

Many applications have a search functionality. In such a case, we would like an approximate (or fuzzy) search, which returns all items that are similar (in stead of identical) to the item we're looking for. In the past days, I developped a library which implements this for Linq (Language INtergated Query) to objects. So, all you .Net 3.5 programmers out there that need approximate search, download this dll from our website and get started!

Basically, the library adds two methods to LINQ: ProximitySort and ProximitySearch. The first one sorts all objects in the collection based on how similar they are to a given object, so it returns a collection. The second one returns only the best match. Because of this limitation, it can apply some optimisations. In short, ProximitySearch is conceptually similar to ProximitySort(...).First(), only more performant.

Both methods are based on string comparison: they just apply the ToString method on every object in the collection, and then calculate a distance between this string and the string of the SearchTerm object. The distance used is the Lhevenstein distance, a variant of the edit distance. These distances are language independant, they work on names, product numbers,... . If you want to compare objects on some other string than the one returned by ToString, there is an extra overload which allows you to specify a string selector.

Let's show some sample code.

"A few minutes ago somebody called with a complaint on the order he made on 10/5/2007, his name was 'Peterson' or something like that..."

var allShoppers = from c in Customers
                  where c.Orders.OrderDate = "10/5/2007"
                  select c;
var peterson = allShoppers.ProximitySearch("Peterson", c => c.CustomerName);

First we retrieve all people who bought something on that particular day (allShoppers), then we filter out the single person who's customername looks most like 'Peterson'.

 

"On our website, customers hate that huge drop down box which contains all our product names, but when we let them select a product category first, the complain that they don't know in which category to look... What can we do?"

Product searchProduct = new Product();
searchProduct.Name = textbox.Text;
var similarProd = Products.ProximitySort(searchProduct).Take(10);

If Product has a ToString method that shows the productname, and textbox.Text contains the name of the product the user is searching for, then the similarProd collection will contain all the products who's name resembles the one the user typed. Show them in a drop down box and let the user select from that limited box.

Have fun with the linq extensions! If I find some time next week (I'll be at TechEd) I'll post a follow-up article with some best practises and timings.

SQL Server 2008 Declarative Management Framework: be careful with subscriptions

Before we get to the bad part, I first want to stress the importance of the new declarative management framework (DMF). It allows administrators to define policies (naming conventions, security settings, force index creation, avoid fragmented data,...) and then map these policies onto servers or databases. This will simplify the administration of a SQL server instance a lot! For more info, check e.g. this webcast.

Now for the bad news. Policies are grouped into policy groups (quite straight forward), and a database subscribes to zero, one or more policy groups. However, when we drop a database, the subscriptions are not dropped. This can cause some very nasty side effects:

  • When dropping a subscription group, this operation can fail because of a subscription by a database you dropped already a while ago. In this case, manually dropping the subscriptions will solve the problem.
  • Imagine you drop a database X which subscribed to a bunch of policies. Some months later you create a new database which accidently has the same name X. Then automatically all policies which applied to your old database X will now also apply to your new database X: Mapping happens on database name, not id!

What do we do about this? This behaviour is in the July CTP, maybe next releases will no longer suffer from this problem (vote for the bug report here). Else, the solution is to manually clean up these subscriptions. In the msdb database, you find a view syspolicy_policy_group_subscriptions and a stored procedure sp_syspolicy_delete_policy_group_subscription with wich you can manually fix all problems.

Nico

Analysis Services Best Practise Checker V1.1 released

Today we release a new version of our best practise checker. Version 1.1 now checks for 28 best practises, nearly ten times more than the previous release. To give a bit of an impresion, we mention a few of the tests:

  • Are you using the most efficient SQL Server data provider?
  • Do your attributes have appropriate keys?
  • Are you using OrderBy and UnkownMember appropriately? The default settings are not always the best setting for these properties...
  • Are your hierarchies designed in a propper way?
  • Did you put distinct counts in separate measure groups?
  • Are your partitions reasonable in size?
  • Did you design reasonable aggregates?

We also improved the user interface.

You can export the detected violations into comma separated value (csv) or xml format, and import them later in the tool. Very handy to upload the information in Excel or a relational database. You can also generate reports on the detected violations. These reports can be viewed on-screen or exported to Excel or pdf.

A new option is to annotate a best practise violation. You can also mark a violation as 'Ignore': like most best practises, sometimes you might have good reasons to ignore a violation: the exceptions to the rules... It is also possible to include multiple databases and historical checks in a single analysis.

As you see, a lot of improvements. To download this tool, check our website.

Nico

Analysis Services Documenter V1.1 is out!
We updated our tool which generates HTML documentation from live OLAP cubes on analysis services 2005. The new version allows for generating documentation with multiple levels of detail, as well as collapsable web pages for easier interactive use. And to help the management: it became a click-once application! Check it out at http://www.u2u.be/res/SQL05_ASDoc.aspx
 
Nico
Analysis Services Best Practises Analyser
Analysis Services, Microsofts OLAP and Data Mining engine, is a very powerful tool. But like many powerfull tools, if you don't configure it in the right way, it impacts the performance. There are a bunch of 'best practises', but now there is also a tool which automatically checks these.
 
Analysis Services Best Practise Analyser checks your live OLAP databases against some key Best practises. Currently, it checks for aggregations, attribute relationships and non-empty behavior on calculations, but we plan to add more in the future. Try it out for free!
 
Nico
Tool to check Non Empty Behavior

In an OLAP cube, it is important that the cube can quickly figure out if a certain cell (or tuple, for the MDX fans out there) is empty or not. For measures, Analysis Services is keeping track of this. But for calculated members, the system has to evaluate the full expression, which slows down the query. Unless... unless we can tell the system that the calculated member will be empty (null) when another, real member is null. This is done via the non-empty behavior property of the calculated member.

It is common to check all your calculated members to see if this property is set (or there is a valid reason why not setting this property is OK). To help you with this, we develop a tool: NEBChecker. With this tool, you can quickly see all the calculated members in your live cubes which do not have a non-empty behavior set on them. The tool also shows you the definition of the relevant calculated members. Go to the U2U Resource center and give it a try!

UPDATE: NEBChecker doesn't exist anymore: it became part of the SSAS best practise analyser, wich you can download at the u2u resource center as well:

http://www.u2u.be/res/SQL05_ASBPA.aspx

Nico

 ‭(Hidden)‬ Admin Links