Showing posts with label setting. Show all posts
Showing posts with label setting. Show all posts

Wednesday, March 28, 2012

Report parameter as a where clause

Hello

Is it possible to construct a dataset where the parameter of the report is the where clause?

I have tried setting the dataset of the report to be a variable to execute, but any time I introduce the parameter into the dataset, the report will not run.

Hi,

you want to use parameter in the report use @.parameter_name.

|||Here's what I want to do...

SELECT name, phone FROM contacts WHERE @.parameter_name

This does not work.

I have also tried, but it does not work:

DECLARE @.s AS nvarchar(1000)
SET @.s = N'SELECT name, phone FROM contacts WHERE ' + @.parameter_name
EXEC sp_executesql @.s

|||

You need to set your procedure up properly:

@.Parameter_Name varchar(1000) = null

,

AS

SELECT NAME, PHONE

FROM CONTACTS

WHERE NAME = @.Parameter_Name

|||Thanks for your reply, but I need you to further clarify.

From your example, it is expecting to define the value for 'NAME'. What I want to do is to have the *entire* where clause as a parameter. e.g. @.whereclause = WHERE name = 'bob' and phone = '2222'

|||*bump* can any of the experts look into this?
|||

Hi ajhuddy!

Jim is correct in that you need to base your parameter values against a fieldname. In your example this should work:

SELECT NAME, PHONE

FROM CONTACTS

WHERE NAME IN(@.Parameter_Name) AND PHONE IN(@.Parameter_Phone)

This query will pull in all selected parameter values into your report.|||Thanks for the reply Chuck,

So is there any humanly possible way to make the parameter the entire where clause? I don't want to the SQL statement of the report to be hard-wired for all the possible fields. E.g. @.whereclause = "WHERE name = bob or phone = 2222"

This is an important requirement for me, as I need the user to be able to create advanced 'where' criteria before launching the report.
|||

Hi,

If I understand you correctly this is an example on how to use dynamic SQL:


Code Snippet

DECLARE @.select NVARCHAR(1000)
DECLARE @.from NVARCHAR(1000)
DECLARE @.where NVARCHAR(1000)
DECLARE @.QueryString NVARCHAR(3003)

SET @.select = 'SELECT <Columns> '
SET @.from = 'FROM <Table> '
SET @.where = 'WHERE <WherePart>'
SET @.QueryString = @.select + @.from + @.where

EXEC sp_executesql @.QueryString

If you work with char datatypes in your where clause,you will have to double the quotes

Code Snippet

SET @.where = 'WHERE name = ''YourValue'''

|||

Hi,

This is an important requirement for me, as I need the user to be able to create advanced 'where' criteria before launching the report.

Did you have a look at report builder?

HTH,

|||Aiwa,

Thanks very much for the reply. This is exactly what I want to do. In your example, are you inferring that @.where is the parameter for the report? If so, this is what I have been trying to do, but I get errors for each field on the report. E.g. :

[rsFieldReference] The Value expression for the textbox ‘b_name’ refers to the field ‘b_name’. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.

Aiwa wrote:

Hi,

If I understand you correctly this is an example on how to use dynamic SQL:


Code Snippet

DECLARE @.select NVARCHAR(1000)
DECLARE @.from NVARCHAR(1000)
DECLARE @.where NVARCHAR(1000)
DECLARE @.QueryString NVARCHAR(3003)

SET @.select = 'SELECT <Columns> '
SET @.from = 'FROM <Table> '
SET @.where = 'WHERE <WherePart>'
SET @.QueryString = @.select + @.from + @.where

EXEC sp_executesql @.QueryString

If you work with char datatypes in your where clause,you will have to double the quotes

Code Snippet

SET @.where = 'WHERE name = ''YourValue'''

|||

Aiwa wrote:

Hi,

This is an important requirement for me, as I need the user to be able to create advanced 'where' criteria before launching the report.

Did you have a look at report builder?

HTH,

Aiwa,

Yes, I did look at the report builder, and it is great - but it can only create simple reports. Ideally, the 'filter' option that exists in the report builder would exist in the standard reports.
|||Please see this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2041825&SiteID=1&mode=1sql

Report parameter as a where clause

Hello

Is it possible to construct a dataset where the parameter of the report is the where clause?

I have tried setting the dataset of the report to be a variable to execute, but any time I introduce the parameter into the dataset, the report will not run.

Hi,

you want to use parameter in the report use @.parameter_name.

|||Here's what I want to do...

SELECT name, phone FROM contacts WHERE @.parameter_name

This does not work.

I have also tried, but it does not work:

DECLARE @.s AS nvarchar(1000)
SET @.s = N'SELECT name, phone FROM contacts WHERE ' + @.parameter_name
EXEC sp_executesql @.s

|||

You need to set your procedure up properly:

@.Parameter_Name varchar(1000) = null

,

AS

SELECT NAME, PHONE

FROM CONTACTS

WHERE NAME = @.Parameter_Name

|||Thanks for your reply, but I need you to further clarify.

From your example, it is expecting to define the value for 'NAME'. What I want to do is to have the *entire* where clause as a parameter. e.g. @.whereclause = WHERE name = 'bob' and phone = '2222'

|||*bump* can any of the experts look into this?
|||

Hi ajhuddy!

Jim is correct in that you need to base your parameter values against a fieldname. In your example this should work:

SELECT NAME, PHONE

FROM CONTACTS

WHERE NAME IN(@.Parameter_Name) AND PHONE IN(@.Parameter_Phone)

This query will pull in all selected parameter values into your report.|||Thanks for the reply Chuck,

So is there any humanly possible way to make the parameter the entire where clause? I don't want to the SQL statement of the report to be hard-wired for all the possible fields. E.g. @.whereclause = "WHERE name = bob or phone = 2222"

This is an important requirement for me, as I need the user to be able to create advanced 'where' criteria before launching the report.
|||

Hi,

If I understand you correctly this is an example on how to use dynamic SQL:


Code Snippet

DECLARE @.select NVARCHAR(1000)
DECLARE @.from NVARCHAR(1000)
DECLARE @.where NVARCHAR(1000)
DECLARE @.QueryString NVARCHAR(3003)

SET @.select = 'SELECT <Columns> '
SET @.from = 'FROM <Table> '
SET @.where = 'WHERE <WherePart>'
SET @.QueryString = @.select + @.from + @.where

EXEC sp_executesql @.QueryString

If you work with char datatypes in your where clause,you will have to double the quotes

Code Snippet

SET @.where = 'WHERE name = ''YourValue'''

|||

Hi,

This is an important requirement for me, as I need the user to be able to create advanced 'where' criteria before launching the report.

Did you have a look at report builder?

HTH,

|||Aiwa,

Thanks very much for the reply. This is exactly what I want to do. In your example, are you inferring that @.where is the parameter for the report? If so, this is what I have been trying to do, but I get errors for each field on the report. E.g. :

[rsFieldReference] The Value expression for the textbox ‘b_name’ refers to the field ‘b_name’. Report item expressions can only refer to fields within the current data set scope or, if inside an aggregate, the specified data set scope.

Aiwa wrote:

Hi,

If I understand you correctly this is an example on how to use dynamic SQL:


Code Snippet

DECLARE @.select NVARCHAR(1000)
DECLARE @.from NVARCHAR(1000)
DECLARE @.where NVARCHAR(1000)
DECLARE @.QueryString NVARCHAR(3003)

SET @.select = 'SELECT <Columns> '
SET @.from = 'FROM <Table> '
SET @.where = 'WHERE <WherePart>'
SET @.QueryString = @.select + @.from + @.where

EXEC sp_executesql @.QueryString

If you work with char datatypes in your where clause,you will have to double the quotes

Code Snippet

SET @.where = 'WHERE name = ''YourValue'''

|||

Aiwa wrote:

Hi,

This is an important requirement for me, as I need the user to be able to create advanced 'where' criteria before launching the report.

Did you have a look at report builder?

HTH,

Aiwa,

Yes, I did look at the report builder, and it is great - but it can only create simple reports. Ideally, the 'filter' option that exists in the report builder would exist in the standard reports.
|||Please see this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2041825&SiteID=1&mode=1

Tuesday, March 20, 2012

Report Manager Virtual Directory disabled

Hi,
I have problem with Reporting Services 2005 configuration on Win2k3.
Every setting has green mark, except Rprt Manager Virtual Directory
which is grey and Web Service Identity has not configured mark. And I'm
aware that during instalation RS didn't add Reports dir to IIS, but I
don't know why.
Has anyone met with that problem?
Regards,
BartoloHi,
Yes I have just this same problem - but on an XP machine with SP2 (needed
for a demo setup).
Complete new install of SQLExpress Adv version. ReportServer is installed,
but Report Manager is grayed out.
Any resolution anyone please '.
Regards
Graham
"Bartolo" <andrew.osa@.gmail.com> wrote in message
news:1152266153.281436.141940@.k73g2000cwa.googlegroups.com...
> Hi,
> I have problem with Reporting Services 2005 configuration on Win2k3.
> Every setting has green mark, except Rprt Manager Virtual Directory
> which is grey and Web Service Identity has not configured mark. And I'm
> aware that during instalation RS didn't add Reports dir to IIS, but I
> don't know why.
> Has anyone met with that problem?
> Regards,
> Bartolo
>|||Hi,
OK - I just managed to get past this problem :-).
The issue seems to be that I failed to select 'Report Manager' during
initial installation - even though I DID select Reporting Services - Report
Manager seems to be unselected by default !!.
The problem however is then :
1. Re-running the original SQL Express Adv installer, and checking Report
Manager - then tells me that there is nothing to install !! - it apparently
LIES.
2. Running Add/Remove programs, select SQL Server, Change takes me to the
re-install screens BUT my original installation folder was temporary and so
has been deleted :-O.
To get around this problem :
1. Run the main installer again, but at the point where it says nothing to
insall use Explorer to grab a copy of the installers temporary SQL 'Setup'
folder, and store this somewhere safe. Then let the installer exit and
delete its files - you're left with your copy ;-).
2. Run Add/Remove etc - select Report Manager and continue until it
complains that it cannot find 'sqlrun_rs.msi' (as its pointing at the (now
deleted) temp folder. Point this to your copied folder and the install
completes :-)).
Now run the config tool and it shows Report Manager is available !!.
Now all I have to do is to fix the ASP.NET permissions - as it now complains
that the ASP.NET account used to access the webservice (and which I cannot
change) does not have access to the GAC :-O.
Some hoops huh :-O. Maybe Microsoft can comment on the installation failures
?.
NB I already have RS installed on a 2003 server and went through a different
set of hoops to get it running on there :-O.
Hope this helps...
Regards
Graham
"Bartolo" <andrew.osa@.gmail.com> wrote in message
news:1152266153.281436.141940@.k73g2000cwa.googlegroups.com...
> Hi,
> I have problem with Reporting Services 2005 configuration on Win2k3.
> Every setting has green mark, except Rprt Manager Virtual Directory
> which is grey and Web Service Identity has not configured mark. And I'm
> aware that during instalation RS didn't add Reports dir to IIS, but I
> don't know why.
> Has anyone met with that problem?
> Regards,
> Bartolo
>|||Hi Graham,
Thx for help, now I'm on holiday.
So I'd check your solution as soon as I come back to the job.
Then I'll share with my experience.
Regards,
Bartolo|||Thank you for this information, helped me get the Report Manager up and running on my XP box
From http://www.developmentnow.com/g/115_2006_7_0_0_784539/Report-Manager-Virtual-Directory-disabled.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com

Report Manager Start Up

I believe that I read somewhere in the past that there was a setting in IIS
that you could change in order to have the Report Manager not recompile on
first request. As we all know it takes an unusually long time for Report
Manager to start up the first time you call the application. I would like to
know if there is a setting or change that I can make in order to have Report
Manager Load faster.
Thanks,
--
Andrew
MCSA,MCDBAHi,
I believe the setting you are looking for is the "Shutdown worker processes
after being idle for..." on the Performance tab of the application pool that
the Reports virtual directory is assigned to.
See old post below for details:
>>>>>>>>>>
If you are running Windows 2003 server for your IIS reportserver, then this
is a simple issue - I'll explain what happens:
The report service engine, once it is idle for more than the default 20
minutes, the worker process is shutdown.
This is controlled by IIS.
Open up the Internet Information Services (IIS) Manager
Expand the server node then the application pools.
On my IIS machine, I created an application pool dedicated to the
reportserver & reportmanager virtual webs.
But anyways, for the application pool that the reportserver is pointing to
if you left everything to their defaults will be the DefaultAppPool.
Right click the default app pool and select properties.
There are two things that are checked by default - On the recycling tab
there is a checkbox for recycling worker processes - it is currently set to
1740 minutes (29 hours). Leave it.
The other one is on the performance tab - which is the one you are
interested in changing...
See the "Idle Timeout" section and increase the number of minutes to be 8
hours a typical working day - 8*60 = 480 minutes.
Next, to be sure the "morning person" that runs the first report doesn't get
the delay, set up a schedule for either a dummy or adhoc report to fire off
like at 6am so that the report component worker processes get loaded.
I hope this helps you.
There is no need to have a report fire off every minute to keep things
alive - it is just that the report service was "unloaded" and needed to load
back up.
=-Chris
>>>>>>>>>>
"Andrew" wrote:
> I believe that I read somewhere in the past that there was a setting in IIS
> that you could change in order to have the Report Manager not recompile on
> first request. As we all know it takes an unusually long time for Report
> Manager to start up the first time you call the application. I would like to
> know if there is a setting or change that I can make in order to have Report
> Manager Load faster.
> Thanks,
> --
> Andrew
> MCSA,MCDBA|||Chris,
Thanks, that is exactly what I was looking for.
--
Andrew
MCSA,MCDBA
"Oweste" wrote:
> Hi,
> I believe the setting you are looking for is the "Shutdown worker processes
> after being idle for..." on the Performance tab of the application pool that
> the Reports virtual directory is assigned to.
> See old post below for details:
> >>>>>>>>>>
> If you are running Windows 2003 server for your IIS reportserver, then this
> is a simple issue - I'll explain what happens:
> The report service engine, once it is idle for more than the default 20
> minutes, the worker process is shutdown.
> This is controlled by IIS.
> Open up the Internet Information Services (IIS) Manager
> Expand the server node then the application pools.
> On my IIS machine, I created an application pool dedicated to the
> reportserver & reportmanager virtual webs.
> But anyways, for the application pool that the reportserver is pointing to
> if you left everything to their defaults will be the DefaultAppPool.
> Right click the default app pool and select properties.
> There are two things that are checked by default - On the recycling tab
> there is a checkbox for recycling worker processes - it is currently set to
> 1740 minutes (29 hours). Leave it.
> The other one is on the performance tab - which is the one you are
> interested in changing...
> See the "Idle Timeout" section and increase the number of minutes to be 8
> hours a typical working day - 8*60 = 480 minutes.
> Next, to be sure the "morning person" that runs the first report doesn't get
> the delay, set up a schedule for either a dummy or adhoc report to fire off
> like at 6am so that the report component worker processes get loaded.
> I hope this helps you.
> There is no need to have a report fire off every minute to keep things
> alive - it is just that the report service was "unloaded" and needed to load
> back up.
> =-Chris
> >>>>>>>>>>
>
> "Andrew" wrote:
> > I believe that I read somewhere in the past that there was a setting in IIS
> > that you could change in order to have the Report Manager not recompile on
> > first request. As we all know it takes an unusually long time for Report
> > Manager to start up the first time you call the application. I would like to
> > know if there is a setting or change that I can make in order to have Report
> > Manager Load faster.
> >
> > Thanks,
> >
> > --
> > Andrew
> > MCSA,MCDBA

Friday, March 9, 2012

Report Manager Config Issue

Greetings,

*Microsoft Windows Server 2003

*MSSQL Server 2005 (with reporting services installed)

I have found a configuration issue after setting up the virtual directorties for the report service and report manager.

The reporting virtual directories are assigned to a non default website and the assigned site has a defined IP Address other than the machines assigned IP.

The Reporting Services Configuration Manager Created the virtual directories properly but there seems to be a problem with it reconizing a non-default IP Address for the site the reporting services directories are created under. Because I get -

"The report server is not responding. Verify that the report server is running and can be accessed from this computer."

When I open C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportManager\RSWebApplication.config I see the following -

<UI>

<ReportServerUrl></ReportServerURL>

<ReportServerVirtualDirectory>ReportServer</ReportServerVirtualDirectory>

<ReportBuilderTrustLevel>FullTrust</ReportBuilderTrustLevel>

</UI>

I tried

<ReportServerUrl>http://<Site IP Address>/</ReportServerURL>

<ReportServerVirtualDirectory>ReportServer</ReportServerVirtualDirectory>

and

<ReportServerUrl>http://<Site IP Address>/ReportServer</ReportServerURL>

<ReportServerVirtualDirectory></ReportServerVirtualDirectory>

Still no luck - any suggestions?

Nevermind Figured it out -

<ReportServerUrl>http://<Site IP Address>/ReportServer</ReportServerURL>

<ReportServerVirtualDirectory></ReportServerVirtualDirectory>

Works - just did not recycle the application pools in IIS. By the way if you are configuring the manager for a non-default IP address be carefull. For some reason the report manager does not like a <ReportServerVirtualDirectory> value if <ReportServerURL> is supplied.

Wednesday, March 7, 2012

Report is Being Generated

I have a report with 12 parameters. They all have a default setting. When
I go to preview the report in the IDE it automatically starts to generate
the report with the user having to hit the view report button. Is there a
way to keep the report from auto generating without user interaction?I have a report with 12 parameters. They all have a default setting. When
I go to preview the report in the IDE it automatically starts to generate
the report without the user having to hit the view report button. Is there
a
way to keep the report from auto generating without user interaction?
"Chris" <cexley@.enableconsulting.com> wrote in message
news:Oak73TDdGHA.4900@.TK2MSFTNGP02.phx.gbl...
>I have a report with 12 parameters. They all have a default setting. When
>I go to preview the report in the IDE it automatically starts to generate
>the report with the user having to hit the view report button. Is there a
>way to keep the report from auto generating without user interaction?
>|||Unfortunately this is by design. If all the parameters have defaults it
immediately starts rendering. You need to have at least one parameter that
the user has to select.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Chris" <cexley@.enableconsulting.com> wrote in message
news:Oak73TDdGHA.4900@.TK2MSFTNGP02.phx.gbl...
>I have a report with 12 parameters. They all have a default setting. When
>I go to preview the report in the IDE it automatically starts to generate
>the report with the user having to hit the view report button. Is there a
>way to keep the report from auto generating without user interaction?
>|||Thanks for the response. I think it is bad design, and should be a property
(IsAutoGenerate comes to mind).
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:u7YDbYDdGHA.5048@.TK2MSFTNGP03.phx.gbl...
> Unfortunately this is by design. If all the parameters have defaults it
> immediately starts rendering. You need to have at least one parameter that
> the user has to select.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Chris" <cexley@.enableconsulting.com> wrote in message
> news:Oak73TDdGHA.4900@.TK2MSFTNGP02.phx.gbl...
>>I have a report with 12 parameters. They all have a default setting.
>>When I go to preview the report in the IDE it automatically starts to
>>generate the report with the user having to hit the view report button.
>>Is there a way to keep the report from auto generating without user
>>interaction?
>