Formatting SQL Query Results

  • Hello guys! I was wondering if there was any way to format specific results from a query. I am using Visual Studio 2003 to create reports for Microsoft CRM. I am running SQL Server 2005 on a machine running Windows Server 2003. What I would like to happen, is I wrapped isnull's around a few fields to say "not specified" when they are blank. I would like those to be bold, but only when it returns the "not specified", not when it returns its regular data stored in that column. It is to assist in cleaning up data, but there have been a few different occasions where I would have liked to do something like this. Another example is when we do events. I would like to develop a report that has all Unpaid event registrations highlighted in a yellow background... Anywho, is there anyway to specifiy formatting when you run a query??

  • Does the CASE clause help?

  • Well I mean essentially that is what I wanna do.. but I wanna be able to say:

    CASE WHEN this = this THEN END

    Is there any way to write a query like this, in order to develop your report??

  • Could you add your html code in your CASE clause if you use web to generate your report? I am just wondering.

  • Well, I am writing the report in visual studio. I cannot add anything in the area where you put the sql that is not a recognized sql command. The report is later ran from within Microsoft CRM. I am not sure how I could make that work with HTML but if I could that would be perfect.

  • Could you make it be ' ' instead of just 'Not Specified' in your ISNULL() function?

  • Thanks a lot for the responses guys. VS actually allows for Conditional Formatting by itself. It is built in. You just choose the property for the field/fields you would to conditionally format and set up an expression using the appropriate code. Thanks again for the help!

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply