Showing posts with label row. Show all posts
Showing posts with label row. Show all posts

Monday, March 26, 2012

formatting with expressions trouble

I am trying to make a whole row "bolder" if a field in that row return true.
iif(field = true,"bolder","normal")
Isnt that the way it is written inside the format weight in the properties.Should be =IIF(Fields!YourField.Value = True, "Bold", "Normal")
"Benw" <Benw@.discussions.microsoft.com> wrote in message
news:476371E6-E970-4144-8D40-10873AC9530B@.microsoft.com...
>I am trying to make a whole row "bolder" if a field in that row return
>true.
> iif(field = true,"bolder","normal")
> Isnt that the way it is written inside the format weight in the
> properties.

Formatting Total of Subtotals in Matrix

Need your help with formating color of subtotal cell.
Here is my scenario:
Matrix with are 2 row's groups:
- RowKat
- RowSubKat
and 2 column's groups:
- ColKat
- ColSubKat
I want to have my subtotal cell of RowKat, in ColKat subtotal scope
(most outer total of subtotals), to be green where it's value is > 55
Is it possible?
KamelIs it possible to define Row Subtotal in scope of Column Subtotal?|||Hi Kamel. I had a similiar scenario some time back. I could not find
anyway of doing this. the most one could do is to format the whole
subtotal, but it can't be conditionally formatted (as in differently
colored column subtotals). I had to modify the dataset-query to have
another row, and then put the conditional formatting in that row.
On Feb 7, 5:45 pm, "kamel" <kwic...@.gmail.com> wrote:
> Need your help with formating color of subtotal cell.
> Here is my scenario:
> Matrix with are 2 row's groups:
> - RowKat
> - RowSubKat
> and 2 column's groups:
> - ColKat
> - ColSubKat
> I want to have my subtotal cell of RowKat, in ColKat subtotal scope
> (most outer total of subtotals), to be green where it's value is > 55
> Is it possible?
> Kamel|||thanks, I try that way...
...but mayby somebody know the trick?|||Is there any way to format that using "InScope" function?

Monday, March 12, 2012

Formating issues when exporting to excel

I have several columns in a report that have conditional formating. If
the criteria is met the data in the row is supposed to be green,
otherwise it is black. When I export this to excel, excel looks at the
format of the first row and then sets the formating for all the cells
to that color. Is there a way to make sure excel formats each
individual cell correctly?Also noticed that when i export the report when i run the report
through Visual Studio it exports it correctly. Is this a version issue
with RS?|||Hi, I have the same problems to set the color for each cell. Do you find the
solution? If does, please post back. Thank you.
"acahn@.planetmagpie.com" wrote:
> I have several columns in a report that have conditional formating. If
> the criteria is met the data in the row is supposed to be green,
> otherwise it is black. When I export this to excel, excel looks at the
> format of the first row and then sets the formating for all the cells
> to that color. Is there a way to make sure excel formats each
> individual cell correctly?
>|||Hi Jim,
I have not figured out the problem. I'm hopeing that when we migrate to
reporting services for 2005, that it fixes the issue...
"Jim Pan" wrote:
> Hi, I have the same problems to set the color for each cell. Do you find the
> solution? If does, please post back. Thank you.
> "acahn@.planetmagpie.com" wrote:
> > I have several columns in a report that have conditional formating. If
> > the criteria is met the data in the row is supposed to be green,
> > otherwise it is black. When I export this to excel, excel looks at the
> > format of the first row and then sets the formating for all the cells
> > to that color. Is there a way to make sure excel formats each
> > individual cell correctly?
> >
> >

Wednesday, March 7, 2012

Format Table Row into XML and Insert into Another Table?

First I am using SQL Server 2000 (I think this is easy to do in 2005)

I am trying to do the following:

- Format a table row into an XML string

- Insert the XML string into another table.

Here is what I want to do in a nutshell:

insert into Table1(xml_data)

select * from customers

where customerid = 'alfki'

for xml auto, elements

However, I get the following error: The FOR XML clause is not allowed in a INSERT statement.

I tried a few other formats, such as User Defined Function and etc.

Can this be done? Any ideas?

R

This is not possible in SQL Server 2000 without going through lot of pain on the server-side. So best is to get the XML data to the client and then insert from there.

Format subtotals in matrix report

