Showing posts with label category. Show all posts
Showing posts with label category. Show all posts

Thursday, March 8, 2012

Changing Row Height Question

I have a report of Assets where I let the user decide if they want to group
on the Asset category or not. If they choose a Group from the Parameter
list, the report puts the Asset Category in the Group Header. If they choose
not to group, then it puts nothing in the Group Header. However, this leaves
a blank spot that doesn't look right. How can get rid of the Group Header if
the user selects '<None>' from the parameter list?
The first field in my Group Header looks like this:
=IIF(Parameters!GroupOn.Value = "Asset Category",
Fields!AssetCategory.Value, "")
--
Thank You!Hi,
Go to the parameters, in the visibility , click on the epression and type
the expression and it will hide accordingly.
OR right click the group,click edit group,click visibility and do the
expression there as well.
cheers
"Shane Eckel" wrote:
> I have a report of Assets where I let the user decide if they want to group
> on the Asset category or not. If they choose a Group from the Parameter
> list, the report puts the Asset Category in the Group Header. If they choose
> not to group, then it puts nothing in the Group Header. However, this leaves
> a blank spot that doesn't look right. How can get rid of the Group Header if
> the user selects '<None>' from the parameter list?
> The first field in my Group Header looks like this:
> =IIF(Parameters!GroupOn.Value = "Asset Category",
> Fields!AssetCategory.Value, "")
> --
> Thank You!|||Nice, I'll try this right now. Thanks for taking the time to reply to my
inquiry.
Take care,
Shane
"Bismi" wrote:
> Hi,
> Go to the parameters, in the visibility , click on the epression and type
> the expression and it will hide accordingly.
> OR right click the group,click edit group,click visibility and do the
> expression there as well.
> cheers
> "Shane Eckel" wrote:
> > I have a report of Assets where I let the user decide if they want to group
> > on the Asset category or not. If they choose a Group from the Parameter
> > list, the report puts the Asset Category in the Group Header. If they choose
> > not to group, then it puts nothing in the Group Header. However, this leaves
> > a blank spot that doesn't look right. How can get rid of the Group Header if
> > the user selects '<None>' from the parameter list?
> >
> > The first field in my Group Header looks like this:
> > =IIF(Parameters!GroupOn.Value = "Asset Category",
> > Fields!AssetCategory.Value, "")
> > --
> > Thank You!|||Thanks for posting this answer, but it isn't behaving correctly.
If I put the expression on the Edit Group level, the entire group hides.
If I put the expression on the textbox, the text within the field hides, but
the row does not shrink.
Any other ideas?
--
Thank You!
"Bismi" wrote:
> Hi,
> Go to the parameters, in the visibility , click on the epression and type
> the expression and it will hide accordingly.
> OR right click the group,click edit group,click visibility and do the
> expression there as well.
> cheers
> "Shane Eckel" wrote:
> > I have a report of Assets where I let the user decide if they want to group
> > on the Asset category or not. If they choose a Group from the Parameter
> > list, the report puts the Asset Category in the Group Header. If they choose
> > not to group, then it puts nothing in the Group Header. However, this leaves
> > a blank spot that doesn't look right. How can get rid of the Group Header if
> > the user selects '<None>' from the parameter list?
> >
> > The first field in my Group Header looks like this:
> > =IIF(Parameters!GroupOn.Value = "Asset Category",
> > Fields!AssetCategory.Value, "")
> > --
> > Thank You!

Saturday, February 25, 2012

Changing ORDER BY

