Showing posts with label feed. Show all posts
Showing posts with label feed. Show all posts

Wednesday, March 7, 2012

carrier return + line feed in a varchar

Hi

how can I split a line into 2 lines in t-sql. etc
Set @.text1 = 'here's line one' + (carriere return + line feed) + 'here's line two'

I will be using it to send a mail from sql server (2000 sp4), so i can build a nice looking mail

> Set @.text1 = 'here's line one' + (carriere return + line feed) + 'here's

> line two'

Set @.text1 = 'here''s one line' + CHAR(13) + CHAR(10) + 'here''s line two';

|||thanks a lot

Carriage return within column alias

Is there a way to insert a carriage return or line feed in the middle of a column alias within a select statement? I tried using the CHAR function for the ascii value of the carriage return, but SQL Server wouldn't allow it inside the alias name for the column.
Any ideas?What are you trying to achieve with the end result? Is the result to be used in html or something? If so, you can use html tags in the header.|||The database query will be used in an ASP script run from a web site. The problem was that there were so many columns that I couldn't fit them on one page landscape for printing. If I can put some of the column headings (which are declared as aliases in my SQL query) on two lines as opposed to one long heading line, it will save page space.|||The simple solution, then is to put the HTML tag in the alias.. ie

SELECT col1 as 'COLUMN <BR> ONE'
bla bla bla

then when the column header is rendered by the asp, if it is set up correctly, it will put the break in. I believe, however, that there are ways to do this in HTML w/o the need of putting it in the column name.

Hope this helps.

Carriage Return and Line Feed in TexBox

