Showing posts with label columns. Show all posts
Showing posts with label columns. Show all posts

Wednesday, March 28, 2012

How to show rows of dataset as columns in report

Hi,
I have a dataset whose rows need to shown as columns of a table in report.
Is it possible to do so?
Please help
regards,
SachinCan you use a matrix instead of a table?
"Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
news:5E1EAF65-33C1-4D19-B230-D4826ACA3BA7@.microsoft.com...
> Hi,
> I have a dataset whose rows need to shown as columns of a table in report.
> Is it possible to do so?
> Please help
> regards,
> Sachin|||Hi,
I am quite new to reporting services.
Wll matrix solve my problem?
Please help.
regards,
Sachin.
"Steve MunLeeuw" wrote:
> Can you use a matrix instead of a table?
> "Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
> news:5E1EAF65-33C1-4D19-B230-D4826ACA3BA7@.microsoft.com...
> > Hi,
> >
> > I have a dataset whose rows need to shown as columns of a table in report.
> > Is it possible to do so?
> >
> > Please help
> > regards,
> > Sachin
>
>|||I think that it will. The Adventure Works Sample Reports that ships with
SSRS 2005 has a Company Sales report that demonstrates the use of the
matrix. It has Order Year and Order Qtr as columns across the top.
"Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
news:334F642D-F816-46FD-BBF4-7F8D1E0B8276@.microsoft.com...
> Hi,
> I am quite new to reporting services.
> Wll matrix solve my problem?
> Please help.
> regards,
> Sachin.
>
> "Steve MunLeeuw" wrote:
>> Can you use a matrix instead of a table?
>> "Sachin Laddha" <SachinLaddha@.discussions.microsoft.com> wrote in message
>> news:5E1EAF65-33C1-4D19-B230-D4826ACA3BA7@.microsoft.com...
>> > Hi,
>> >
>> > I have a dataset whose rows need to shown as columns of a table in
>> > report.
>> > Is it possible to do so?
>> >
>> > Please help
>> > regards,
>> > Sachin
>>sql

How to show new Columns when user clicks on a cell in a report ?

Hi,
I have a requirement in my project which specifies that when the user clicks
on the drill down(or a cell), the report should show new columns which
basically describes the details of the drilldown action. Is it possible to
show new columns on drill down ? Currenlty Iam using Jump to Report
navigation property to show the details in a new report. Basically I want
new columns(which describe the cell clicked, for eg if the cell clicked is
total of all payments, I want to show details of the payment when user
clicks on it ) when user clicks on the cell. If I use drill down then all
detail columns are blank befor drill down action. Can anyone help me in
doing this ?
--
Thanks,
RKOn Oct 16, 3:59 pm, "S V Ramakrishna"
<ramakrishna.seeth...@.translogicsys.com> wrote:
> Hi,
> I have a requirement in my project which specifies that when the user clicks
> on the drill down(or a cell), the report should show new columns which
> basically describes the details of the drilldown action. Is it possible to
> show new columns on drill down ? Currenlty Iam using Jump to Report
> navigation property to show the details in a new report. Basically I want
> new columns(which describe the cell clicked, for eg if the cell clicked is
> total of all payments, I want to show details of the payment when user
> clicks on it ) when user clicks on the cell. If I use drill down then all
> detail columns are blank befor drill down action. Can anyone help me in
> doing this ?
> --
> Thanks,
> RK
Hi!
whene you use navigation and jum to report ,you can see parameters in
front of this,you must difine parameter in the second report and in
first report in property -navigation-parameter ,you choose your
parameter and fill your parameter with one field of dataset .
Regards.

Monday, March 26, 2012

how to show columns with two decimal places

HI ,

I've table whose output is some coumns. The colums show 6 digits after decimal point . My problem is i want to show only two digits after decimal point .. How to do using query..

Thanks

From your question i seem that you are having the FLOAT datatype. You can do this in two ways

1) Modify the table column to DECIMAL(10,2), if you always want to have results in the 2 deciaml place

or

2) SELECT cast (2.456576 AS decimal(10,2)), if you want temp. solution.

Note: This will Round-off the values.

Gurpreet S. Gill

|||

You can use the following approaches,

