Upcoming Reporting Services SP1

Monday, May 31, 2004 by scott
2 comments

In a posting to microsoft.public.sqlserver.reportingsvcs, Brian Welcker released some details on the upcoming SP1 for Reporting Services. The SP is currently on track for release in the second half of June. In addition to bug fixes, and performance / scalability improvements, major changes include:

  • Excel rendering extension has been improved and now supports viewing in earlier releases of Excel.
  • PDF rendering extension is more robust and has better matrix rendering performance.
  • Chart control provides more control over display styles.
  • References to external URLs (images and resources) from within a report are now supported.
  • Data caching behavior for report preview.
  • NewLine in expressions is now supported.
  • The style of the HTML Viewer toolbar can now be modified through a style sheet.
  • New URL parameters offer more options for customizing report presentation at run time.
  • Report Manager proxy persists authentication cookies so that they can be used by custom security extensions.
  • Hidden parameters are now supported.
  • Temporary snapshots can be compressed as well as stored on the file system.
  • Integrated security support for accessing report data sources can be disabled.
  • Report hyperlinks can now contain any protocol identifier.

New Book

Monday, May 31, 2004 by scott
0 comments

As Scott Mitchell points out, the royalties from a technical book shouldn’t figure into your retirement plans. Nevertheless, I went down this road (again) and co-authored a book featuring the ASP.NET Community Starter Kit.

Last summer I was debating if I should take on this assignment or not and looking at the CSK code. I’d have to say the CSK kept growing on me. Unlike the other starter kits the CSK implements advanced features, and it took a bit of tinkering and spelunking to grok all the concepts. I also grew fond of the code because in 1999 I was working on an application doing URL-rewriting and “themeing” the hard way (using C++ ISAPI filters), and I was truly appreciating the elegance .NET was bringing to the application.

When the “A-ha!” moments started to happen and all of the CSK code started to click, I decided I wanted to write the book. While I was knee deep in weekend writing, I decided I not only wanted to write a book about the CSK, I wanted to launch a website using the CSK. Although there are already 1,001 great technical sites on the web, this one would have my stamp on it (for better or worse). With the help of a great friend and colleague, the CSK (with some customizations) became the software for OdeToCode.

The site made it online well before the book did. I just received my copies last week. Even now after I’ve read Scott’s blog about the soft market, and DonXML’s post about the advantages of self-publishing, I’m still happy with the decision. I learned quite a bit during the experience and now have two pieces of work to show for it.

Funny aside: when trying to come up with a name for the site we used the Internet Anagram Server to produce words from the letters in our names (Poonam and Scott). One phrase it kept spitting back was Potomac Snot, which was tempting being as we are near the Potomac river, but she (ok, we) decided it wasn’t the best name for a technical web site. We reserve the right to use this name as a company name for local consulting gigs.

Nullable?

Friday, May 28, 2004 by scott
0 comments

I’m just not sure I like the nullable type syntax in C# 2.0. Every time I see the shortcut syntax for a nullable type, I cringe a bit.

int? i = 2112; // cringe

The first thought that struck me when I saw this was that C# language now has some decent material for obfuscation contents. C obfuscation contests have been around awhile, and tools like the preprocessor give C programmers plenty of material to work with. For example, I’d never be able to look at this source code and guess that when compiled it plays a game of adventure. It’s both repulsive and fascinating at the same time.

I tried to get comfortable with the new syntax in the May CTP, but I keep getting compiler errors on simple examples:

int? x = 125;
int? y = 33;
int? z = x + y;

Error: "Operator '+' cannot be applied to operands of type 'System.Nullable' and 'System.Nullable'"

I’m thinking nullable type support hasn’t completely made it. The null coalescing operator ( ?? ) doesn’t appear to work yet either:

   int? x = null;
   int? y = 15;
   int? z = x ?? y; //cringe

"Operator '??' cannot be applied to operands of type 'System.Nullable' and 'System.Nullable'"

Then I thought I’d have some fun and try to see what I could break (warning, this is really vulgar):

  using c = System.Console;
  class P
  {
 
    delegate int?? p();
    delegate int? u(int?? x);
    delegate int u2(int?? x);
 
    static void Main(string[] args)
    {
      int?? j = new int??(1);
      int? k = null;
      int i = new int();
 
      p p; p = delegate { c.WriteLine(i); return new int??(new int?(i)); };      
      u u; u = delegate(int?? x) { return x.Value; };
      u2 u2; u2 = delegate(int?? x) { return u(x).Value; };
      do
      {
        i = i + u2(j);
      } while (u(p()).Value > 9 ? false : true);
    }
  }

But, the above executes and prints integers from 1 to 10. I was hoping for fireworks.

I’m still not comfortable with the new syntax, but it looks like I’ll have to wait till the next release to give it a more serious try. I’m surprised nullable types appeared so late in the cycle. Changes like this should come around early and entertain plenty of discussions and flame wars. I’m hoping it doesn’t come out feeling like a bolted-on solution that we have to live with for years.

Ooh, this just in. I have definite problems using MSDN help in the CTP, but RobCaron has the solution. Thank you, thank you, thank you, Rob.

.Text Threading Bug

Thursday, May 27, 2004 by scott
1 comment

