all groups > sql server reporting services > july 2005 >
You're in the

sql server reporting services

group:

Silly Question - String Formatting


Silly Question - String Formatting Nat Johnson
7/21/2005 4:41:01 PM
sql server reporting services:
I need to take a value returned from the database

ie. Record Location: Little Road, Auckland

and only show Little Road, Auckland in the text box. How do i do this.

hmmmmm been thinking awhile on this one.

probably really really simple, just need a push is all (and thats not over
the cliff either)....

Re: Silly Question - String Formatting Nat Johnson
7/21/2005 6:03:02 PM
Sorry not sure what is meant by custom code on this.....im a newbie to
reporting services.



[quoted text, click to view]
Re: Silly Question - String Formatting Mahesh
7/21/2005 7:21:20 PM
search for Custom code in report help which explains how and where to
write custom code. In that code u can write a function to do formating
and and return the required text. Then call this function in expression
of the textbox.

hope this helps.

Mahesh
RE: Silly Question - String Formatting Andre
7/21/2005 8:52:03 PM
Nat,
You could change your dataset to return the correct value. You can use
something like this:

SELECT REPLACE(myTextField,'Record Location: ','') FROM myTable


Andre



[quoted text, click to view]
Re: Silly Question - String Formatting Martin Kulov
7/22/2005 12:00:00 AM
[quoted text, click to view]

Hi Nat,

create custom code in your report that splits the string with ':' delimiter
and user the returned strings.

HTH,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD


Re: Silly Question - String Formatting Wayne Snyder
7/22/2005 3:32:52 PM
Here is a quick example of how you might do this easily in your SQL Query
( using the pubs database)

select charindex('e',pub_name),
right(pub_name,datalength(pub_name)-charindex('e',pub_name)),pub_name from
publishers

run this on pubs in query analyzer and see how it works.. This breaks on the
character 'e' instead of ':'

you will still have to handle when NO character exists....test it...

--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
(Please respond only to the newsgroup.)

I support the Professional Association for SQL Server ( PASS) and it's
community of SQL Professionals.
[quoted text, click to view]

AddThis Social Bookmark Button