Solved

SQL Server Select with bold text?

Posted on 2013-01-24
7
2,908 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now