With Rounded Value:

select convert(Numeric(7,2),ColumnName) From TableName

here it will round/adjust your number to 2 digit decimal

Without Rounded Value:

Select Convert(Numeric(7,2), Round(ColumnName,2,1)) From TableName

here it will truncate the number upto 2 digit decimal and it only show the 2 digit dicimal on your output

|||

Two best practices:

1. The best thing to do is change the table to store the data as the datatype you want to use.

2. If the data needs to be stored like this, but you want to display it this way, the absolute best way of doing this is to use the front end to format the data as you want it. The front end already has to work to display the data in some format, so specifying it as you desire will be best

If you need to do it in T-SQL, then the other replies to use CAST is the next best thing.

|||Already my table datatype is fixed i can't change the datatype. I'm just show output in gridview ...Tell me something which can be done in Grid view or else i've change the whole datatype of table|||As suggested by others, i too says "the best place to do this is the FRONT END". As, when the front end read the data from Database, it internally converts the data into its readable form.

ok tell us which Language you are using & its version ?
which Grid ? and other information. like connection type ...etc.

Gurpreet S. Gill|||Hi i'm using asp.net Grid View (vb.net)|||This may help you
http://www.netomatix.com/development/GridViewDataFormatting.aspx

More reading regarding the "DataFormatString"
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.dataformatstring.aspx
http://devauthority.com/blogs/sskokku/archive/2006/08/17/1962.aspx

Gurpreet S.Gill|||More Reading
this the exactly what you want
http://forums.asp.net/thread/1463906.aspx
http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET07/aspnet07-01.aspx

Gurpreet S. Gil

how to show columns with two decimal places

HI ,

I've table whose output is some coumns. The colums show 6 digits after decimal point . My problem is i want to show only two digits after decimal point .. How to do using query..

Thanks

From your question i seem that you are having the FLOAT datatype. You can do this in two ways

1) Modify the table column to DECIMAL(10,2), if you always want to have results in the 2 deciaml place

or

2) SELECT cast (2.456576 AS decimal(10,2)), if you want temp. solution.

Note: This will Round-off the values.

Gurpreet S. Gill

|||

You can use the following approaches,

With Rounded Value:

select convert(Numeric(7,2),ColumnName) From TableName

here it will round/adjust your number to 2 digit decimal

Without Rounded Value:

Select Convert(Numeric(7,2), Round(ColumnName,2,1)) From TableName

here it will truncate the number upto 2 digit decimal and it only show the 2 digit dicimal on your output

|||

Two best practices:

1. The best thing to do is change the table to store the data as the datatype you want to use.

2. If the data needs to be stored like this, but you want to display it this way, the absolute best way of doing this is to use the front end to format the data as you want it. The front end already has to work to display the data in some format, so specifying it as you desire will be best

If you need to do it in T-SQL, then the other replies to use CAST is the next best thing.

|||Already my table datatype is fixed i can't change the datatype. I'm just show output in gridview ...Tell me something which can be done in Grid view or else i've change the whole datatype of table|||As suggested by others, i too says "the best place to do this is the FRONT END". As, when the front end read the data from Database, it internally converts the data into its readable form.

ok tell us which Language you are using & its version ?
which Grid ? and other information. like connection type ...etc.

Gurpreet S. Gill|||Hi i'm using asp.net Grid View (vb.net)|||This may help you
http://www.netomatix.com/development/GridViewDataFormatting.aspx

More reading regarding the "DataFormatString"
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.boundfield.dataformatstring.aspx
http://devauthority.com/blogs/sskokku/archive/2006/08/17/1962.aspx

Gurpreet S.Gill|||More Reading
this the exactly what you want
http://forums.asp.net/thread/1463906.aspx
http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET07/aspnet07-01.aspx

Gurpreet S. Gilsql

How to show all field names and data in two columns i.e. Pivot / c