Hi All
win 2k pro sql 2k IIS 5 ASP-vbscript
I got a stored proc which basically returns a set of records depending
on a category ID (or all if passed ID =0) - see below
The FAQ Category below is retuned mostly order by Title but in some
other areas of my site I need to return it orded by CatID.
I was wondering whats the best way to do this as I cant seem to pass a
column name to the procedure and put "ORDER BY @.SortOrder"
These are the other ways I thought of.
1) create a new procedure the same with order by catID.
2) pass a number and use CASE - but I get error 1008
eg ORDER BY CASE WHEN @.Order=0 THEN Title ELSE CatID END
I can see this becoming a common problem so wouldn't like to do #1
above as that would require alot of maintence to keep them the same if
I changed any of the table design.
Thanks for any help.
Al
CREATE PROCEDURE dbo.usp_Help_FindFAQCategoryByCatID
@.SelCatID TINYINT = 0
AS
SET NOCOUNT ON
-- Return all the FAQ Categories with Cat ID of the selected Category
SELECT CatID, ParentID, Title, FaqCount
FROM Help_FAQ_Categories
WHERE CatID= CASE WHEN @.SelCatID=0 THEN CatID ELSE @.SelCatID END
ORDER BY Title
GOTry
ORDER BY CASE WHEN @.sort = 'col1' THEN col1 END ASC,
"Harag" <harag@.softhome.net> wrote in message
news:3v4mlvo18e9vbjisl08jqrs9m75pc240gd@.4ax.com...
> Hi All
> win 2k pro sql 2k IIS 5 ASP-vbscript
> I got a stored proc which basically returns a set of records depending
> on a category ID (or all if passed ID =0) - see below
> The FAQ Category below is retuned mostly order by Title but in some
> other areas of my site I need to return it orded by CatID.
> I was wondering whats the best way to do this as I cant seem to pass a
> column name to the procedure and put "ORDER BY @.SortOrder"
> These are the other ways I thought of.
> 1) create a new procedure the same with order by catID.
> 2) pass a number and use CASE - but I get error 1008
> eg ORDER BY CASE WHEN @.Order=0 THEN Title ELSE CatID END
>
> I can see this becoming a common problem so wouldn't like to do #1
> above as that would require alot of maintence to keep them the same if
> I changed any of the table design.
> Thanks for any help.
> Al
>
> CREATE PROCEDURE dbo.usp_Help_FindFAQCategoryByCatID
> @.SelCatID TINYINT = 0
> AS
> SET NOCOUNT ON
> -- Return all the FAQ Categories with Cat ID of the selected Category
> SELECT CatID, ParentID, Title, FaqCount
> FROM Help_FAQ_Categories
> WHERE CatID=> CASE WHEN @.SelCatID=0 THEN CatID ELSE @.SelCatID END
> ORDER BY Title
> GO
>|||Harag,
it is almost correct. However, you cannot mix data types without
explicit conversions. The typical solution to this type of problem is to
use an ORDER BY column for each sort order:
ORDER BY CASE WHEN @.Order=0 THEN Title END,
CASE WHEN @.Order=1 THEN CatID END
Gert-Jan
Harag wrote:
> Hi All
> win 2k pro sql 2k IIS 5 ASP-vbscript
> I got a stored proc which basically returns a set of records depending
> on a category ID (or all if passed ID =0) - see below
> The FAQ Category below is retuned mostly order by Title but in some
> other areas of my site I need to return it orded by CatID.
> I was wondering whats the best way to do this as I cant seem to pass a
> column name to the procedure and put "ORDER BY @.SortOrder"
> These are the other ways I thought of.
> 1) create a new procedure the same with order by catID.
> 2) pass a number and use CASE - but I get error 1008
> eg ORDER BY CASE WHEN @.Order=0 THEN Title ELSE CatID END
> I can see this becoming a common problem so wouldn't like to do #1
> above as that would require alot of maintence to keep them the same if
> I changed any of the table design.
> Thanks for any help.
> Al
> CREATE PROCEDURE dbo.usp_Help_FindFAQCategoryByCatID
> @.SelCatID TINYINT = 0
> AS
> SET NOCOUNT ON
> -- Return all the FAQ Categories with Cat ID of the selected Category
> SELECT CatID, ParentID, Title, FaqCount
> FROM Help_FAQ_Categories
> WHERE CatID=> CASE WHEN @.SelCatID=0 THEN CatID ELSE @.SelCatID END
> ORDER BY Title
> GO|||Cool thanks guys this is what I wanted and will save alot of
maintence. :)
Thanks again
Al
On Sun, 07 Sep 2003 14:01:35 +0200, Gert-Jan Strik
<sorry@.toomuchspamalready.nl> wrote:
>Harag,
>it is almost correct. However, you cannot mix data types without
>explicit conversions. The typical solution to this type of problem is to
>use an ORDER BY column for each sort order:
>ORDER BY CASE WHEN @.Order=0 THEN Title END,
> CASE WHEN @.Order=1 THEN CatID END
>Gert-Jan
>
>Harag wrote:
>> Hi All
>> win 2k pro sql 2k IIS 5 ASP-vbscript
>> I got a stored proc which basically returns a set of records depending
>> on a category ID (or all if passed ID =0) - see below
>> The FAQ Category below is retuned mostly order by Title but in some
>> other areas of my site I need to return it orded by CatID.
>> I was wondering whats the best way to do this as I cant seem to pass a
>> column name to the procedure and put "ORDER BY @.SortOrder"
>> These are the other ways I thought of.
>> 1) create a new procedure the same with order by catID.
>> 2) pass a number and use CASE - but I get error 1008
>> eg ORDER BY CASE WHEN @.Order=0 THEN Title ELSE CatID END
>> I can see this becoming a common problem so wouldn't like to do #1
>> above as that would require alot of maintence to keep them the same if
>> I changed any of the table design.
>> Thanks for any help.
>> Al
>> CREATE PROCEDURE dbo.usp_Help_FindFAQCategoryByCatID
>> @.SelCatID TINYINT = 0
>> AS
>> SET NOCOUNT ON
>> -- Return all the FAQ Categories with Cat ID of the selected Category
>> SELECT CatID, ParentID, Title, FaqCount
>> FROM Help_FAQ_Categories
>> WHERE CatID=>> CASE WHEN @.SelCatID=0 THEN CatID ELSE @.SelCatID END
>> ORDER BY Title
>> GO