Category Archives: Tools

Visual Studio 2010 RC and Crystal Reports 2008 – Just Works

I have Crystal Reports 2008. This is the full application, not the Crystal Reports extension embedded into Visual Studio.

This morning I pulled a solution with many projects and many crystal report files into Visual Studio 2010 for the first time. This application originated in VS2003, migrated to VS2005/.NET 2.0, migrated again to VS2008 (still .NET 2.0) and now migrated to VS2010 (still .NET 2.0). Wow everything is SO much faster working with this solution in VS2010. It loads up so quickly. It builds quickly. Hooray. This is exactly why I wanted to ditch VS2008.

I know that Crystal Reports for Visual Studio is no longer embedded in VS2010 (see my earlier blog post Crystal Reports and Visual Studio 2010) but there is an extension you can easily install. I haven’t installed that yet on this machine.

Now it was time to see what happens with my reports.

It was easy. I double clicked on a report in Solution Explorer. The result was that Crystal Reports 2008 started up and the report opened up in that designer.

No fuss no muss. Thank goodness. I’ve been using Crystal Reports for, I dunno, 15 years or so and every time there’s some type of upgrade, it’s been disastrous. But I wasn’t really upgrading the Crystal Reports app, just Visual Studio this time. SO it was 100% painless.

I did have one problem at runtime because I had forgotten that on  my 64bit machine, I needed to target x86 when building. Luckily I wrote about this in an article for ASPAlliance last year (Lessons Learned: Sorting out Crystal Reports 2008 Versioning, Service Packs and Deployment). Unfortunately I wasted a few hours wrestling with this problem again before I cam to this realization.

VS2010 Gotcha: Inadvertently targeting the wrong framework

I love VS2010’s multi-framework targeting feature, yet it has bitten me in the rear-end more than once.

The problem is that I have created projects in .NET 3.5 without realizing it, then at some point, when something doesn’t work as expected, if I’m lucky I discover the mistake.

Typically, this happens after you have explicitly chosen .NET 3.5 as the target framework. Then every project after that will be .NET 3.5 until you explicitly choose .NET 4.0 again.

This morning that wasn’t the case. I was workign with a brand new installation of VS2010 RC and created a new class library then added to it an entity data model.

All of the features worked as expected except that I couldn’t generate a new code generation item.

Finally when I created a console app and attempted to add a reference to System.Data.Entity, I noticed that I was only seeing 3.0 and 3.5 versions of assemblies in the Add Reference dialog and realized my mistake (of creating the .NET 3.5 project).

This was in the middle of recording a session of DNRTV so turns out to be a really good lesson for viewers.

But I sure wish Visual Studio 2010 would warn me when I am creating a non .NET 4.0 project.

Installing Visual Studio 2010 RC from a Virtual DVD?

I got bit when installing the VS2010 RC and it cost me a few hours of aggravation. Here’s why.

I use Daemon Tools to mount ISOs to a virtual DVD. I have a Windows 7 machine and am using a new installation of Daemon. By default, Daemon’s auto-mount feature is turned off. I didn’t realize this.

During the installation, the installer needs to reboot. When it rebooted, it didn’t find the DVD and I scrambled to re-attach the ISO file while the installer was attempting to continue setup.

I thought I got it covered, but in the end I had the following error:

rcinstall

What a slap in the face. No Entity Framework tools out of everything in VS that could have been left out! LOL. Well, I do need those.

I tried repairing the installation two times but still the tools did not install.

I finally decided to just uninstall and reinstall but this time I would be smart and burn the darned DVD.

Wouldn’t you know, my brand new DVD writer wasn’t being recognized.

So as a last resort, I used WinRAR to unzipped the ISO file onto my hard drive and I was then able to install directly from the files.

The installation went perfectly. And because I had uninstalled VS2010 but not .NET 4, the reboot was unnecessary.

Since then I have heard from many people that they had no installation problems when using Virtual CloneDrive.

Some Visual Studio tips I picked up recently

Earlier this month, Rob Hale presented at the Vermont.NET User Group on what he learned at PDC. There was a lot of great information; but oddly, two tiny little Visual Studio features stood out for me.

One is not even new to VS2010.

Recent Project Tricks on Start Page

There are a zillion new productivity features in VS2010 but this one had escaped me (and surely a few thousand others as well).

In VS2008, I modified my startup settings so that I didn’t have to look at the start page. I will absolutely leave it in place in VS2010.

I really like the way the recent projects are displayed on the VS2010 Start Page, but did you know that you can control how those projects are displayed?

You can PIN projects that you want to stay on the start page and unpin them when they are  no longer necessary.

