When you are creating a CRM report involving an address block, you will need to take into account the fact that most of the time, the additional address lines will be blank.  Since it is generally bad form to have extra blank lines in your address block, we need a way of only adding those fields with data.  Take a look at the following, pretty normal address block layout with examples:

Address Block Layout:

Customer Name
Address Line 1
Address Line 2
City, State Zipcode

Example 1:

Bob Smith
123 South Center Street
Apt. 3A
Dallas, TX 00111

Example 2:

Bob Smith
123 South Center Street, Apt 3A

Dallas, TX 00111

Notice how the second example's Address Line 2 is blank, and therefore we have that ugly blank line in the middle of our address?  Well, I don't know about you, but most of my customers ( and me ) find this unacceptable and want the extra blank line removed.

To accomplish this, we will use the Visual Basic IIF function.  This function performs a test that you specify and returns one value if true, and another value if false.

So, here is how we would create the expression to populate a text box within a SQL Reporting Services report that will contain our customer's mailing address:

=Fields!name.Value & vbCRLF &
Fields!address1_line1.Value & vbCRLF &
IIF(IsNothing(Fields!address1_line2.Value), "", Fields!address1_line2.Value & vbCRLF) &
Fields!address1_city.Value & ", " &
Fields!address1_postalcode.Value & " " &
Fields!address1_stateorprovince.Value

Let's break down some of the more special features of this calculation:

  • vbCRLF is the Visual Basic pre-defined constant that contains the values of a carriage return and a line feed – what is sometimes called a "New Line" character.
  • IsNothing is a Visual Basic function that returns TRUE if the variable being tested is blank.
  • The & sign is used to concatenate two strings.

The pseudo code for the IIF statement looks like this:

  1. Check to see if the address1_line2.Value Field is blank.
  2. If it is blank, return a blank ( "" ).
  3. If it is not blank, return the address1_line2.Value Field with a carriage return, line feed character appended to it.

 

Note: You will need to substitute the field names found in your report for the ones listed in the expression.

References:

Visual Basic Language Reference: IIf Function.

 

 

AJAX, Atlas and General ASP.NET 2.0 Development

On March 26, 2006, in Development, by Mitch Milam

I have been in the computer business since 1984 and I think that I can say, with complete honesty, that I am having as much fun right now, as I did way back then, when everything was new and constantly changing ( oh wait, that's every day for geeks like us ).

Anyway, I've only been working with .NET development about a year and I've still got a ton of stuff to learn, but what I am seeing is a maturation of tools and technologies that allow developers and architects to focus on the solution, not on making your tools do what you want them to do.

Case in point: AJAX and the Atlas.

Now I don't know a whole lot about this topic because I've been buried in Sharepoint and MSCRM development, but from what I have been reading lately, there is a ton of genuine functionality behind the hype.  And this functionality is going to enable us to enhance the user experience of our web sites to the point that the users will see very little difference in operating a web app vs. a Windows app.

And I don't know about you, but I find that pretty darn exciting. ( I actually find it more exciting than that, but I have to keep this blog mostly "G-Rated" )

One of my fellow Sharepoint bloggers had a short post last week regarding the Atlas AJAX library.  If you are interesting in enhancing your web-based applications, I would advise you to keep reading and review the information found at the various links in Mark's article.

From Mark Harrison's blog

The latest bits of Atlas (the March Community Technology Preview) are now available to download.

Atlas is a free framework that uses AJAX techniques for building a new generation of richer, more interactive, highly personalized standards based Web applications. If you have not seen it before, take a 15 minutes out to watch Scott Guthrie create a simple Web application with ASP.NET 2.0 and then add Atlas capabilities to it.

Atlas Web Site

 

I took Mark's advice and watched Scott's "movie." I was astounded.  First of all, adding AJAX support to an ASP.NET 2.0 application using the Atlas toolkit is nothing more than adding a few controls to your pages and POOF, you're an AJAX site.

In my line of work, we call that PRETTY FREAKING COOL.

Secondly, and I don't if Scott was the one typing during the demo, but I can tell right now that my knowledge of how the code editor works in VS2005 would fit under the nail of Scott's little finger.  I'm going to have to go back and watch it again just to see if I can figure out how he did some of those editing tricks.

Well, that's my two-cents worth for the day. If you develop anything cool with .NET and Atlas, drop me a line or post a comment so I can see your work.

 

 

 

Dynamics CRM 3.0 SDK v 3.0.4 Released

On March 26, 2006, in Dynamics CRM, by Mitch Milam

A new version of the SDK was released last week.  I mention it because they added some really cool examples that I think you should review.  Here is a list of changes in the 3.0.4 release:

Description of changes
MetadataDiagram Added project and solution files, removed duplicate entities, added excluded entities and relationships to the sample code.
Business Logic Extensions (Callouts) Added documentation for PostDeliver and PreSend callouts.
Callout Configuration Added improved sample code for determining which entity attributes can be used in a callout.
Callout Configuration File Reference Added information to the topic on callout configuration.
Customization File Reference Added detailed reference information about the schema of the import/export customization file.
Field Types, Properties and Methods Bug fixes in documentation for String and Picklist types.
Form Properties Added information about the various form types found in the SDK.
IFrame Support Added information to the topic on IFrame support.
ISV Guidelines Added a book that contains guidelines for people creating add-ons for Microsoft CRM.
Microsoft CRM Entity Model Updated entity model diagrams throughout the entity model topics. Added Key to Entity Diagrams to explain color coding for new diagrams.
Registry Settings Added registry keys used in the Hosted Microsoft Dynamics CRM 3.0 release.
Report Writers Guide Added information on how to create context-sensitive reports.
Sample Code Merged similar samples Using Dynamic Entities and CRUD Operations using Dynamic Entities.Updated the following samples: 

InstantiateTemplate

SendEmail

AddMembersTeam

 

Convergence 2006: Day 2

On March 26, 2006, in Misc, by Mitch Milam

I only attended a couple of sessions today because I was jaw-jacking with MS folks, partners, and vendors.  Overall, it was a great day at Convergence.

I also picked up a copy of Working with Microsoft Dynamics CRM 3.0 by Mike Snyder and Mim Steger of Sonoma Partners in Chicago.

It's a pretty good read and should be on every CRMer's bookshelf.

Tomorrow has some more content that interests me so it should be more fun. Plus, I think Patrick Lewis has a couple of sessions that I hope to drop by and heckle. :)

If you're at Convergence, drop me an email and we can meet up somewhere.

 

It's not just me

On March 26, 2006, in Meanderings, by Mitch Milam

That chick on godaddy.com IS hot.

Then I got to thinking, "I wonder if she can cook." 

Which led me to my next thought: "Dumbass. Who cares if she can cook. You can cook."