Solved

SQL Server Select with bold text?

Posted on 2013-01-24
7
3,636 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
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

628 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