-
Process Explorer is an excellent replacement for the default Windows Task Manager. Process Explorer even automates this change via Options –> Replace Task Manager. However, by default, this won’t launch Process Explorer elevated. You can force it to run elevated by changing the registry (of course, the usual edit-the-registry-at-your-own-risk disclaimers apply).
Under
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe
append “/e” to the text for the value Debugger.
“<your path>\Procexp.exe” /e
If Process Explorer is running, close it explicitly via File –> Exit. Next time you launch it (which I always do via Ctrl-Shift-Esc), it will run elevated.
-
You can launch any item shown in the Windows Start menu elevated by highlighting the item and either right-clicking and choosing Run as Administrator, or hitting Ctrl-Shift-Enter. Note that this does not work when launching items from the Run window (Win-R).
-
It’s not obvious unless you are looking for it, but you can change the width of the horizontal scroll bar in Excel. On the left-hand side of the scroll bar there is an anchor you can use to resize.
Can become
This can be very useful in a workbook with lots of sheets or for wide sheets where you do a lot of scrolling.
-
For workbooks that contain more than one category of worksheet, you can use color to add visual distinction to the worksheet tabs along the bottom of the Excel window. Right-click on the worksheet tab to bring up the dialog:
Your tabs are now colorful:

-
Excel can help you understand or troubleshoot cell references by identifying the cells dependent upon the selected cell and those that the selected cell depends upon.
One way to accomplish this is via the Go To Special dialog. It can be launched from the Find & Select menu of the Editing group in the Home tab.
To demonstrate how this works, let’s create a simple worksheet:
Select cell A3 and bring up the Go To Special dialog:
Choose Precedents and Direct Only and click OK. This will select all cells directly dependent upon a the selected cell. Since A3 was selected before opening the dialog, cell A2 will be selected after hitting OK. To extend the search to all ancestors of the selected cell, choose All Levels instead of Direct Only. Selecting A3 before the dialog will now select A1 and A2 after hitting OK. A1 is added since A1 depends on A2 which depends on the selected cell A3.
Dependencies work the same way. Select A1 and choose Dependents and Direct Only in the Go To Special dialog. You’ll see A2 selected when you hit OK since A2 directly depends upon A1. Choose Dependents and All Levels and both A2 and A3 will be selected when you hit OK since A3 depends on A2 which depends on A1.
Note that since the effect of these actions may select multiple cells, the auto calculation data in the Excel status bar is populated:

-
Excel can help you understand or troubleshoot cell references by identifying the cells dependent upon the selected cell and those that the selected cell depends upon.
One method for doing this is via the Formula Auditing group in the Formulas tab.
Let’s start by creating a simple worksheet:
Select A3 then click the Trace Precedents button once. You’ll see an arrow going from A2 to A3 indicating A3 depends upon A2. Click the Trace Precedents button again and you’ll see another arrow from A1 to A2 since A2 depends on A1. Click on Remove Arrows to clear the arrows.
Finding dependents works the same way. Select A1 and click Trace Dependents once. An arrow will appear going from A1 to A2 since A2 depends upon A1. Click Trace Dependents again and another arrow will go from A2 to A3 since A3 depends upon A2. Click on Remove Arrows to clear the arrows.