Just by hovering your mouse over to the space to the left of the project, the pin will appear and you can click it to pin the project down.

 

 

image

 

image

You can also remove projects from the list and open their containing folder right from the start page.

image

Block Selection in Code Editor

Another IDE trick Rob showed us is not even new to VS2010 – block selection – which can be used vertically.

If you hold down the alt key while dragging your mouse across and down, you can highlight text vertically.

Rob pointed out a useful example.

Say you have some repeated code, such as instantiating some objects with values, but you need to change something

Here, I have used ALT and dragged down in front of the F of FirstName. Notice the faint blue line. I could drag across and highlight text in a column if I wanted also.

image

Now I start typing to add in the ModifiedDate property.

image

Whatever I type is mirrored in all of the rows of my selected block. Really cool.

Recent Project Templates

Matt Kleinwaks brought this one up on a listserv today and I was again, surprised. This one is new to VS2010 but I had overlooked it.

Visual Studio remembers which project templates you have used recently and make it easy for you to select them.

I’ve never paid attention to the Recent Templates section much less ever clicked on it an opened it up. Matt wrote up a quick blog post about it this morning, so I’ll just point you over there if you need your eyes opened to this little feature: Avoid Template Overload in VS2010

So many tips & tricks

I have a few of the wonderful VS Tips & Tricks books written by various authors. Maybe I should place them on the kitchen counter and make a habit learn new tricks while I’m eating breakfast or lunch.

Publish Powerpoint to Word to add notes to handouts

I’m in SHOCK. I just learned about this option that I’ve always wanted in poweropint.

When I present I always print out a set of 3 per page handouts then write notes to myself about demos in the area to the right.

I often lose or throw away my notes and kick myself next time I want to do the presentation.

I came across Tip #2448 – Creating Custom PowerPoint Handouts in MS Word  on the web when I finally entered the right combination of words in google and realized that the functino exists RIGHT IN Powerpoint. In Powerpoint 2007 it’s in the Publish menu.

More goodies for Developers in SQL Server 2008

A few days ago I wrote that I had learned about some of the new goodies in SQL Server 2008 that would be of interest to developers after watching Rick Dyess’ video, What about Developers? SQL Server 2008 and the Development Environment”

It must have been a busy day last December when another similarly enlightening email arrived in my inbox. Michael Campbell wrote a post for .NET Briefing entitled “SQL Server 2008: What’s New for Developers?”

Surprisingly there’s only a small overlap between the features that Rick highlights and those which Michael highlights, which means I get to learn more stuff! 🙂

While I have this in my inbox, I can’t find the post anywhere on the originating blog on the WindowsDevPro website, so I’ll highlight the things Michael wrote about:

The MERGE statement in t-sql lets you provide data for the database without having to predetermine if it’s an insert or an update. Today you first have to query to see if the primary key exists or not. If not, do an Insert, otherwise do an update. Very cool.

Table-Valued parameters lets you pass shaped data as parameters to a stored procedure. Cool again, or as Michaeal calls it, “wicked”.

While Rick also talked about the HierarchyID, Michael pointed out something interesting about it: What’s cool, or interesting, about this data type though, is that it’s an intrinsic CLR data-type – meaning that Microsoft is starting to leverage Common Language Runtime functionality natively. I wonder what other CLR additions we’ll see in the future.”

Intellisense, though I’m already a big fan of Red-Gate’s SQL Prompt, which constantly saves me from having to go poke around tables that I haven’t worked with in eons before I start building my queries, not to mention the help wiht operators and functions. I wonder how the built in Intellisense compares?

GROUPING SETS which work with teh GROUP BY clause to simplify grouping that you might otherwise perform by using a UNION ALL clause on a bunch of GROUP BY clauses.

XXL User Defined Data Types (the XXL is my term, not official). UDDTs can exceed 8000 bytes.

Thanks Mikey! 🙂

 

Some really handy Crystal Reports Tips & Tricks

Jeff McWherter wrote an article on ASPAlliance called Six Quick Crystal Reports Design Tips.

When I first read through them I laughed at two in particular.

One was how to get check boxes to appear on a report. I struggled with this one a few years ago and now use it frequently. Why didn’t I just ask Jeff back then? (Oh yea, I didn’t know him)

The other is using a DRAFT watermark. I have been doing this for a long time, however I am using a jpeg and because of the way CR handles embedded images, the JPEG (even one that is 24kb) adds about 100 – 300 KB to the DLL. I spent a LOT of time trying to deal with this. Jeff shows how to just use text. TEXT! I never even thought of this! I will definitely be changing those reports.

The other four were all new to me!