Doug Lane

SQL Server Entertainer

  • GitHub
  • LinkedIn
  • Twitter
  • YouTube
  • Blog
  • About Doug

T-SQL Tuesday #016: Aggregations in Reporting Services

March 8, 2011 by Doug Lane

It’s Tuesday, which means two things:

  1. I may or may not be out of Craisins…not sure.
  2. Time for a T-SQL Tuesday post.

I’ll check on the Craisins later.  Let’s do the post.

Last I checked, most elementary school children can take a list of numbers and add them up as they go.  That is, give them a list of 3 + 4 + 5 + 1 and they’ll probably tell you 3 + 4 = 7, 7 + 5 = 12, and 12 + 1 = 13.  Simple, right?  If you ask them to sort it from lowest to highest, omit the odd numbers, and make a second list based on numbers in the first, they’ll stare at you, then tell you they had an accident in their pants.

Did I mention I'm pretty good at coloring, too?

Reporting Services works much the same way.  If you ask it to do things it can do as processes data row by row, like RowCount, Sum (with or without an explicitly defined scope), or even Previous, it’s pretty efficient.  However, if you ask it to start shuffling items around (sorting), cutting items out (filtering), or relating items to each other (subreports), Reporting Services is not able to deal with it as efficiently.  Why is that?

Reporting Services has no indexing on its datasets.  None.  Zero.  Zilch.  Nada.  The null set.

BingGoogle “Reporting Services Indexes” and you’ll get results less useful than those Ensure coupons the grocery store registers insist on printing for me.  (I’m a 35 year-old man!  Give me something I’ll actually use, like a dollar off Craisins!  I’ll bet that Ensure nonsense comes from a bloated Access database in Branson.)

Once the dataset comes back from the data source, it’s nothing more than an ordered heap.  Performance-wise, datasets in Reporting Services behave a lotlike ASP.NET datasets.  If you return thousands of records in either one, then sort and/or filter them in the dataset rather than getting them pre-sorted/filtered, you’re wasting precious seconds.  Several seconds may not seem like a big deal, but to a user watching the spinning green circle, the difference between two seconds and ten is an eternity.  That said, if your report is interactive and the typical use case involves a lot of manipulation, it may be worth letting Reporting Services shuffle the dataset, rather than pounding the data source again and again with variations of the same data.  It depends.

If you’re trying to decide where the summation logic should go when designing a report, treat the Reporting Services like a little 2nd grader.  If you want it to count the items as it goes (RowCount), add them up as it goes (Sum), or tell you what item it just looked at (Previous), you’ll be just fine.  If you want something more complicated than that and your dataset is not insignificant in size, ask its older sibling — the database engine — to do the work.  Otherwise, you’ll likely see Report Server poop its performance pants when you check ExecutionLog2.

But then, what do I know?  I’m still not sure if I’m out of Craisins.

Filed Under: Reporting Services, T-SQL Tuesday

This Stuff Should Be Fun: Introduction

February 25, 2011 by Doug Lane

Playing with reports are a great way to learn Reporting Services. I use the word “playing” deliberately; working with reports and playing with them are two entirely different things. I spend all day working with reports. When I’m done or I need a break, I don’t want to work. I want to play.