-
There is currently a bug in our SQL Server 2005 PDF renderer which may cause it to generate incorrect glyphs for text in a complex left-to-right script. The reason this occurs is that we need to embed font glyph indices and metric information into the PDF document. For text in a right-to-left complex script, we get this information from the Uniscribe API which knows all about combining and morphing characters into glyphs. For everything else, we use GDI methods which do not understand how to handle complex scripts. For an example of the problem, look at the following Gujarati script as it appears in HTML (correct) and PDF (incorrect):
I am working on a fix for both our SQL Server 2005 and upcoming SQL Server 2008 PDF renderers. If you have text that is affected by this bug, please email me with details (an RDL containing the problematic strings is preferred) to help us be sure the fix we implement is complete. You can find my email address on my About page.
Thank you.
-
The latest SQL Server 2005 SP2 Cumulative Update (CU4) is now available. You can get it by calling into customer support or by making an online request.
There are two fixes in the feature areas I own that are included in this update:
(Bug ID 50001816) When you export a SQL Server 2005 Reporting Services report to a .pdf file, blank pages are added.
Our pagination logic would sometimes incorrectly push items inside a table to the next page which, under the right circumstances, would cause a blank page to appear.
Note that this bug would only cause blank pages to appear intermittently in PDF. If you are seeing consistent blank pages, first check to make sure that: body width + page left margin + page right margin < page width.
(Bug ID 50001498) Text in a text box with vertical text in a RTL layout faces the wrong direction.
Right-to-left (including bidi) text will not display with the correct word order when the writing-mode property of a textbox is set to tb-rl. This affects the image renderer (which includes printing) in addition to the win and webforms controls. The sister issue is bug ID 50001488 - FIX: A SQL Server 2005 Reporting Services report that uses the Right-to-Left (RTL) layout displays incorrectly in Internet Explorer 7.
Note that the fix included in CU4 does not contain updates to the controls themselves so if you are using the controls in local mode and hitting this issue, you will need to wait for the next update from our developer division.
This was an interesting bug that came about as a result of a customer working around a limitation in our product. In our 2005 release, we do not support the direction property on chart axis titles. The work-around is to use textboxes placed outside the chart that have direction set. This bug (and its sister) were discovered when we tried to implement the work-around.
-
Querying Reporting Services for a report couldn't be easier with Url Access (http://msdn2.microsoft.com/en-us/library/ms153586.aspx). For example:
String report = "/Folder/Report";
String filename = "Report.pdf";
List<KeyValuePair<String, String>> parameters =
new List<KeyValuePair<String, String>>();
parameters.Add(new KeyValuePair<String, String>("Param1", "Value1"));
parameters.Add(new KeyValuePair<String, String>("Param2:isnull", "true"));
System.Net.WebClient client = new System.Net.WebClient();
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
String url = "http://localhost/reportserver?" +
report + "&rs:Command=Render&rs:Format=PDF";
foreach (KeyValuePair<String, String> parameter in parameters)
url += "&" + parameter.Key + "=" + parameter.Value;
client.DownloadFile(new Uri(url), filename);
-
I am in the process of documenting the way my Katmai unit tests work. There’s nothing inventive about them – they are straightforward and meant to get the job done. I use the VSTS unit runner which works though not particularly well. I do not go through the machinations of using and keeping up to date the VSTS method of accessing private/internal type members. Instead, I use partial classes as described below. I also use mock objects to make things easy that would otherwise be difficult to test, for instance doing away with having to maintain “baseline” TIFF files that describe the correct rendering of a given report. Attempting to maintain bit-perfect baselines is generally an exercise in frustration – mock objects are so much better in a majority of cases.
My two primary frustrations with unit testing using the built-in VSTS infrastructure is how slow the runner is and how painful it is to run a single test or group of tests. VSTS Orcas is making great headway on both of these issues and I’m willing to slog it out in VS2005 a while longer until Orcas RTMs.
The way the Katmai image-based renderers work is fairly straightforward. There is a Renderer class which walks a report layout tree and sends commands to a writer class. There are currently 3 writer classes in this assembly – one for compatibility with the WinForms control we shipped in Visual Studio 2005, one for PDF, and one for images (TIFF, EMF-printing, JPG, etc). The writer classes accept basic commands (start a new page, draw a line, write some text) and translates them into format-specific output.
Taking the following example ImageWriter class:
internal partial sealed class ImageWriter
{
private Graphics m_graphics;
internal void DrawString(...);
}
When the Renderer class comes to a textbox, it calls into ImageWriter.DrawString, passing in font, color, and text information. DrawString then calls into System.Drawing.Graphics.DrawString via the m_graphics member.
To test this interaction, since the class is internal to the ImageRenderer assembly, I need to add the source file containing the ImageWriter class directly into my VSTS test project. Now I can write a test that mimics the Renderer call into the writer:
[TestMethod]
public void Test_DrawString()
{
Renderer renderer = new Renderer();
renderer.ImageWriter.DrawString(new Font("Arial", 10f), Color.Black,
"Test String",
new RectangleF(0f, 0f, 10f, 10f));
}
To verify that ImageWriter is indeed calling Graphics.DrawString, we can use a simple mock Graphics object.
internal sealed class Graphics
{
internal Queue<MethodInvocation> MethodInvocations;
~Graphics()
{
Dispose();
}
public void Dispose()
{
if (MethodInvocations!= null)
{
Assert.AreEqual<Int32>(0, MethodInvocations.Count,
"Not all expected methods were invoked");
MethodInvocations = null;
}
}
internal override void DrawString(Font font, Color color,
String string, RectangleF position)
{
Assert.IsNotNull(MethodInvocations);
MethodInvocation method = MethodInvocations.Dequeue();
MethodInvocation.VerifyMethodInvocationsAreEqual(method,
new MethodInvocation(new Object[]
{ font, color, string, position }));
}
}
The MethodInvocation class stores the method name and parameters for a particular invocation. The static VerifyMethodInvocationsAreEqual method takes two MethodInvocation objects and does a deep comparison of them.
Getting access to the private Graphics object is where partial classes come in. My main ImageWriter class is tagged partial so I can extend it in my unit test source file and wrap access to private members:
internal sealed partial class ImageWriter
{
internal Graphics Test_m_graphics
{
get { return m_graphics; }
set { m_graphics = value; }
}
}
Updating the test method to use this wrapper and the mock object is now easy:
[TestMethod]
public void Test_DrawString()
{
Renderer renderer = new Renderer();
using(Graphics graphics = new Graphics())
{
renderer.Test_m_graphics = graphics;
Queue<MethodInvocation> methodList =
new Queue<MethodInvocation>();
methodList.Enqueue(new MethodInvocation("DrawString",
new Object[]
{ new Font("Arial", 10f), Color.Black, "Test String",
new RectangleF(0f, 0f, 10f, 10f) }));
renderer.Graphics.MethodInvocations = methodList;
renderer.ImageWriter.DrawString(new Font("Arial", 10f), Color.Black,
"Test String",
new RectangleF(0f, 0f, 10f, 10f));
}
}
Test methods like this are easy to create and easy to understand. The biggest downside I see is that the assert phase of the AAA pattern is not immediately obvious, especially to someone not used to the C# using () statement. With that caveat, however, I like the way this flows and it just feels natural to me. And I think that’s the key to unit testing. It has to be easy to do, easy to maintain and fit naturally into your development style. If not, it will languish and become useless. Stale tests that either don’t compile or, worse yet, give false positives, are worse than no tests at all.
-
I was experimenting with using PowerPoint to create self-guided training material and discovered the ability to custom slide shows. I don't know a whole lot about creating sophisticated PowerPoint decks, but this is a pretty nifty technique that is simple to apply. It allows PowerPoint shows to contain a rudimentary branching effect.
If we think of the flow through our deck as a graph:
We can mark a certain set of slides as defining a custom slide show. For the above diagram, we would create the "Equation" branch and the "Describe" branch as well as a branch per "Learning Style". Do this by:

And create your new slide shows by selecting the appropriate set of slides from your current deck:
Next, go to each page where branching is possible, choose the text you want to launch the slide show, and add an action for it:
Be sure and check the Show and Return box when choosing a custom show action. If you don't the slide show will end as soon as the current branch is done.
If there is more than one level of branching is used, use breadcrumbs to let learners keep track of where they are and how to get back in case they want to change one of their choices or go down more than one path. Here I placed them in the page footers:
This is an interesting technique but it certainly has some rough edges. For the trainer's part, keeping all the links updated is a pain for larger decks. Putting links in footer text is a page-by-page endeavor as far as I can tell.
It is possible to define the action of a click to be opening another PowerPoint file. This might make maintenance of larger decks easier, though I'm not sure how well breadcrumbs would work. It would also make shared slides more difficult to maintain.
-
A week or so ago, I finally upgraded my home wireless network to 54MBit/s via 802.11g. A bit of research led me to choose a Linksys WRT54GL v1.1 router. The stock firmware didn't support some of the features I wanted (like using DHCP to assign static IPs based upon MAC address) but there are several third party open source firmware projects for the WRT54GL and it was fairly easy to find a stable firmware with support for the feature set I wanted. I ended up going with DD-WRT because of its features, available documentation, and activity level of their forums.
I did come across two gotchas, however:
First, I have internet phone service through Comcast and the Arris phone/cable modem they supply locks on to a particular MAC address. After I unplugged it from my previous router, I had to power cycle the modem before I could use the internet.
Second, I was having a problem where after several hours the router seemed to go off into never-never land. Browsing the internet or even trying to bring up the router administration pages timed out until I reset the router. Turns out I was using up all of the active IP connections buffer. Bumping the buffer from 512 connections to the max of 4096 cleared up the issue. To help keep the buffer cleaner, I also decreased the TCP and UDP timeouts.
Putting those gotchas behind me, the router is working like a champ and should easily last me until it's time to upgrade to 802.11n.
-
Another useful but hard to discover feature of Vista's Windows Explorer is the ability to shift-right-click on a folder and launch a command window at that path:
Note that this trick only works in the viewing pane and not in the tree view.
-
Useful but hard to discover feature in Vista. To copy a filename with full path information to the clipboard, shift-right-click on a file and choose Copy as Path. For example:
Copies the following to my clipboard:
"C:\dump\Reports\10435.rdl"
-
This is a continuation of my work on FAQ for the PDF renderer. A compiled version of these postings will will live at http://blogs.msdn.com/donovans/pages/reporting-services-pdf-renderer-faq.aspx.
File Size
Why are the PDFs exported from the Win/WebForms control so large?
Compression of the PDF document is not supported in Visual Studio 2005 WinForms or WebForms controls running in local mode. When these controls run in server mode, this limitation is not present and the server will compress the PDF files.
The controls that will ship with Visual Studio 2008 will not have this limitation, however they will not be able to compress as well as PDF files generated on the server. These controls will make use of the .NET System.IO.Compression classes which are not as efficient as the native compression libraries the server uses.
I'm not using the controls in local mode and my PDFs are still big. Why?
If your PDF contains charts or PNG images, those images may be translated into bitmaps before being added to the PDF file. Although this bitmap data will be recompressed, it will not be as space efficient as the original image. To avoid this translation, use JPEG images or PNG files of color type 3 (PNG color type information can be found at http://en.wikipedia.org/wiki/PNG).
Prior to Reporting Services 2005 SP1, PNG images of additional color types were allowed. Unfortunately, in order to fix a bug causing some PNGs to appear corrupted when rendered to PDF we needed to add the color type restriction. Even more unfortunate is the fact that charts are sent to the PDF renderer as non-color type 3 PNGs of high DPI. This is certainly a limitation we want to remove in the future but very unlikely it will be fixed in Reporting Services 2005.