Solved

SQL Server Select with bold text?

Posted on 2013-01-24
7
3,156 Views
Last Modified: 2013-01-25
In my code below I'm doing a select with the (new line) CHAR(10) statement

Any way I can declare on the SQL side (for my SSRS report) bold text?

[Contact Notes]
 is working correctly with new lines

I need to make the name bold


Select blah,
           blah,
               STUFF(( SELECT ' ' + CC.[First Name] + ' ' + CC.[Last Name] + '-' + B.Notes + CHAR(10)+ CHAR(10)			 
			FROM	dbo.[Client Contact Events] AS B
			INNER JOIN dbo.[Client Contacts] CC
			ON B.[Contact ID] = CC.[Contact ID]
			WHERE	[CVT].[Client ID] = B.[Client ID]
				AND	B.EventType = 'Visit'
				AND	B.[Contact Date] > [CVT].createdDate  FOR XML PATH ('')),1,0,'') AS [Contact Notes]
From myTable

Open in new window

0
Comment
Question by:lrbrister
7 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38816106
try CHAR(10)+CHAR(13)
0
 

Author Comment

by:lrbrister
ID: 38816143
I think I mis-stated up what I'm trying to accomplish.
In my select above the the carriage returns are returning correctly in SSRS as you can see.

I want to make the NAMES bold in my SSRS. (Yellow highlights below)
I'm fairly sure I could accomplish in SSRS in the expression by bolding everything up to the hyphen...but would rather handle from the SQL side if possible.

Off hand I don;t think it can be done.

SSRS Screen Pront
0
 
LVL 9

Accepted Solution

by:
JonMny earned 250 total points
ID: 38816185
I dont think it's possible. Unless you can use 2008
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 18

Expert Comment

by:UnifiedIS
ID: 38816304
Formatting options should be handled in your presentation layer (the report) so even if possible, I wouldn't recommend it.
0
 
LVL 22

Expert Comment

by:Nico Bontenbal
ID: 38817675
As JonMny says it can be done with 2008 using html tags:
http://msdn.microsoft.com/en-us/library/cc627491(v=sql.100).aspx
Change your query so it returns a string like:
<b>Dinette Blessinger</b>-Stopping .....
Then set the ' Interpret HTML tags as styles' property on your Contact Notes column.
0
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 250 total points
ID: 38818191
If you need part of your string to be formatted differently (i.e. bolded) than the rest of the string, in 2005 you don't have a lot of options.  No HTML, no placeholder in the Textbox...

The only thing you can do is use two separate textboxes and format those as expected.  To put two textboxes next to each other in one table cell, first put a Rectangle in that cell.  Then you can add two textboxes inside that rectangle.
0
 

Author Closing Comment

by:lrbrister
ID: 38818499
Thanks folks. Using 2005 so not possible
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question