What we would like to do is to pivot a table with 300 columns into one that
is just two columns. The first column containing the field name and the
second column containing the value of that column.
This also includes a where clause to filter the recordset. e.g where id =
'123'
Hi
I think you are actually looking to UNPIVOT the data such as
http://www.umachandar.com/technical/...pts/Main25.htm
You will probably be better doing this client side.
John
"Smartbiz" <Smartbiz@.discussions.microsoft.com> wrote in message
news:35458430-363D-42C7-B3C0-879EE294ED1B@.microsoft.com...
> What we would like to do is to pivot a table with 300 columns into one
> that
> is just two columns. The first column containing the field name and the
> second column containing the value of that column.
> This also includes a where clause to filter the recordset. e.g where id =
> '123'
sql

How to show all field names and data in two columns i.e. Pivot / c

What we would like to do is to pivot a table with 300 columns into one that
is just two columns. The first column containing the field name and the
second column containing the value of that column.
This also includes a where clause to filter the recordset. e.g where id =
'123'Hi
I think you are actually looking to UNPIVOT the data such as
http://www.umachandar.com/technical...ipts/Main25.htm
You will probably be better doing this client side.
John
"Smartbiz" <Smartbiz@.discussions.microsoft.com> wrote in message
news:35458430-363D-42C7-B3C0-879EE294ED1B@.microsoft.com...
> What we would like to do is to pivot a table with 300 columns into one
> that
> is just two columns. The first column containing the field name and the
> second column containing the value of that column.
> This also includes a where clause to filter the recordset. e.g where id =
> '123'

How to show all field names and data in two columns i.e. Pivot / c

What we would like to do is to pivot a table with 300 columns into one that
is just two columns. The first column containing the field name and the
second column containing the value of that column.
This also includes a where clause to filter the recordset. e.g where id = '123'Hi
I think you are actually looking to UNPIVOT the data such as
http://www.umachandar.com/technical/SQL6x70Scripts/Main25.htm
You will probably be better doing this client side.
John
"Smartbiz" <Smartbiz@.discussions.microsoft.com> wrote in message
news:35458430-363D-42C7-B3C0-879EE294ED1B@.microsoft.com...
> What we would like to do is to pivot a table with 300 columns into one
> that
> is just two columns. The first column containing the field name and the
> second column containing the value of that column.
> This also includes a where clause to filter the recordset. e.g where id => '123'

Wednesday, March 7, 2012

how to set multiple local variable from single select statement

is it possible to set the value of multiple local variables using just 1
statement. For example assume a simple table 'E' with 3 columns 'empID',
'empName', 'empToken'. I can get their values with
declare @.ENAME as char(30), @.ETOKEN as int
SET @.ENAME = (SELECT empName FROM E WHERE empID = 1)
SET @.ETOKEN = (SELECT empToken FROM E WHERE empID = 1)
What I want to do is compine the two assignments into 1 single statement so
that the db never has to be looked up more than once. e.g.
SET @.ENAME, @.ETOKEN = (SELECT empName, empToken FROM E WHERE empID = 1)
is this possible and if it is, what is the synthax?try this.. hope this helps.
SELECT @.ENAME = empName,
@.ETOKEN = empToken
FROM E WHERE empID = 1
--|||HI,
sure:
SELECT @.ENAME = empName , @.ETOKEN = emptoken FROM E WHERE empID = 1
HTH, jens Suessmeyer.
http://www.sqlserver2005.de
--

How to set Grow column and row height in crosstab reports

hello guys,
i am working with crystal report 9.0, i have one report that contains multiple columns in crosstab. but in this report column and row headings are not growing according to content length and overlapping on other column and row values. also can grow option is disabled for row and column headings in crosstab. can anybody help me to solve this problem.you need to manually increase the width as much as possible

Sunday, February 19, 2012

How to set a column to be an identity column in TSQL.

Can someone provide the syntax for setting a column to be an identity column
in a stored proceedure. When I export my database, my identity columns are
no longer identity columns.I don't beleive you can add an Identity property to an existing column.
You may need to create a temp table with the identity column in it, copy the
data to the temp table, drop the existing table and then rename your temp
one.
"Jim Mitchell" <jim_mitchell@.mindspring.com> wrote in message
news:uSn1WWFfDHA.1732@.TK2MSFTNGP12.phx.gbl...
> Can someone provide the syntax for setting a column to be an identity
column
> in a stored proceedure. When I export my database, my identity columns
are
> no longer identity columns.
>