Thursday, March 29, 2012
Formula for disk space
You should be able to write a simple formula
{field.march23} - {currentvalue}
Your result should be the march23 size, - the current size
without an example, it is difficult to know
Friday, March 23, 2012
Formatting Suggestions - Please Help
Hello,
I have a matrix with a dynamic number of columns (1-10). The trouble is that hiding one ore more columns still leaves space reserved for all 10 columns, which is ugly. This is because the size of the TextBox that oversees the columns is not dynamic, and it is set to the size of all 10 text boxes.
In other words, a matrix with 5 columns looks like this:
Item Total
Col1 Col2 Col3 Col4 Col5 Total
5 5 5 5 5 25
While a matrix with 2 columns (the last 3 have visibility set to false) looks like this:
Item Total
Col1 Col2 Total
5 5 25
I am going crazy trying to solve this one. Does anyone have any ideas at all that can help me? Merging all the columns into a single column would not work well for me, as each column is a drill-down for the others. And making each column small (.1in), doesn't work either because there is no "no-wrap" property.
ANY suggestions would be appreciated. How have others dealt with this issue?
Michael
I have also found that the invisible function is SQL reports is no good. What determines how many columns there will be on the report? Can you use that determination to choose between different reports -- say one that is a two column report and another that is a five column report? Don't use invisibility at all.|||Greg,
That's what I did. I created a small, medium, and large version of my report (1-2, 3-5, 6-10), that seems to be reasonable even when the visibility column is hidden for some of the columns. The problem is that I have a dozen reports I want to use with the variable column in the left axis, and that means I need to create 36 reports instead of 12. Fortunately, the top axis auto-fits items so I only need one report for the top axis, or else I would be in BIG trouble.
sqlWednesday, March 21, 2012
Formatting negative numbers without space between minus sign and number
and the number. I use the following "Format" for my numbers:
# ### ### ### (and have also tested to add ;-# ### ### ###) without
success!
-90000000.12345 formats to - 90 000 000 when I would like to have -90
000 000 Numbers like -1 should also be accpted... -1 instead of - 1...
Is there an easier whay to format this number? And how can I remove
the space...
Thank youI tried working with your example and several variations on the ### format
string. The space between the "-" and the value seems to built-in to that
format string. Please see the following for additional ideas:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformattingoverview.asp
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Andreas Kardell" <akardell@.home.se> wrote in message
news:67424f9d.0410130707.1e79c943@.posting.google.com...
> How can I format these numbers without a space between the minus sign
> and the number. I use the following "Format" for my numbers:
> # ### ### ### (and have also tested to add ;-# ### ### ###) without
> success!
> -90000000.12345 formats to - 90 000 000 when I would like to have -90
> 000 000 Numbers like -1 should also be accpted... -1 instead of - 1...
> Is there an easier whay to format this number? And how can I remove
> the space...
> Thank you|||Hi Andreas
I found the following format worked in some instances ie for numbers 999 or
999999 etc.
=iif(Fields!ActualQty.Value < 0, "# ###"," # ###")
I too am having fun with conditional formating at the moment.
Fiona
"Bruce Johnson [MSFT]" wrote:
> I tried working with your example and several variations on the ### format
> string. The space between the "-" and the value seems to built-in to that
> format string. Please see the following for additional ideas:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformattingoverview.asp
>
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Andreas Kardell" <akardell@.home.se> wrote in message
> news:67424f9d.0410130707.1e79c943@.posting.google.com...
> > How can I format these numbers without a space between the minus sign
> > and the number. I use the following "Format" for my numbers:
> > # ### ### ### (and have also tested to add ;-# ### ### ###) without
> > success!
> >
> > -90000000.12345 formats to - 90 000 000 when I would like to have -90
> > 000 000 Numbers like -1 should also be accpted... -1 instead of - 1...
> >
> > Is there an easier whay to format this number? And how can I remove
> > the space...
> >
> > Thank you
>
>|||Thank you Bruce!
I'm not too familiar with .NET Framework yet so I solved it by putting
the following code into the value field instead and leaving the format
field empty:
=IIF(Fields!fQuantity.Value < 0, "-", "") +
Ltrim(Format(Abs(Fields!fQuantity.Value), "# ### ### ###"))
I'm not too happy about this workaround but I use it for now.
Thanks a lot
"Bruce Johnson [MSFT]" <brucejoh@.online.microsoft.com> wrote in message news:<ulD7npUsEHA.3324@.TK2MSFTNGP15.phx.gbl>...
> I tried working with your example and several variations on the ### format
> string. The space between the "-" and the value seems to built-in to that
> format string. Please see the following for additional ideas:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconformattingoverview.asp
>
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Andreas Kardell" <akardell@.home.se> wrote in message
> news:67424f9d.0410130707.1e79c943@.posting.google.com...
> > How can I format these numbers without a space between the minus sign
> > and the number. I use the following "Format" for my numbers:
> > # ### ### ### (and have also tested to add ;-# ### ### ###) without
> > success!
> >
> > -90000000.12345 formats to - 90 000 000 when I would like to have -90
> > 000 000 Numbers like -1 should also be accpted... -1 instead of - 1...
> >
> > Is there an easier whay to format this number? And how can I remove
> > the space...
> >
> > Thank you|||Well, I don't have the same experience.
I am using SP1, but you are probably using that too.
Here's the format string I use in the format property of the TextBox.
#,#;-#,#;0
If you need to use it in code, the syntax would be:
String.Format("{0:#,#;-#,#;0}", Field.Value)
The result is just what you say you are wanting.
BTW, if it still does not work I suggest using CUSTOM CODE (look it up
in the help) to standardize/centralize the code you use to do the
formatting.
BR//Jerry|||#,#;-#,#;0
Monday, March 19, 2012
Formatting a string from the code
I'm working on converting it to gigabytes and if it's less that one gig, I
want to display the string "Critical" bold and in red. Can this be done?
Thanks.This can certainly be done. Where do you want to display the text
'Critical'? If you have another textbox you would use an expression to
determine the value of that checkbox. for example if you were getting the
value from a dataset you would have a similar code to the following in the
expression editor:
=IIf(Fields!Number_Of_Megs < 1024,"","Critical")
Hope this helps
"chalexan" wrote:
> I have a textbox that displays the amout of free disk space in megabytes.
> I'm working on converting it to gigabytes and if it's less that one gig, I
> want to display the string "Critical" bold and in red. Can this be done?
> Thanks.|||Bret or anyone else,
Thanks for the reply. Any suggestions on changing the font's color to red
if it's critical and making it bold?
--Chad|||You will have to do this from the report designer. You can select the
textbox that the text is in and go to the textbox properties. (right click
and properties) From here you can select the format for this text box... A
nice feature is using the Expression Editor to select the font color. This
will allow you to use an IIF() statement to have the font red or black. You
can allow do this with the font weight.
Example of formatting font color in expression editor: (you would put this
in the format expression for the font-color in the designer)
=IIf(Fields!Number_Of_Megs < 1024,"black","red")
"chalexan" wrote:
> Bret or anyone else,
> Thanks for the reply. Any suggestions on changing the font's color to red
> if it's critical and making it bold?
> --Chad|||Bret,
Wow! I thought that the "IIf(" was a typo. That functionality can be very
useful. Thank you so much for explaining that to me.
--Chad
Sunday, February 26, 2012
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
Friday, February 24, 2012
Format date output
I have a query that looks something like this:
select LEFT(dbo.Charges.service_date + SPACE(10), 10) AS ImmunizationDate
from dbo.charges
I need output to be in mm/dd/yyyy format without changing users date/time
settings. Service_date is of datetime data type.
Deki PAYou need to use the optional style parameter.
select convert(varchar(50),getdate(),101)
Your code will look something like
> select LEFT(CONVERT(varchar(50),dbo.Charges.service_date,101) + SPACE(10),
> 10) AS ImmunizationDate
> from dbo.charges
HTH. Ryan
"Deki" <Deki@.discussions.microsoft.com> wrote in message
news:1D07032A-EEB0-42BF-AA7D-CE683EAF1312@.microsoft.com...
> Hello,
> I have a query that looks something like this:
> select LEFT(dbo.Charges.service_date + SPACE(10), 10) AS ImmunizationDate
> from dbo.charges
> I need output to be in mm/dd/yyyy format without changing users date/time
> settings. Service_date is of datetime data type.
>
> --
> Deki PA
>|||You can use the Convert Function as in
SELECT CONVERT(VARCHAR,GETDATE(), 101)
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"Deki" <Deki@.discussions.microsoft.com> wrote in message
news:1D07032A-EEB0-42BF-AA7D-CE683EAF1312@.microsoft.com...
> Hello,
> I have a query that looks something like this:
> select LEFT(dbo.Charges.service_date + SPACE(10), 10) AS ImmunizationDate
> from dbo.charges
> I need output to be in mm/dd/yyyy format without changing users date/time
> settings. Service_date is of datetime data type.
>
> --
> Deki PA
>|||The best answer is to format the data on the client using whatever API you
have available.
Second best (if your UI is not possible to change) check the CONVERT
possibilities.
Third best, use datepart and string functions and roll your own:
select cast(datepart(m, getdate()) as varchar(2)) + '/' + cast(datepart(d,
getdate()) as varchar(2)) + '/' + right(cast(datepart(year, getdate()) as
char(4)),2)
Then you can produce any format you want. I didn't deal with single digit
months because you should be able to use:
select CONVERT (varchar(10),getdate(),1)
But if you need something like this, it can be handy to use datepart to
format a date
----
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)
"Deki" <Deki@.discussions.microsoft.com> wrote in message
news:1D07032A-EEB0-42BF-AA7D-CE683EAF1312@.microsoft.com...
> Hello,
> I have a query that looks something like this:
> select LEFT(dbo.Charges.service_date + SPACE(10), 10) AS ImmunizationDate
> from dbo.charges
> I need output to be in mm/dd/yyyy format without changing users date/time
> settings. Service_date is of datetime data type.
>
> --
> Deki PA
>|||Thank you all!
--
Deki PA
"Louis Davidson" wrote:
> The best answer is to format the data on the client using whatever API you
> have available.
> Second best (if your UI is not possible to change) check the CONVERT
> possibilities.
> Third best, use datepart and string functions and roll your own:
> select cast(datepart(m, getdate()) as varchar(2)) + '/' + cast(datepart(d,
> getdate()) as varchar(2)) + '/' + right(cast(datepart(year, getdate()) as
> char(4)),2)
> Then you can produce any format you want. I didn't deal with single digit
> months because you should be able to use:
> select CONVERT (varchar(10),getdate(),1)
> But if you need something like this, it can be handy to use datepart to
> format a date
>
> --
> ----
--
> Louis Davidson - http://spaces.msn.com/members/drsql/
> SQL Server MVP
> "Arguments are to be avoided: they are always vulgar and often convincing.
"
> (Oscar Wilde)
> "Deki" <Deki@.discussions.microsoft.com> wrote in message
> news:1D07032A-EEB0-42BF-AA7D-CE683EAF1312@.microsoft.com...
>
>