If you are one of the 7 regular readers here you might have noticed some problems over the last few weeks. Every so often .Text would display an error page with the message: “Value cannot be null. Parameter name: value”. Once the error happened it would stick around until the application restarted. Unfortunately, the error was appearing everyday. After asking around on some of the boards to no avail I did some sleuthing.

In .Text 0.95 the Stats class has the following method:

public static bool AddQuedStats(EntryView ev)
{
    //Check for the limit
    if(queuedStatsList.Count >= queuedAllowCount)
    {
        //aquire the lock
        lock(queuedStatsList.SyncRoot)
        {
            //make sure the pool queue was not cleared during a wait for the lock
            if(queuedStatsList.Count >= queuedAllowCount)
            {
                EntryView[] eva = new EntryView[queuedStatsList.Count];
                queuedStatsList.CopyTo(eva,0);
 
                ClearTrackEntryQueue(new EntryViewCollection(eva));
                queuedStatsList.Clear();            
            }
        }
    }
    queuedStatsList.Add(ev);
    return true;
}

The first highlighted method is in the call stack when the exception is thrown, but like any good threading bug the problem actually begins somewhere else: queuedStatsList.Add. The Add method is not thread safe and the collection eventually corrupts with a null reference appearing in a slot where an EntryView object reference should be. The EntryViewCollection ctor barfs when it tries to copy the null reference. Because the application can never clear the queue the exception keeps occurring until reset. I only checked 0.96 briefly, but it looks like the problem still exists. If you are running into this problem, one fix is to change the code and move the Add inside of the lock scope (and skip the double check locking):

public static bool AddQuedStats(EntryView ev)
{
    //aquire the lock
    lock(queuedStatsList.SyncRoot)
    {
        if(queuedStatsList.Count >= queuedAllowCount)
        {
            EntryView[] eva = new EntryView[queuedStatsList.Count];
            queuedStatsList.CopyTo(eva,0);
            ClearTrackEntryQueue(new EntryViewCollection(eva));
            queuedStatsList.Clear();         
            
        }
        queuedStatsList.Add(ev);
    }
    return true;
}

If you are having this problem and don’t want to recompile the application, set queueStats=”false” in the Tracking section of web.config.

It seems like I am the only one who was having this problem, which is odd because I certainly don’t have the same number of concurrent users as, say, blogs.msdn.com, but that’s multithreading for you.

I do want to say thanks to ScottW for all his .Text work, hopefully this will add just a little bit of improvement to some great software.

VS 2005 CTP March 2004

Wednesday, May 26, 2004 by scott
0 comments

I’ve been working with the CTP to put together an article for ASPToday. Along the way I’ve kept some notes. Since the version I’ve been working with is now obsolete, I thought I should post these notes before they become too obsolete also.

  • The intellisense features are just too good. My cat even loves intellisense. Her name is Beaker. She occasionally lumbers across the keyboard producing random characters and compiler errors, but with the May build I wouldn’t be surprised if she paws out the source to a CLI compliant “Hello World” program. Thanks to Cyrus and the rest of his team for making this work so well.
  • One request – I didn’t have intellisense or the ability to ‘format document’ in a web.sitemap file. I imagine this is only a matter of time.
  • One more request to consider: when I auto-complete on a method override, the default is to give me a stub method like so:

             {
                  throw new NotImplementedException();
              }

Would it be possible to give me a stub method that forwards the call to the base class with the parameters? This would seem like a more useful stub to build on.

  • Last comment about the editor (honest!). I find the bold class names a bit distracting, as well as the squares that appear around matching delimiters. I lose track of the insertion point when the magic squares appear and start hitting the arrow buttons until they go away.
  • There used to be a “Set As Start Page” option in the context menu for a web form in the solution explorer window, but there is not in the CTP. Hopefully this is just a temporary omission as it’s a nice way to avoid an extra navigation step when starting the debugger.
  • Please don’t change the shortcut keys. It took me months to stop pressing F7 after moving from 6.0 to NET.
  • The data visualizations are coming along very well.

I’m wondering how well the CTPs are working for Microsoft. Are they getting the early and useful feedback they were hoping for? Most of the comments on JRoxe’s request for feedback post seem to be of the “yes I’m using it” type.

Now ... on to the May 2004 CTP.

TechEd TechEd Blah Blah Blah

Tuesday, May 25, 2004 by scott
0 comments
I don’t have any news to report from TechEd, because I’m not there. I’m not bitter about it though. I’m very happy here in the humidity of Mid-Atlantic USA. I’m very happy walking outside and not being able to hear myself think over the roar of the brood X cicada. I’d say I get a certain amount of glee when swarms of them bash into my windshield like hail pellets in a heavy storm, but you might think I’m some sort of deranged entomophobic who would rather be at TechEd. I don’t want to give you that impression.

I’m glad I’m avoiding the sore feet, the junk food, the airports, the jockeying for position at an AC power source, and being herded like an animal to feeding troughs for lunch.

That’s what I keep telling myself anyway.

Embedded Code In Reporting Services

Monday, May 24, 2004 by scott
0 comments

If you’ve ever wondered just what you can do with the Code property of a report, this article serves as an introduction.

by K. Scott Allen K.Scott Allen
My Pluralsight Courses
The Podcast!