Showing posts with label default. Show all posts
Showing posts with label default. Show all posts

Wednesday, March 28, 2012

Problem with Boolean Nullable parameter in Report Viewer

I have a problem with a nullable boolean parameter.
By default, the value is Null and that's working fine.

The User clicks either true or false, view the report: fine again.

However, from that point on, if the user checks the Null checkbox and
submits the reports, it reverts automatically back to the last True or
False value.

Is this a known problem? Or am I doing something wrong?

Eric

You aren't doing anything wrong. This is a bug. Unfortunately, there is no workaround. If this is causing you signficant problems, please contact customer support directly for a solution.

http://www.microsoft.com/services/microsoftservices/srv_support.mspx

|||

Thanks for the answer.

Is it reasonable to assume that this will get fixed in the next service pack, whenever this is?

|||I can't make any promises at this point (there are many factors involved), but I am pushing for it.|||Thanks

Problem with Best Practices Analyzer and set nocount on.

Hi.
There is a bug with BPA.
When you configure a server with sp_configure 'user options',512 or EM
(default connection options) seting to NOCOUNT ON, BPA fails when reading
the catalog.
Esio
Thanks Esio for reporting this issue.
We shall work on fixing this issue in future release of BPA
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"Esio Nunes" <esio_nunes@.hotmail.com> wrote in message
news:%239d5MqL%23EHA.3988@.TK2MSFTNGP11.phx.gbl...
> Hi.
> There is a bug with BPA.
> When you configure a server with sp_configure 'user options',512 or EM
> (default connection options) seting to NOCOUNT ON, BPA fails when reading
> the catalog.
> Esio
>

Wednesday, March 21, 2012

problem with "select all" on 2 multi-value cascading parameters

Hello,

since some hours I'm struggling with 2 multi-value cascading parameters which default values should be always "Select ALL"

First Parameter:

available vlaues: From query

dataSetBig SmilesGetCountry (defined as select from tblCountries)

ValueFied:ContryName

LabelField:CountryName

DefaultValues: from Query

dataSetBig SmilesGetCountry

ValueFied:ContryName

SecondParameter:

available vlaues: From query

dataSetBig SmilesGetAreas (stored procedure which parameter is the list of the selected countries)

ValueFied:AreaName

LabelField:AreaName

DefaultValues: from Query

dataSetBig SmilesGetAreas

ValueFied:AreaName

First time I open the report

the first and the second parameters are properly filled and for both parameters "select all" is checked.

I select one option from the first parameter, the second parameter's content change dinamically and "Select All" option is still selected !Cool

Now I change the selection on the first Parameter, by checking AN ANOTHER item from the list , the second parameter list refresh dinamically but "Select all" IS NOT selected and only the item that were previously checked kept the selection !!!NO!!

Is this a bug in Reporting services and I have to say to ther user that is not possible to develop what they would like to have or there is , even programmatically, a way to solve it?

Thankx for any helps!

Marina B

Hello,

I notice that your second parameter is populated by a stored procedure. Is it possible for you to perform that query from within SRS rather than as a stored procedure?

I'm fairly new at this, so I hesitate to make an absolute statement, but multi-value parameters don't work well with stored procedures.

Also, the second query, the one accepting the first parameter must use an IN clause, rather than a WHERE clause, to filter the results.

I bow to any contradictory experience others may have.

Respectfully,

David Emigh

|||

Hi David,

I changed the definition of my parameters based on your advice

dataSet: dsGetCountry (defined as select from tblCountries)

ValueFied: ContryID

LabelField: CountryName

DefaultValues: from Query

dataSet: dsGetCountry

ValueFied: ContryName

Now the Second Parameter is setup in this ways

I created a new DataSet named: dsgetAreaByCountryID

select distinct(AreaName)
from [dbo].[tblArea] a
INNER JOIN [dbo].[tblcountry] c on a.CountryID = c.CountryID
where not AreaName is null and c.CountryID in (@.cc)
group by AreaName
order by AreaName asc

@.cc is a new Parameter which value is =Parameters!CountryID.Value

I tried to copy write directly c.CountryID in (Parameters!CountryID.Value)
but I get an error ( the ! is not welcome)

dataSet: dsgetAreaByCountryID

ValueFied: AreaName