How can I make the total in the bottom row of a matrix report bold?
Thanks,
James.Clicking on the small green triangle in the upper right hand corner of a
matrix subtotal cell will expose the subtotal row or columns style
properties in the Properties window.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"James Gifford" <jamesgifford88@.hotmail.com> wrote in message
news:uuXJMTvqEHA.3896@.TK2MSFTNGP15.phx.gbl...
> How can I make the total in the bottom row of a matrix report bold?
> Thanks,
> James.
>|||Thanks Bruce.
I spent AGES trying to find out how to do this! I will pay more attention to
green triangles in future.
"Bruce Johnson [MSFT]" <brucejoh@.online.microsoft.com> wrote in message
news:OThulvvqEHA.1160@.tk2msftngp13.phx.gbl...
> Clicking on the small green triangle in the upper right hand corner of a
> matrix subtotal cell will expose the subtotal row or columns style
> properties in the Properties window.
> --
> Bruce Johnson [MSFT]
> Microsoft SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "James Gifford" <jamesgifford88@.hotmail.com> wrote in message
> news:uuXJMTvqEHA.3896@.TK2MSFTNGP15.phx.gbl...
> > How can I make the total in the bottom row of a matrix report bold?
> >
> > Thanks,
> >
> > James.
> >
> >
>

Friday, February 24, 2012

Format display of current row

Hi!

I'm wondering is there any simple way to achieve the following
function call in SQL Server. The sentence to translate is (Oracle
syntax):

to_char(rownum, '000')

rownum: number of the current row

to_char: formats a number (the 1st param) according to the format
defined in the 2nd param. In this case, the '000' preprends 2 or more
zeros until forming a 3-digit number.

I'm using it in something like:

SELECT id_table, string_column || TO_CHAR(ROWNUM,'000') FROM table

Thanx a bunch,
CroNo such thing as a "row number" in SQL Server. Explain what you want to do
so that we can suggest some alternatives.

The Standard SQL alternative to TO_CHAR is the CAST function (CAST(x AS
VARCHAR) or CAST(x AS CHAR)) and that is supported by SQL Server.

--
David Portas
SQL Server MVP
--|||replace(str(123, 3,0),' ', '0')

where 123 is your number, 3 is the lenght(number of zeros to padd) and
0 is the number of decimals places to show

yuck, but it works|||I usually use the following when trying to zero-pad numbers:

SELECT RIGHT('000' + CAST(my_num AS VARCHAR), 3)

-Tom.|||"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message news:<-oWdnSaXw8NBEfXfRVn-iA@.giganews.com>...
> No such thing as a "row number" in SQL Server. Explain what you want to do
> so that we can suggest some alternatives.
> The Standard SQL alternative to TO_CHAR is the CAST function (CAST(x AS
> VARCHAR) or CAST(x AS CHAR)) and that is supported by SQL Server.

The idea behind is creating a stored procedure that retrieves a
numbered list of elements. This list could be displayed in the web, so
it needs to have that "rownum":

SELECT rn, el
FROM (
SELECT <<rownum>> AS rn, element AS el
FROM table
) AS tmp

I've seen some approaches using rank=count(*), but they look ugly.
Could I use something like a temporal sequence in SQL Server?

Thanx again,
Cro|||Why not create the table with a unique column for the display order of
the list elements? If the column is integer, you willnot have to pad a
string with zeroes -- that kind of display is supposed to be done in
the front end, not the database.|||Don Croata (el.croata@.gmail.com) writes:
> The idea behind is creating a stored procedure that retrieves a
> numbered list of elements. This list could be displayed in the web, so
> it needs to have that "rownum":
> SELECT rn, el
> FROM (
> SELECT <<rownum>> AS rn, element AS el
> FROM table
> ) AS tmp
> I've seen some approaches using rank=count(*), but they look ugly.
> Could I use something like a temporal sequence in SQL Server?

There is a row_number() function in SQL 2005, currently in beta.
Beware that this is not a row_number of Oracle fame, but one
related to the actual result set. The syntax is also a little more
complicated. If memory serves, this is derived from the SQL-99 standard.

For SQL-2000 the best bet is probably to say:

CREATE TABLE #t (row_number int IDENTITY,
col1 ...)
INSERT #t (col1, )
SELECT col1, ...
FROM ...
ORDER BY

Note that you cannot use SELECT INTO for this, as it's not guaranteed
that the identity value will follow the ORDER BY clause in this case.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp