Showing posts with label specify. Show all posts
Showing posts with label specify. Show all posts

Monday, March 19, 2012

Dynamic Grouping.. Is it possible?

Hello All,
I have a table with 2 groups in my report. When I edit a group I can
specify the expression to "group on" for the groups.
I would like to be able to make the expression, for the top group, a value
from a report parameter so that the user can specify this when the report
is generated.
The Edit Group Window certainly allows me to pick a report parameter but I
am not sure if it would actually work.. nor what the value of the parameter
should be to make it work. Is this possible?
Example:
Top Group: User Selectable (Country, State, City)
Second Group: Product
Detail Row: Sales data for that product/place combo
So the user could say he would like to see sales grouped by
country/product, state/product, or city/product.
Is this doable without creating 3 different reports?
--
Message posted via http://www.sqlmonster.comTry the following dynamic group expression:
=Fields(Parameters!TopGroup.Value).Value
This requires that the values (or labels) of the TopGroup parameters have
matching field names in your dataset (i.e. Country, State, City).
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Brian W via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:7c78eafd5f1d46329db04bd95646fb57@.SQLMonster.com...
> Hello All,
> I have a table with 2 groups in my report. When I edit a group I can
> specify the expression to "group on" for the groups.
> I would like to be able to make the expression, for the top group, a value
> from a report parameter so that the user can specify this when the report
> is generated.
> The Edit Group Window certainly allows me to pick a report parameter but I
> am not sure if it would actually work.. nor what the value of the
> parameter
> should be to make it work. Is this possible?
> Example:
> Top Group: User Selectable (Country, State, City)
> Second Group: Product
> Detail Row: Sales data for that product/place combo
> So the user could say he would like to see sales grouped by
> country/product, state/product, or city/product.
> Is this doable without creating 3 different reports?
> --
> Message posted via http://www.sqlmonster.com|||Worked like a charm. Thanks.
--
Message posted via http://www.sqlmonster.com

Friday, February 24, 2012

Dynamic Connection String

Hi, Can I pass the connection string dynamically. That means the user will specify the database, he/she wants to connects to and user name and password for the same and display and list of Models/Reports stored in that database.Yes, you can. After all the ConnectionString is just a string. So before you make an SqlConnection, you build up the ConnectionString.


string userName = "Joe";
string password = "****";
string server = "MyDatabaseServer";
string connectionString="user="+userName+";password="+password etc etc

Of course this is a ugly fasttype example. You can beautify this using StringBuilders etc.|||Thanks. But, I wanted to know how this can be passed dynamically when the user runs the report from the report server. Which means, the report is already designed and published on the report server. Firstly, can a report/report model be designed on dynamic connection string.|||I think the question was about dynamic connection strings in Reporting Services. This is a feature of SQL Server 2005 Reporting Services. There are a couple of workarounds for SQL 2000 RS (stored procs, cross database queries, etc.).