I want to create a report with a textbox which contains a field followed by a
Carriage Return and Line Feed then another field
e.g
=First(Fields!Field1.Value)+ Carriage Return and Line Feed +
Fields!Field2.Value
How do I do this? I see a suggestion in places for vbCRLF and also \n. But
neither work.
Does vbCRLF apply perhaps to a vb.net environment? I'm in a c# environment.
Many Thanks
--
FionaDMDid you know you can insert another detail row? Just r-click on the row
selector, and insert row below.
Mike G.
"FionaDM" <FionaDM@.discussions.microsoft.com> wrote in message
news:2AD857E3-998C-494F-A9D1-558C430A1848@.microsoft.com...
>I want to create a report with a textbox which contains a field followed by
>a
> Carriage Return and Line Feed then another field
> e.g
> =First(Fields!Field1.Value)+ Carriage Return and Line Feed +
> Fields!Field2.Value
> How do I do this? I see a suggestion in places for vbCRLF and also \n. But
> neither work.
> Does vbCRLF apply perhaps to a vb.net environment? I'm in a c#
> environment.
> Many Thanks
> --
> FionaDM|||Try using the following:
=First(Fields!Field1.Value) & vbCrLf & Fields!Field2.Value
The Reporting Services expression designer uses VB6 style concatenation
characters so it might have been because you were using the + instead of
the &.
If it still doesn't work try using Environment.NewLine or "\n\r" in place
of vbCrLf but that should work for you. You can see a documented example of
using this in the following article:
http://msdn2.microsoft.com/en-us/library/ms157328.aspx
Just do a search for vbCrLf.
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> Thread-Topic: Carriage Return and Line Feed in TexBox
> From: =?Utf-8?B?RmlvbmFETQ==?= <FionaDM@.discussions.microsoft.com>
> Subject: Carriage Return and Line Feed in TexBox
> Date: Tue, 2 Oct 2007 06:25:01 -0700
> I want to create a report with a textbox which contains a field followed
by a
> Carriage Return and Line Feed then another field
> e.g
> =First(Fields!Field1.Value)+ Carriage Return and Line Feed +
> Fields!Field2.Value
> How do I do this? I see a suggestion in places for vbCRLF and also \n.
But
> neither work.
> Does vbCRLF apply perhaps to a vb.net environment? I'm in a c#
environment.
> Many Thanks
> --
> FionaDM
>|||Thanks - & vbCrLf & did the trick
--
FionaDM
"Chris Alton [MSFT]" wrote:
> Try using the following:
> =First(Fields!Field1.Value) & vbCrLf & Fields!Field2.Value
> The Reporting Services expression designer uses VB6 style concatenation
> characters so it might have been because you were using the + instead of
> the &.
> If it still doesn't work try using Environment.NewLine or "\n\r" in place
> of vbCrLf but that should work for you. You can see a documented example of
> using this in the following article:
> http://msdn2.microsoft.com/en-us/library/ms157328.aspx
> Just do a search for vbCrLf.
> --
> Chris Alton, Microsoft Corp.
> SQL Server Developer Support Engineer
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --
> > Thread-Topic: Carriage Return and Line Feed in TexBox
> > From: =?Utf-8?B?RmlvbmFETQ==?= <FionaDM@.discussions.microsoft.com>
> > Subject: Carriage Return and Line Feed in TexBox
> > Date: Tue, 2 Oct 2007 06:25:01 -0700
> >
> > I want to create a report with a textbox which contains a field followed
> by a
> > Carriage Return and Line Feed then another field
> >
> > e.g
> > =First(Fields!Field1.Value)+ Carriage Return and Line Feed +
> > Fields!Field2.Value
> >
> > How do I do this? I see a suggestion in places for vbCRLF and also \n.
> But
> > neither work.
> > Does vbCRLF apply perhaps to a vb.net environment? I'm in a c#
> environment.
> >
> > Many Thanks
> >
> > --
> > FionaDM
> >
>|||Great. Those concatenation things always got me between VB and C# so you
aren't the only one.
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> Thread-Topic: Carriage Return and Line Feed in TexBox
> From: <FionaDM@.discussions.microsoft.com>
> Subject: RE: Carriage Return and Line Feed in TexBox
> Date: Wed, 3 Oct 2007 02:56:01 -0700
> Thanks - & vbCrLf & did the trick
> --
> FionaDM
>
> "Chris Alton [MSFT]" wrote:
> > Try using the following:
> > =First(Fields!Field1.Value) & vbCrLf & Fields!Field2.Value
> >
> > The Reporting Services expression designer uses VB6 style concatenation
> > characters so it might have been because you were using the + instead
of
> > the &.
> >
> > If it still doesn't work try using Environment.NewLine or "\n\r" in
place
> > of vbCrLf but that should work for you. You can see a documented
example of
> > using this in the following article:
> >
> > http://msdn2.microsoft.com/en-us/library/ms157328.aspx
> >
> > Just do a search for vbCrLf.
> >
> > --
> > Chris Alton, Microsoft Corp.
> > SQL Server Developer Support Engineer
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > --
> > > Thread-Topic: Carriage Return and Line Feed in TexBox
> > > From: =?Utf-8?B?RmlvbmFETQ==?= <FionaDM@.discussions.microsoft.com>
> > > Subject: Carriage Return and Line Feed in TexBox
> > > Date: Tue, 2 Oct 2007 06:25:01 -0700
> > >
> > > I want to create a report with a textbox which contains a field
followed
> > by a
> > > Carriage Return and Line Feed then another field
> > >
> > > e.g
> > > =First(Fields!Field1.Value)+ Carriage Return and Line Feed +
> > > Fields!Field2.Value
> > >
> > > How do I do this? I see a suggestion in places for vbCRLF and also
\n.
> > But
> > > neither work.
> > > Does vbCRLF apply perhaps to a vb.net environment? I'm in a c#
> > environment.
> > >
> > > Many Thanks
> > >
> > > --
> > > FionaDM
> > >
> >
> >
>|||I have also seen controlchars.newline referenced and have personally used
System.Environment.NewLine. Is there one that is most efficient?
"Chris Alton [MSFT]" wrote:
> Great. Those concatenation things always got me between VB and C# so you
> aren't the only one.
> --
> Chris Alton, Microsoft Corp.
> SQL Server Developer Support Engineer
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --
> > Thread-Topic: Carriage Return and Line Feed in TexBox
> > From: <FionaDM@.discussions.microsoft.com>
> > Subject: RE: Carriage Return and Line Feed in TexBox
> > Date: Wed, 3 Oct 2007 02:56:01 -0700
> >
> > Thanks - & vbCrLf & did the trick
> > --
> > FionaDM
> >
> >
> > "Chris Alton [MSFT]" wrote:
> >
> > > Try using the following:
> > > =First(Fields!Field1.Value) & vbCrLf & Fields!Field2.Value
> > >
> > > The Reporting Services expression designer uses VB6 style concatenation
> > > characters so it might have been because you were using the + instead
> of
> > > the &.
> > >
> > > If it still doesn't work try using Environment.NewLine or "\n\r" in
> place
> > > of vbCrLf but that should work for you. You can see a documented
> example of
> > > using this in the following article:
> > >
> > > http://msdn2.microsoft.com/en-us/library/ms157328.aspx
> > >
> > > Just do a search for vbCrLf.
> > >
> > > --
> > > Chris Alton, Microsoft Corp.
> > > SQL Server Developer Support Engineer
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > > --
> > > > Thread-Topic: Carriage Return and Line Feed in TexBox
> > > > From: =?Utf-8?B?RmlvbmFETQ==?= <FionaDM@.discussions.microsoft.com>
> > > > Subject: Carriage Return and Line Feed in TexBox
> > > > Date: Tue, 2 Oct 2007 06:25:01 -0700
> > > >
> > > > I want to create a report with a textbox which contains a field
> followed
> > > by a
> > > > Carriage Return and Line Feed then another field
> > > >
> > > > e.g
> > > > =First(Fields!Field1.Value)+ Carriage Return and Line Feed +
> > > > Fields!Field2.Value
> > > >
> > > > How do I do this? I see a suggestion in places for vbCRLF and also
> \n.
> > > But
> > > > neither work.
> > > > Does vbCRLF apply perhaps to a vb.net environment? I'm in a c#
> > > environment.
> > > >
> > > > Many Thanks
> > > >
> > > > --
> > > > FionaDM
> > > >
> > >
> > >
> >
>|||I personally haven't tried using either of those in a report but since it
supports .NET namespaces I don't see why it wouldn't.
--
Chris Alton, Microsoft Corp.
SQL Server Developer Support Engineer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
> Thread-Topic: Carriage Return and Line Feed in TexBox
> thread-index: AcgHaTZxHlx+/uxhRJCGUmWO9AQkmQ==> X-WBNR-Posting-Host: 207.46.19.197
> From: =?Utf-8?B?V2lsbGlhbQ==?= <William@.discussions.microsoft.com>
> References: <2AD857E3-998C-494F-A9D1-558C430A1848@.microsoft.com>
<pGoU9QQBIHA.240@.TK2MSFTNGHUB02.phx.gbl>
<EF5C20BB-CFAB-4622-96D2-2F45B21444AC@.microsoft.com>
<e6Gm4coBIHA.240@.TK2MSFTNGHUB02.phx.gbl>
> Subject: RE: Carriage Return and Line Feed in TexBox
> Date: Fri, 5 Oct 2007 09:03:04 -0700
> I have also seen controlchars.newline referenced and have personally used
> System.Environment.NewLine. Is there one that is most efficient?
> "Chris Alton [MSFT]" wrote:
> > Great. Those concatenation things always got me between VB and C# so
you
> > aren't the only one.
> >
> > --
> > Chris Alton, Microsoft Corp.
> > SQL Server Developer Support Engineer
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> > --
> > > Thread-Topic: Carriage Return and Line Feed in TexBox
> > > From: <FionaDM@.discussions.microsoft.com>
> > > Subject: RE: Carriage Return and Line Feed in TexBox
> > > Date: Wed, 3 Oct 2007 02:56:01 -0700
> > >
> > > Thanks - & vbCrLf & did the trick
> > > --
> > > FionaDM
> > >
> > >
> > > "Chris Alton [MSFT]" wrote:
> > >
> > > > Try using the following:
> > > > =First(Fields!Field1.Value) & vbCrLf & Fields!Field2.Value
> > > >
> > > > The Reporting Services expression designer uses VB6 style
concatenation
> > > > characters so it might have been because you were using the +
instead
> > of
> > > > the &.
> > > >
> > > > If it still doesn't work try using Environment.NewLine or "\n\r" in
> > place
> > > > of vbCrLf but that should work for you. You can see a documented
> > example of
> > > > using this in the following article:
> > > >
> > > > http://msdn2.microsoft.com/en-us/library/ms157328.aspx
> > > >
> > > > Just do a search for vbCrLf.
> > > >
> > > > --
> > > > Chris Alton, Microsoft Corp.
> > > > SQL Server Developer Support Engineer
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > > --
> > > > > Thread-Topic: Carriage Return and Line Feed in TexBox
> > > > > From: =?Utf-8?B?RmlvbmFETQ==?= <FionaDM@.discussions.microsoft.com>
> > > > > Subject: Carriage Return and Line Feed in TexBox
> > > > > Date: Tue, 2 Oct 2007 06:25:01 -0700
> > > > >
> > > > > I want to create a report with a textbox which contains a field
> > followed
> > > > by a
> > > > > Carriage Return and Line Feed then another field
> > > > >
> > > > > e.g
> > > > > =First(Fields!Field1.Value)+ Carriage Return and Line Feed +
> > > > > Fields!Field2.Value
> > > > >
> > > > > How do I do this? I see a suggestion in places for vbCRLF and
also
> > \n.
> > > > But
> > > > > neither work.
> > > > > Does vbCRLF apply perhaps to a vb.net environment? I'm in a c#
> > > > environment.
> > > > >
> > > > > Many Thanks
> > > > >
> > > > > --
> > > > > FionaDM
> > > > >
> > > >
> > > >
> > >
> >
> >
>