Showing posts with label reports. Show all posts
Showing posts with label reports. Show all posts

Friday, March 30, 2012

Rows and Columns

I have a query that reports all of the data I want. However it creates about 40 columns and 10 rows. I would like to swap the display so that it shows 10 columns and 40 rows, which would cause it to print out more readable. Can it be done?Are you using SQL Server 2005 or SQL Server 2000?|||

Hi,

in SQL Server 200 oyu will have to use appropiate CASE expressions, in SQL Server 2005 you can use the new PIVOT functionality-

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

I am using SQL 2000 which someone else said needed a CASE statement. What I have seen seems to want to add things. What I have is a list of numbers and then columns that are the results of my Query.

I have columns named Store , Name, Net, Tax, Deposits (and a bunch of others)

I have rows with the store numbers 2, 3, 4, 5 ,6 that I sort by

I would like the columns as rows and the store numbers across the top

Thanks

sql

Monday, March 26, 2012

Rowcount on reports

Is there a way to display a rowcount for a report?
If so what does the function look like?
Thanks in advance,
JohnWhat about RowNumber() ?
Jens Suessmeyer.
"John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
news:D83E5AAB-FEED-4396-88BD-75E682236E76@.microsoft.com...
> Is there a way to display a rowcount for a report?
> If so what does the function look like?
> Thanks in advance,
> John|||Thanks for the quick reply Jens.
I have added a header textbox called Rows (label),
and onother with a function of =rownumber().
I am getting a compilation error of:
report1.rdl The value expression for the textbox â'RowsTextboxâ' has an
incorrect number of parameters for the function â'rownumberâ'.
If I change the function to =rownumber("Report1") I get this:
report1.rdl The value expression for the textbox â'RowsTextboxâ' uses the
function RowNumber. RowNumber cannot be used in page headers or footers.
How can I use rownumber()?
Thanks.
John
"Jens Sü�meyer" wrote:
> What about RowNumber() ?
> Jens Suessmeyer.
> "John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:D83E5AAB-FEED-4396-88BD-75E682236E76@.microsoft.com...
> > Is there a way to display a rowcount for a report?
> > If so what does the function look like?
> >
> > Thanks in advance,
> > John
>
>|||You can use =RowNumber(Nothing)
or =RowNumber("<name of report dataset>")
Look in Books Online for more information, as the function can be used with
a group name parameter and a data region name also instead of name of report
dataset. Note that the argument is case sensitive.
Charles Kangai, MCDBA, MCT
"John K" wrote:
> Thanks for the quick reply Jens.
> I have added a header textbox called Rows (label),
> and onother with a function of =rownumber().
> I am getting a compilation error of:
> report1.rdl The value expression for the textbox â'RowsTextboxâ' has an
> incorrect number of parameters for the function â'rownumberâ'.
> If I change the function to =rownumber("Report1") I get this:
> report1.rdl The value expression for the textbox â'RowsTextboxâ' uses the
> function RowNumber. RowNumber cannot be used in page headers or footers.
> How can I use rownumber()?
>
> Thanks.
> John
>
> "Jens Sü�meyer" wrote:
> > What about RowNumber() ?
> >
> > Jens Suessmeyer.
> >
> > "John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
> > news:D83E5AAB-FEED-4396-88BD-75E682236E76@.microsoft.com...
> > > Is there a way to display a rowcount for a report?
> > > If so what does the function look like?
> > >
> > > Thanks in advance,
> > > John
> >
> >
> >|||The is Rownumber, but you have to count something with it, perhaps Nothing,
so the whole expression would be =Rownumber(Nothing).
Try this.
HTH, Jens Suessmeyer.
--
http://www.sqlserver2005.de
--
"John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
news:085867DD-4240-43DA-A5E8-9A16BEB14F45@.microsoft.com...
> Thanks for the quick reply Jens.
> I have added a header textbox called Rows (label),
> and onother with a function of =rownumber().
> I am getting a compilation error of:
> report1.rdl The value expression for the textbox 'RowsTextbox' has an
> incorrect number of parameters for the function 'rownumber'.
> If I change the function to =rownumber("Report1") I get this:
> report1.rdl The value expression for the textbox 'RowsTextbox' uses the
> function RowNumber. RowNumber cannot be used in page headers or footers.
> How can I use rownumber()?
>
> Thanks.
> John
>
> "Jens Süßmeyer" wrote:
>> What about RowNumber() ?
>> Jens Suessmeyer.
>> "John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
>> news:D83E5AAB-FEED-4396-88BD-75E682236E76@.microsoft.com...
>> > Is there a way to display a rowcount for a report?
>> > If so what does the function look like?
>> >
>> > Thanks in advance,
>> > John
>>|||Thanks Jens,
Got it to work.
"Jens Sü�meyer" wrote:
> The is Rownumber, but you have to count something with it, perhaps Nothing,
> so the whole expression would be =Rownumber(Nothing).
> Try this.
> HTH, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
> "John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:085867DD-4240-43DA-A5E8-9A16BEB14F45@.microsoft.com...
> > Thanks for the quick reply Jens.
> >
> > I have added a header textbox called Rows (label),
> > and onother with a function of =rownumber().
> >
> > I am getting a compilation error of:
> >
> > report1.rdl The value expression for the textbox 'RowsTextbox' has an
> > incorrect number of parameters for the function 'rownumber'.
> >
> > If I change the function to =rownumber("Report1") I get this:
> >
> > report1.rdl The value expression for the textbox 'RowsTextbox' uses the
> > function RowNumber. RowNumber cannot be used in page headers or footers.
> >
> > How can I use rownumber()?
> >
> >
> > Thanks.
> > John
> >
> >
> > "Jens Sü�meyer" wrote:
> >
> >> What about RowNumber() ?
> >>
> >> Jens Suessmeyer.
> >>
> >> "John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
> >> news:D83E5AAB-FEED-4396-88BD-75E682236E76@.microsoft.com...
> >> > Is there a way to display a rowcount for a report?
> >> > If so what does the function look like?
> >> >
> >> > Thanks in advance,
> >> > John
> >>
> >>
> >>
>
>|||Thanks Charles,
Got it to work.
--
"Charles Kangai" wrote:
> You can use =RowNumber(Nothing)
> or =RowNumber("<name of report dataset>")
> Look in Books Online for more information, as the function can be used with
> a group name parameter and a data region name also instead of name of report
> dataset. Note that the argument is case sensitive.
> Charles Kangai, MCDBA, MCT
> "John K" wrote:
> > Thanks for the quick reply Jens.
> >
> > I have added a header textbox called Rows (label),
> > and onother with a function of =rownumber().
> >
> > I am getting a compilation error of:
> >
> > report1.rdl The value expression for the textbox â'RowsTextboxâ' has an
> > incorrect number of parameters for the function â'rownumberâ'.
> >
> > If I change the function to =rownumber("Report1") I get this:
> >
> > report1.rdl The value expression for the textbox â'RowsTextboxâ' uses the
> > function RowNumber. RowNumber cannot be used in page headers or footers.
> >
> > How can I use rownumber()?
> >
> >
> > Thanks.
> > John
> >
> >
> > "Jens Sü�meyer" wrote:
> >
> > > What about RowNumber() ?
> > >
> > > Jens Suessmeyer.
> > >
> > > "John K" <JohnK@.discussions.microsoft.com> schrieb im Newsbeitrag
> > > news:D83E5AAB-FEED-4396-88BD-75E682236E76@.microsoft.com...
> > > > Is there a way to display a rowcount for a report?
> > > > If so what does the function look like?
> > > >
> > > > Thanks in advance,
> > > > John
> > >
> > >
> > >