I also really want to expand my knowledge of Reporting Services, especially when it comes to design. What better way to stay engaged than to pick reports I already like but don’t know how to make? I’m recreating some reports I’ve really enjoyed dating all the way back to my childhood.  (If you attended my SQL Saturday #66 session “Make It Fast, Make It Pretty”, you probably know what’s coming.)  I’ve replicated them as best I can using only images and the native capabilities of Reporting Services — i.e., no add-ins.  In the coming weeks, I’ll be presenting the recipes for these reports along with some insight I picked up while making them.  I hope you have as much fun learning from them as I have.

As a preview of coming attractions, I’ll introduce my first project: G.I. Joe file cards, circa 1986.

Original G.I. Joe File Card
Original G.I. Joe File Card
Recreated through BIDS
Recreated through BIDS

Stay tuned!

Filed Under: Reporting Services, Top Secret Recipes

SQL Saturday #66 Slide Deck

February 17, 2011 by Doug Lane

Here’s my slide deck from “Make It Fast, Make It Pretty”, presented at SQL Saturday #66. Take note, if you didn’t attend the presentation, a lot of these slides will not be meaningful.

Download the slide deck here.

Filed Under: Presenting, Reporting Services, SQL Saturday

SQL Saturday #66 Recap

February 15, 2011 by Doug Lane

Note: Since I attended SQL Saturday #66 as a speaker, I’ll write about my presenting experience in a separate post.  This post covers my experience at the event as a whole.

Last Saturday was the most fun I’ve had in quite a while.  I’m not sure how else to introduce it so I’ll get right to the details.

The Facilities

What a great place to have an event like SQL Saturday.  The CO Springs User Group who hosted the event wanted to turn up the networking to 11 and their choice of venue paid off big time.  In an ordinary, meeting-like setting, networking can feel forced.  People introduce themselves somewhat reluctantly, a few lines are exchanged about what they do and where they work, and then they move on.

At Mr. Biggs, we played laser tag together, drove go-karts together, and bowled together.  When we had to wait in line for laser tag, we all started networking naturally.  (If you really want people to talk to each other, make them wait in line together.)  I never imagined having this much fun at a SQL Saturday.

Speed Dating

Starting off the morning, we grouped into areas of interest such as DBA, dev, and BI.  Each group formed two circles, one inside the other, and the outer circle rotated around so that each person in the inner circle got to meet everyone in the outer circle.  We asked each other what we do and what our greatest accomplishment was in that arena.  One reason I really liked this was the three people I met (mine was a small circle) all ended up attending my presentation later.  Having met them made me a little more comfortable with my audience, and I knew if I wanted more interactivity, I could easily call on them by name.  One of the attendees, Sandra, asked me a question about Report Manager later in the day.  I don’t know if she would have done that had we not already met face to face.

The People: Speakers and Organizers

I was actually more nervous about the speakers & organizers dinner on Friday than I was the presentation on Saturday.  I am not well known in the SQL community, nor do I consider myself an expert at anything to do with SQL Server.  I have some experience with the product, and that’s about it.  Adding to my anxiety was my introverted nature; I don’t make conversation easily and I don’t always speak clearly.  In short, I was going to hang out with some of the giants of the SQL realm and I was pants-wetting terrified.

The best word I can think of is “overwhelmed”.  I was overwhelmed at how completely approachable, friendly, and down-to-earth everyone was.  Getting to know them took very little effort.  An hour after dinner, I was joking with Bill Fellows, taunting Jason Horner via Twitter, and bowling for Chris Shaw when he wasn’t looking.  (Chris had a score of seven after four frames, so I think I was doing him a favor.) The last time I had that much fun with complete strangers was summer camp in 1987 – I was 12 years old.

I’ve seen a lot of gushing on Twitter (and blogs now, too) about how great a job the organizers and volunteers did with this SQL Saturday.  It’s not hyperbole.  Chris, Kat, Andrew, Rebecca, and everyone else who gave their time and energy to put on a great event deserve all the credit they’ve gotten and then some.  Kat even had our speaker evaluations back to us on Monday.  Outstanding work by all of them.

The People: Attendees

The people who came out to hear what we speakers had to say were delightful.  They were friendly, respectful (I don’t remember a single person walking out on a session in progress), and genuinely interested in what the speakers had to say.  Also, some of them must’ve been snipers in the military; at laser tag, I got shot in the back more times than I can count.

I offer a heartfelt thanks to all who sat in on my session.  You were my first audience and you were polite, engaged, and some of you even took notes (the ultimate compliment, in my opinion).  Thank you.

The Presentations

I had a hard time choosing which sessions to go to because, even though I’m a BI developer, they all looked intriguing and useful.  Credit to both the presenters and the organizers for making SQL Saturday #66 burst at the seams with valuable content.  The sessions I did sit in on were:

  • Chris Randall’s “Beyond BIDS” – Caring for and Feeding a SQL Server BI Solution: So much good information, so little time.  I’ll be glad I attended when it’s time to re-deploy my SSAS projects.
  • Bill Pearson’s Becoming DAX: An Introduction: An easy-going intro session for people who don’t do much with DAX or PowerPivot (like me).
  • Mark Halstead’s SQL Server Performance Tuning: Good real-world advice about what counters really matter.
  •  TJ Belt’s Documentation. You know you love it: Got to see some nice templates and hear tales of documentation heroism.

Bill Pearson had a hilarious line to open his Becoming DAX presentation: “This venue is awkward, because legally I’m not allowed within 200 feet of children.”

The Best Part

I have no less than fourteen people I now consider friends:

Bill Fellows (billinkc on Twitter)
Chris Randall (cfrandall)
Chris Shaw (SQLShaw)
Gabriel Villa (extofer)
Jason Horner (jasonhorner)
Kat Meadows (KatSQL)
Kevin Krueger (kevinkrueger)
Marc Beacom (marcbeacom)
Meredith Ryan-Smith (coffeegrl)
Randy Knight (randy_knight)
Rebecca Mitchell (SQLPrincess)
TJ Belt (tjaybelt)
Bill Pearson (Bill_Pearson)
Steve Jones (way0utwest)

The speaker/organizer functions before and after the event gave me considerably more time to get to know them than if I had just attended on Saturday.  This alone makes me think I should be volunteering at SQL Saturdays (or other events) where I’m not speaking.  I hope to see all my new friends – as well as those I met but didn’t get to know – at another SQL Saturday soon.

And so…

What more can I say?  Great people, great place, great experience.  This event was beyond memorable for me; it was unforgettable.

Update (2/15/10):  Kat Meadows is back on Twitter.  I’ve added her Twitter handle in the list above.

Filed Under: SQL Saturday

I’m bringing sexy back [to my reports]

January 21, 2011 by Doug Lane

Socks + Sandals
Wrong in so many ways

I’m generally ashamed of my wardrobe from 1997-2004.  Socks with sandals, too-short golf shorts.  Oh, it was heinous.  I found the cure to bad style was simply to pay more attention to what looks good on others, and start wearing more of that.  Much like my fashion sense, my sense of style for reports has evolved over the years into something a little more sophisticated.  I take almost as much pride in a report or web page that looks clean as I do one that runs clean.  Through lots trial and error — mostly error, it seems — I’ve found a few schemes that work well.  I want to share the schemes I use, along with the code to implement them.

I like these because with only one hue (or is it tint? See, I told you I’m not a graphic designer) you can use other colors to draw attention to important information, a la Stephen Few.  I prefer greens and blues (I dress the same way — shocking) because they’re unprovocative and people seem to prefer them over warm tones in reports.

Blue

#DEF1FA
Highlight row/column
#BCD7E4
Header/Footer
#9AC2D6 #6FA4BF #437C99

Green

#EAF8D2
Highlight row/column
#D7E4BC
Header/Footer
#C2D69A #A4BF6F #688038

I rarely use the last darkest two colors in the scheme because black text starts to blend into the background, especially when it’s printed using color laser.  It’s better to use white text on the darkest one.  The lightest three colors are best for header/footer rows and sub-total/total columns in a table.

Note I’m using HTML color codes, not .Net named colors.  I’ll elaborate on that in a separate post some other time, but for now, I’ll just mention it involves Find & Replace in Visual Studio.

The sets of five are also good for illustrating depth or degrees of severity, like a heatmap. Here’s an example where Thursday has a lot of something and Wednesday has a little: 

Heat Map Color Scheme

If you want to plug them into a chart, just add an expression like this one to the Fill attribute in the series properties of the chart:

=IIf(Fields!val.Value < .2, “#DEF1FA”,
IIf(Fields!val.Value < .4, “#BCD7E4”,
IIf(Fields!val.Value < .6, “#9AC2D6”,
IIf(Fields!val.Value < .8, “#6FA4BF”,
IIf(Fields!val.Value >= .8, “#437C99”, “Black”)))))

And there you have it.  Style being a matter of individual taste, these themes don’t appeal to everyone.  That said, of all the themes I’ve come up with so far, these have been the most popular with my customers.  I hope you find them useful too.

Filed Under: Reporting Services

  • « Previous Page
  • 1
  • …
  • 5
  • 6
  • 7
  • 8
  • Next Page »

Subscribe now!

Don't miss new posts as they publish. Enter your e-mail address to subscribe!

Your e-mail address will stay quietly between us, like that time I set the carpet on fire by accident.

Copyright © 2025 · Outreach Pro on Genesis Framework · WordPress · Log in