LabelField: AreaName

DefaultValues: from Query

dataSet: dsgetAreaByCountryID

ValueFied: AreaName

Anyway I have the same problem as with the Stored Procedure!!

Did I follow exactly your advice?

Thank you very much
Marina B

|||

Have you adjusted the settings in the report parameters?

From the data or layout view:

Report menu > Parameters

|||

mmhhh ... your last reply is not completely clear to me.

what do you mean with that...

I have changed the parameter setting as I wrote in my last message...

Did I forgot something?

Thankx

Marina B.

|||I have had the same results. Don't think it's a bug. It looses track if you start going back and forth. If you want to start the parameter selection over you might be better off hitting refresh and selecting the parameters in the correct order. Be sure to explain the same to your end users. I do agree that it would be nice if it always keep track of them.|||

How is possible to hit the refresh?

Programmatically?

Thankx very much

MArina B.

problem with "select all" on 2 multi-value cascading parameters

Hello,

since some hours I'm struggling with 2 multi-value cascading parameters which default values should be always "Select ALL"

First Parameter:

available vlaues: From query

dataSetBig SmilesGetCountry (defined as select from tblCountries)

ValueFied:ContryName

LabelField:CountryName

DefaultValues: from Query

dataSetBig SmilesGetCountry

ValueFied:ContryName

SecondParameter:

available vlaues: From query

dataSetBig SmilesGetAreas (stored procedure which parameter is the list of the selected countries)

ValueFied:AreaName

LabelField:AreaName

DefaultValues: from Query

dataSetBig SmilesGetAreas

ValueFied:AreaName

First time I open the report

the first and the second parameters are properly filled and for both parameters "select all" is checked.

I select one option from the first parameter, the second parameter's content change dinamically and "Select All" option is still selected !Cool

Now I change the selection on the first Parameter, by checking AN ANOTHER item from the list , the second parameter list refresh dinamically but "Select all" IS NOT selected and only the item that were previously checked kept the selection !!!NO!!

Is this a bug in Reporting services and I have to say to ther user that is not possible to develop what they would like to have or there is , even programmatically, a way to solve it?

Thankx for any helps!

Marina B

Hello,

I notice that your second parameter is populated by a stored procedure. Is it possible for you to perform that query from within SRS rather than as a stored procedure?

I'm fairly new at this, so I hesitate to make an absolute statement, but multi-value parameters don't work well with stored procedures.

Also, the second query, the one accepting the first parameter must use an IN clause, rather than a WHERE clause, to filter the results.

I bow to any contradictory experience others may have.

Respectfully,

David Emigh

|||

Hi David,

I changed the definition of my parameters based on your advice

dataSet: dsGetCountry (defined as select from tblCountries)

ValueFied: ContryID

LabelField: CountryName

DefaultValues: from Query

dataSet: dsGetCountry

ValueFied: ContryName

Now the Second Parameter is setup in this ways

I created a new DataSet named: dsgetAreaByCountryID

select distinct(AreaName)
from [dbo].[tblArea] a
INNER JOIN [dbo].[tblcountry] c on a.CountryID = c.CountryID
where not AreaName is null and c.CountryID in (@.cc)
group by AreaName
order by AreaName asc

@.cc is a new Parameter which value is =Parameters!CountryID.Value

I tried to copy write directly c.CountryID in (Parameters!CountryID.Value)
but I get an error ( the ! is not welcome)

dataSet: dsgetAreaByCountryID

ValueFied: AreaName

LabelField: AreaName

DefaultValues: from Query

dataSet: dsgetAreaByCountryID

ValueFied: AreaName

Anyway I have the same problem as with the Stored Procedure!!

Did I follow exactly your advice?

Thank you very much
Marina B

|||

Have you adjusted the settings in the report parameters?

From the data or layout view:

Report menu > Parameters

|||

mmhhh ... your last reply is not completely clear to me.

what do you mean with that...

I have changed the parameter setting as I wrote in my last message...

Did I forgot something?

Thankx

Marina B.

|||I have had the same results. Don't think it's a bug. It looses track if you start going back and forth. If you want to start the parameter selection over you might be better off hitting refresh and selecting the parameters in the correct order. Be sure to explain the same to your end users. I do agree that it would be nice if it always keep track of them.|||

How is possible to hit the refresh?

Programmatically?

Thankx very much

MArina B.

sql

Monday, February 20, 2012

problem using default value in SP

I created an SP for searching rows in a table.
Create Proc stp_search
@.recID varchar(100) = '%'
As
Select * from tbl1
Where recID In (coalesce((select * from dbo.udf(@.recID)), recID))
The SP works if I pass in only 1 recordID, or if I don't pass in anything
(default val of %). But I want to be able to search for multiple recID's, s
o
I created a UDF that returns a table of recID's. If the UDF returns one
recID in the return table, the SP works fine. But if I pass in a string wit
h
2 or more recID's (separated by commas - thus varchar), I get this error
message:
'Subquery returned more than 1 value. This is not permitted when the
subquery follows =, !=, <, <= , >, >= or when the subquery is used as an
expression.
The statement has been terminated.'
My goal is to be able to pass in multiple recID's, or just one, or none -
using the default value. My options to achieve this is to have multiple
select statements like this wrapped inside of IF Else:
if (select len(@.recID) - len(replace(@.recID, ',', '') = 0
select * from tbl1 where recID in coalesce(@.recID, recID)
Else
select * from tbl1 where recID in (select * from dbo.udf(@.recID)
The problem is that the actual select statment is quite large and I have 10
parameters. So the IF else thing would be quite verbose (because I am
actually searching on several tables in this SP - one of the params specifie
s
which table).
So my question is if there is a way to implement the functionality of my
UDF which can return more than one value in the subquery (searching on more
than one recID) and still be able to use the default value (with coalesce)
without having to do the If Else thing.
Any suggestions appreciated (I hope I am not stuck with verbose - it would
be a book)
Thanks,
RichSee if this helps.
Arrays and Lists in SQL Server
http://www.sommarskog.se/arrays-in-sql.html
AMB
"Rich" wrote:

> I created an SP for searching rows in a table.
> Create Proc stp_search
> @.recID varchar(100) = '%'
> As
> Select * from tbl1
> Where recID In (coalesce((select * from dbo.udf(@.recID)), recID))
> The SP works if I pass in only 1 recordID, or if I don't pass in anything
> (default val of %). But I want to be able to search for multiple recID's,
so
> I created a UDF that returns a table of recID's. If the UDF returns one
> recID in the return table, the SP works fine. But if I pass in a string w
ith
> 2 or more recID's (separated by commas - thus varchar), I get this error
> message:
> 'Subquery returned more than 1 value. This is not permitted when the
> subquery follows =, !=, <, <= , >, >= or when the subquery is used as an
> expression.
> The statement has been terminated.'
> My goal is to be able to pass in multiple recID's, or just one, or none -
> using the default value. My options to achieve this is to have multiple
> select statements like this wrapped inside of IF Else:
> if (select len(@.recID) - len(replace(@.recID, ',', '') = 0
> select * from tbl1 where recID in coalesce(@.recID, recID)
> Else
> select * from tbl1 where recID in (select * from dbo.udf(@.recID)
> The problem is that the actual select statment is quite large and I have 1
0
> parameters. So the IF else thing would be quite verbose (because I am
> actually searching on several tables in this SP - one of the params specif
ies
> which table).
> So my question is if there is a way to implement the functionality of my
> UDF which can return more than one value in the subquery (searching on mor
e
> than one recID) and still be able to use the default value (with coalesce)
> without having to do the If Else thing.
> Any suggestions appreciated (I hope I am not stuck with verbose - it would
> be a book)
> Thanks,
> Rich
>|||I think that my real question should be
Is there a way to implement a form of If Else inside a Where clause?
Declare @.recIDLen int
select @.recIDLen = len(@.recID) - len(replace(recID, ',',''))
select * from tbl1 Where
Case when @.recIDLen = 0 Then recID = coalesce(@.recID, recID)
Case When @.recIDLen > 0 Then recID In (select * from dbo.UDF(@.recID))
Is there a way to do something like this?
"Rich" wrote:

> I created an SP for searching rows in a table.
> Create Proc stp_search
> @.recID varchar(100) = '%'
> As
> Select * from tbl1
> Where recID In (coalesce((select * from dbo.udf(@.recID)), recID))
> The SP works if I pass in only 1 recordID, or if I don't pass in anything
> (default val of %). But I want to be able to search for multiple recID's,
so
> I created a UDF that returns a table of recID's. If the UDF returns one
> recID in the return table, the SP works fine. But if I pass in a string w
ith
> 2 or more recID's (separated by commas - thus varchar), I get this error
> message:
> 'Subquery returned more than 1 value. This is not permitted when the
> subquery follows =, !=, <, <= , >, >= or when the subquery is used as an
> expression.
> The statement has been terminated.'
> My goal is to be able to pass in multiple recID's, or just one, or none -
> using the default value. My options to achieve this is to have multiple
> select statements like this wrapped inside of IF Else:
> if (select len(@.recID) - len(replace(@.recID, ',', '') = 0
> select * from tbl1 where recID in coalesce(@.recID, recID)
> Else
> select * from tbl1 where recID in (select * from dbo.udf(@.recID)
> The problem is that the actual select statment is quite large and I have 1
0
> parameters. So the IF else thing would be quite verbose (because I am
> actually searching on several tables in this SP - one of the params specif
ies
> which table).
> So my question is if there is a way to implement the functionality of my
> UDF which can return more than one value in the subquery (searching on mor
e
> than one recID) and still be able to use the default value (with coalesce)
> without having to do the If Else thing.
> Any suggestions appreciated (I hope I am not stuck with verbose - it would
> be a book)
> Thanks,
> Rich
>|||try this
select * from tbl1 Where
(@.recIDLen = 0 and recID = coalesce(@.recID, recID)) or
(recID In (select * from dbo.UDF(@.recID))
"Rich" wrote:
> I think that my real question should be
> Is there a way to implement a form of If Else inside a Where clause?
> Declare @.recIDLen int
> select @.recIDLen = len(@.recID) - len(replace(recID, ',',''))
> select * from tbl1 Where
> Case when @.recIDLen = 0 Then recID = coalesce(@.recID, recID)
> Case When @.recIDLen > 0 Then recID In (select * from dbo.UDF(@.recID))
> Is there a way to do something like this?
>
> "Rich" wrote:
>|||Thanks all for your replies. And Omnibuzz gave me an even better idea. I
will add a varchar parameter which gets the string of recordIDs or default
value of '%'. If this param is '%' then @.recordID int will be used as the
parameter of choice. I was having a problem with the recID column which is
actually an int.
Anyway, this also solved another problem I was having pulling date columns
that contain nulls. I can bypass using a date params with the OR operator.
Thanks again.
"Rich" wrote:

> I created an SP for searching rows in a table.
> Create Proc stp_search
> @.recID varchar(100) = '%'
> As
> Select * from tbl1
> Where recID In (coalesce((select * from dbo.udf(@.recID)), recID))
> The SP works if I pass in only 1 recordID, or if I don't pass in anything
> (default val of %). But I want to be able to search for multiple recID's,
so
> I created a UDF that returns a table of recID's. If the UDF returns one
> recID in the return table, the SP works fine. But if I pass in a string w
ith
> 2 or more recID's (separated by commas - thus varchar), I get this error
> message:
> 'Subquery returned more than 1 value. This is not permitted when the
> subquery follows =, !=, <, <= , >, >= or when the subquery is used as an
> expression.
> The statement has been terminated.'
> My goal is to be able to pass in multiple recID's, or just one, or none -
> using the default value. My options to achieve this is to have multiple
> select statements like this wrapped inside of IF Else:
> if (select len(@.recID) - len(replace(@.recID, ',', '') = 0
> select * from tbl1 where recID in coalesce(@.recID, recID)
> Else
> select * from tbl1 where recID in (select * from dbo.udf(@.recID)
> The problem is that the actual select statment is quite large and I have 1
0
> parameters. So the IF else thing would be quite verbose (because I am
> actually searching on several tables in this SP - one of the params specif
ies
> which table).
> So my question is if there is a way to implement the functionality of my
> UDF which can return more than one value in the subquery (searching on mor
e
> than one recID) and still be able to use the default value (with coalesce)
> without having to do the If Else thing.
> Any suggestions appreciated (I hope I am not stuck with verbose - it would
> be a book)
> Thanks,
> Rich
>

PROBLEM- Use parameter to populate field in headerpage

Hi all,
I use hidden report parameters to populate textboxes in the pageheader and
come across this problem.
When the query for the default value for a parameter returns no rows, I get
an error "Parameter validation failed. It is not possible to provide valid
values for all parameters. (rsParameterError)".
This error is expected in this case. My question is is there a way to get
around this?
ThanksIn the query for the parameters dataset, force a record to be returned.
Union is a good function for this. I.e.,
Select Name From Table1 Where Type = 'whatever'
UNION
Select '(blank)'
Or you could do
If Exists(Select * From Table1 Where Type = 'whatever')
Select Name From Table1 Where Type = 'whatever'
Else
Select '(blank)' As Name
First option is more efficient but may have side effects for you.
Chris
Bach wrote:
> Hi all,
> I use hidden report parameters to populate textboxes in the
> pageheader and come across this problem.
> When the query for the default value for a parameter returns no rows,
> I get an error "Parameter validation failed. It is not possible to
> provide valid values for all parameters. (rsParameterError)".
> This error is expected in this case. My question is is there a way to
> get around this?
> Thanks

Problem Upgrading From SQL 2000 To SQL 2005

I have SQL 2000 with the latest SP that was installed with pretty much the
default settings as part of SBS 2000 Premium Edition.
I am using SQL to run Microsoft CRM 3.0 and want to upgrade to SQL 2005 to
take advantage of the Reporting Services.
When I try to upgrade to SQL 2005 I am getting the following message: "SQL
Server Setup cannot upgrade service ReportServer. SQL Server cannot run a
service account as a Local Service account or Network Service account on a
domain controller."
What do I need to do to get this upgrade to successfully complete?
Thanks.
Rick Bellefond
RB Data Services
www.rbdata.comHi Rick
Have you tried changing the service account for reporting services to a
domain account or localsystem?
Running the upgrade advisor before trying to upgrade may have shown this
error! It may be worthwhile running this.
John
"Rick" wrote:
> I have SQL 2000 with the latest SP that was installed with pretty much the
> default settings as part of SBS 2000 Premium Edition.
> I am using SQL to run Microsoft CRM 3.0 and want to upgrade to SQL 2005 to
> take advantage of the Reporting Services.
> When I try to upgrade to SQL 2005 I am getting the following message: "SQL
> Server Setup cannot upgrade service ReportServer. SQL Server cannot run a
> service account as a Local Service account or Network Service account on a
> domain controller."
> What do I need to do to get this upgrade to successfully complete?
> Thanks.
>
> Rick Bellefond
> RB Data Services
> www.rbdata.com|||Hi Rick
Usually that is because a DLL has not been correctly registered see
http://msdn2.microsoft.com/en-us/library/z2wd57es.aspx, if you know which DLL
this is you could try and re-register it using Regsvr32.
John
"Rick" wrote:
> Hi John,
> I knew I should have run the Upgrade Advisor first. :-)
> I went into services and changed the ReportServer service from a Network
> Service to localsystem and restarted it.
> I then ran the Upgrade Advisor and got the following error
> Analyze Analysis Service
> ActiveX component can't create object (DSO)
> Any idea as to how I fix that error?
> Thanks.
>
> Rick
>
> "John Bell" wrote:
> > Hi Rick
> >
> > Have you tried changing the service account for reporting services to a
> > domain account or localsystem?
> >
> > Running the upgrade advisor before trying to upgrade may have shown this
> > error! It may be worthwhile running this.
> >
> > John
> >
> > "Rick" wrote:
> >
> > > I have SQL 2000 with the latest SP that was installed with pretty much the
> > > default settings as part of SBS 2000 Premium Edition.
> > >
> > > I am using SQL to run Microsoft CRM 3.0 and want to upgrade to SQL 2005 to
> > > take advantage of the Reporting Services.
> > >
> > > When I try to upgrade to SQL 2005 I am getting the following message: "SQL
> > > Server Setup cannot upgrade service ReportServer. SQL Server cannot run a
> > > service account as a Local Service account or Network Service account on a
> > > domain controller."
> > >
> > > What do I need to do to get this upgrade to successfully complete?
> > >
> > > Thanks.
> > >
> > >
> > > Rick Bellefond
> > > RB Data Services
> > > www.rbdata.com