Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Server Select with bold text?

Posted on 2013-01-24
7
Medium Priority
?
4,258 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 1000 total points
ID: 38816185
I dont think it's possible. Unless you can use 2008
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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.
1
 
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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

927 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