Friday, March 23, 2012
Formatting text in a single table cell
column similar too:
Total spent: $100
Total left: $1,230
So that the NUMBER values on the right are completely right justified, but
the text on the left is actually LEFT justified. Can this type of
formatting occurr within the same cell?
TIA,
--
Brian Grant
Senior Programmer
SI International
www.si-intl.comJustification is done on a per cell basis. What you can do is use a
rectangle that contains two textboxes for each row. This would allow you to
apply the justification as needed.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:%23Kh2U%237fEHA.3476@.tk2msftngp13.phx.gbl...
> I have a two column report. However, in the footer, i'd like to present a
> column similar too:
> Total spent: $100
> Total left: $1,230
> So that the NUMBER values on the right are completely right justified, but
> the text on the left is actually LEFT justified. Can this type of
> formatting occurr within the same cell?
> TIA,
> --
> Brian Grant
> Senior Programmer
> SI International
> www.si-intl.com
>
Formatting Parameter Values
formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
My parameter is returning XXXX 2006, but I only want the year part of
the parameter passed to the expression.
Can this be done.?If it's a date, then =Datepart(DateInterval.Year, Parameters!myParm.Value)
or you could do the following:
=DatePart(DateInterval.Year,
DateTime.Parse(Parameters!myParam.Value.ToString()))
You could also do this:
=Parameters!myParam.Value.ToString().SubString(4,4) /* assuming 0-based
strings */
"Andy" <andy.williams1971@.ntlworld.com> wrote in message
news:1152626782.474747.226720@.35g2000cwc.googlegroups.com...
>I want to enter part of a parameter value as an expression similar to
> formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
> My parameter is returning XXXX 2006, but I only want the year part of
> the parameter passed to the expression.
> Can this be done.?
>|||This worked a treat!
Thanks
Tim Dot NoSpam wrote:
> If it's a date, then =Datepart(DateInterval.Year, Parameters!myParm.Value)
> or you could do the following:
> =DatePart(DateInterval.Year,
> DateTime.Parse(Parameters!myParam.Value.ToString()))
> You could also do this:
> =Parameters!myParam.Value.ToString().SubString(4,4) /* assuming 0-based
> strings */
> "Andy" <andy.williams1971@.ntlworld.com> wrote in message
> news:1152626782.474747.226720@.35g2000cwc.googlegroups.com...
> >I want to enter part of a parameter value as an expression similar to
> > formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
> >
> > My parameter is returning XXXX 2006, but I only want the year part of
> > the parameter passed to the expression.
> >
> > Can this be done.?
> >|||No worries. Remember that [almost] whatever you can do in VB.NET, you can
do in RS...
-Tim
"Andy" <andy.williams1971@.ntlworld.com> wrote in message
news:1152630530.714237.206660@.h48g2000cwc.googlegroups.com...
> This worked a treat!
> Thanks
>
> Tim Dot NoSpam wrote:
>> If it's a date, then =Datepart(DateInterval.Year,
>> Parameters!myParm.Value)
>> or you could do the following:
>> =DatePart(DateInterval.Year,
>> DateTime.Parse(Parameters!myParam.Value.ToString()))
>> You could also do this:
>> =Parameters!myParam.Value.ToString().SubString(4,4) /* assuming 0-based
>> strings */
>> "Andy" <andy.williams1971@.ntlworld.com> wrote in message
>> news:1152626782.474747.226720@.35g2000cwc.googlegroups.com...
>> >I want to enter part of a parameter value as an expression similar to
>> > formatting a global fields e.g. Format(Globals.ExecutionTime, "D").
>> >
>> > My parameter is returning XXXX 2006, but I only want the year part of
>> > the parameter passed to the expression.
>> >
>> > Can this be done.?
>> >
>
Monday, March 19, 2012
Formatting a Select Statement
I am looking for a function similar to the Left(), Right(), and
Replace() functions to insert characters into a returned list of my
date field. The date currently looks like this "06202006" the function
I am looking for would return "06/20/2006" something like this if
Insert() was an actual function:
SELECT DISTINCT insert("/", right(insert("/",left(date, 2)), 2)
FROM tblLogs;
Please let me know if you have any experience with this.Perhaps you are looking for STUFF:
SELECT STUFF(STUFF([date], 5, 0, '/'), 3, 0, '/')
FROM tblLogs;
However, data formatting is better done in the presentation layer rather
than the database code.
Hope this helps.
Dan Guzman
SQL Server MVP
"EESP" <johnson4@.wwu.edu> wrote in message
news:1150932662.524736.128910@.b68g2000cwa.googlegroups.com...
> Hi everyone!
> I am looking for a function similar to the Left(), Right(), and
> Replace() functions to insert characters into a returned list of my
> date field. The date currently looks like this "06202006" the function
> I am looking for would return "06/20/2006" something like this if
> Insert() was an actual function:
> SELECT DISTINCT insert("/", right(insert("/",left(date, 2)), 2)
> FROM tblLogs;
> Please let me know if you have any experience with this.
>|||Works Great! I would like to format in the presentation layer of the
code, but I'm having troble running that formatting code through a
datgrid returning close to 10K entries. For some reason just works a
lot faster server side. Thanks for the help!
Friday, March 9, 2012
Format using SQL server
I'm new to SQL server. My question here is how can I format the data that is retrieved as a result of SELECT.
Similar defining the column format in SQL Plus. For some reason SQL Server puts in extra spaces between the data fields in the .dat file.
If you have additional trainling spaces, it seems that you specified a fixed character length instead of a variable. THe data won′t be chopped until you will specify it either in the table structure or within the Select statement while pumpoing the data out of the database (CONVERT).
HTH, jens Suessmeyer.
http://www.sqlserver2005.de
|||This is not with the data. Say if I have 2 fields Field 1 and Field 2. Field 1 is 12 char and field 2 is 2 char. Instead of putting Field 1 as 12 char it puts 15 char for Field 1 and for Field 2 it puts 4 char. I want to remove those extra spaces. I would appreciate any help.Format Text of Formula Field
Select {FieldName1}
Case "A":
"A: " & {FieldName2}
Case "B":
"B: " & {FieldName3}
Case "C":
"C: " & {FieldName4}
Default:
"D: " & {FieldName5};
I want the "A:", "B:", etc to be Bold and the FieldName to be Normal (not Bold). Is there a way I can accompish this?Found a work around...
I created 2 formulas and put both formulas into a Text Object. I Bolded one and not the other. The first Formula determined what the Label woud say ("A:", "B:", etc), the second Formula determined which Field would display.
Wednesday, March 7, 2012
Format similar to Excel accounting format (paren around negatives, - for 0)
Services, but I have yet to find a way to have it display 0 as a -
(hyphen). I've found that I can use an IIF but that means that the -
will be a string and not actually representative of 0 when exported to
Excel. Anyone have a solution, or is this just a shortcoming of
Reporting Services?On Aug 17, 12:19 pm, TrueDis <swro...@.gmail.com> wrote:
> I know that it's possible to get () around negatives in Reporting
> Services, but I have yet to find a way to have it display 0 as a -
> (hyphen). I've found that I can use an IIF but that means that the -
> will be a string and not actually representative of 0 when exported to
> Excel. Anyone have a solution, or is this just a shortcoming of
> Reporting Services?
Have you set the format property using the iif statement and then set
the value property as Nothing or 0 if below zero? If so, you should be
able to avoid the string representation in Excel. You should use
something like this in the Format property.
=iif(Fields!SomeItem.Value < 0, "-(#,0)", "#,0")
and then use the regular expression in the Value property:
=Fields!SomeItem.Value
If this does not work out, you should be able to use the cast as int
functionality in the value property.
=iif(Fields!SomeItem.Value < 0, CInt(Nothing), Fields!SomeItem.Value)
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||On Aug 18, 9:21 pm, EMartinez <emartinez...@.gmail.com> wrote:
> On Aug 17, 12:19 pm, TrueDis <swro...@.gmail.com> wrote:
> > I know that it's possible to get () around negatives in Reporting
> > Services, but I have yet to find a way to have it display 0 as a -
> > (hyphen). I've found that I can use an IIF but that means that the -
> > will be a string and not actually representative of 0 when exported to
> > Excel. Anyone have a solution, or is this just a shortcoming of
> > Reporting Services?
> Have you set the format property using the iif statement and then set
> the value property as Nothing or 0 if below zero? If so, you should be
> able to avoid the string representation in Excel. You should use
> something like this in the Format property.
> =iif(Fields!SomeItem.Value < 0, "-(#,0)", "#,0")
> and then use the regular expression in the Value property:
> =Fields!SomeItem.Value
> If this does not work out, you should be able to use the cast as int
> functionality in the value property.
> =iif(Fields!SomeItem.Value < 0, CInt(Nothing), Fields!SomeItem.Value)
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
What I'm hoping to do is have 0 show up as a dash like this: -
Will this do that?
Sunday, February 26, 2012
Format Numbers
how to format numbers in T-SQL, is there any function similar to Format in
VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
Thanks in advance.
Regards
jouj
use cast and convert functions
see BOL
"jouj" wrote:
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>
|||See:
http://groups-beta.google.com/group/...d?dmode=source
Anith
|||The STR() function exists. But you can make your own formats using a udf
(you can have some examples on sqlservercentral for example)
Best regards
P.RUELLO
DBA
"jouj" wrote:
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>
|||FYI, you're usually much better off using the formatting functions of
whatever front-end tool you're using to access SQL Server with.
Mike
"jouj" <jouj@.discussions.microsoft.com> wrote in message
news:6B47D07F-0B21-4B9B-9D08-1A0194287DCB@.microsoft.com...
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>
Format Numbers
how to format numbers in T-SQL, is there any function similar to Format in
VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
Thanks in advance.
Regards
joujuse cast and convert functions
see BOL
"jouj" wrote:
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>|||See:
http://groups-beta.google.com/group/microsoft.public.sqlserver.programming/msg/97af3e2b3f45b72d?dmode=source
--
Anith|||The STR() function exists. But you can make your own formats using a udf
(you can have some examples on sqlservercentral for example)
Best regards
--
P.RUELLO
DBA
"jouj" wrote:
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>|||FYI, you're usually much better off using the formatting functions of
whatever front-end tool you're using to access SQL Server with.
Mike
"jouj" <jouj@.discussions.microsoft.com> wrote in message
news:6B47D07F-0B21-4B9B-9D08-1A0194287DCB@.microsoft.com...
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>
Format Numbers
how to format numbers in T-SQL, is there any function similar to Format in
VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
Thanks in advance.
Regards
joujuse cast and convert functions
see BOL
"jouj" wrote:
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>|||See:
f3e2b3f45b72d?dmode=source" target="_blank">http://groups-beta.google.com/group...2d?dmode=source
Anith|||The STR() function exists. But you can make your own formats using a udf
(you can have some examples on sqlservercentral for example)
Best regards
--
P.RUELLO
DBA
"jouj" wrote:
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>|||FYI, you're usually much better off using the formatting functions of
whatever front-end tool you're using to access SQL Server with.
Mike
"jouj" <jouj@.discussions.microsoft.com> wrote in message
news:6B47D07F-0B21-4B9B-9D08-1A0194287DCB@.microsoft.com...
> Hi all,
> how to format numbers in T-SQL, is there any function similar to Format in
> VBA? (ex: Format(5236.25,"#,##0.00")==> 5,236.25)
> Thanks in advance.
> Regards
> jouj
>
Format Masking for creating leading periods
When I do not allow the textbox to grow and just append a long string of periods it looks fine in my report preview, but after I deploy everything appended after the primary field in that text box is missing?
My report has a lot of data to the right but it is collapsible so the fields to the left are a good distance away. This is why I am trying to include light visual aids that assist lining up data values. I am not stuck on the leading period idea but it seems the least cluttered.
AaronBump...
Does anyone have any solutions for masking fields?|||
Hello Aaron,
Can you try something like this in your field's expression:
=StrDup(25 - len(Fields!FIELD1.Value), ".") & Fields!FIELD1.Value
The 25 in my example would have to be higher than the maximum number of characters in your FIELD1 field. This will fill the rest of space (up to 25 characters) on the left of the field with period's, it should be adjusted to fill the rest of your textbox.
Hope this helps.
Jarret