Friday, March 23, 2012
number of locks
I did not change parameter locks after installation, so it
has following values:
name minimum maximum config_value run_value
locks 5000 2147483647 0 0
So far did not experience any problem, Do I have to change
this in order to prevent problem with locks? Which number
of locks is available at this moment?You're probably fine with the default numbers. Most people never change
them. Is there a particular problem you're worried about or think you may be
having?
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"mirce" <anonymous@.discussions.microsoft.com> wrote in message
news:2f1001c4a231$27bf6b50$a601280a@.phx.gbl...
> Hi!
> I did not change parameter locks after installation, so it
> has following values:
> name minimum maximum config_value run_value
> locks 5000 2147483647 0 0
> So far did not experience any problem, Do I have to change
> this in order to prevent problem with locks? Which number
> of locks is available at this moment?|||No I did not have any problem. What is current value of
available locks?
>--Original Message--
>You're probably fine with the default numbers. Most
people never change
>them. Is there a particular problem you're worried about
or think you may be
>having?
>--
>Brian Moran
>Principal Mentor
>Solid Quality Learning
>SQL Server MVP
>http://www.solidqualitylearning.com
>
>"mirce" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2f1001c4a231$27bf6b50$a601280a@.phx.gbl...
>> Hi!
>> I did not change parameter locks after installation, so
it
>> has following values:
>> name minimum maximum config_value run_value
>> locks 5000 2147483647 0 0
>> So far did not experience any problem, Do I have to
change
>> this in order to prevent problem with locks? Which
number
>> of locks is available at this moment?
>
>.
>
Wednesday, March 21, 2012
number of locks
I did not change parameter locks after installation, so it
has following values:
nameminimummaximumconfig_valuerun_value
locks5000214748364700
So far did not experience any problem, Do I have to change
this in order to prevent problem with locks? Which number
of locks is available at this moment?
You're probably fine with the default numbers. Most people never change
them. Is there a particular problem you're worried about or think you may be
having?
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"mirce" <anonymous@.discussions.microsoft.com> wrote in message
news:2f1001c4a231$27bf6b50$a601280a@.phx.gbl...
> Hi!
> I did not change parameter locks after installation, so it
> has following values:
> name minimum maximum config_value run_value
> locks 5000 2147483647 0 0
> So far did not experience any problem, Do I have to change
> this in order to prevent problem with locks? Which number
> of locks is available at this moment?
|||No I did not have any problem. What is current value of
available locks?
>--Original Message--
>You're probably fine with the default numbers. Most
people never change
>them. Is there a particular problem you're worried about
or think you may be
>having?
>--
>Brian Moran
>Principal Mentor
>Solid Quality Learning
>SQL Server MVP
>http://www.solidqualitylearning.com
>
>"mirce" <anonymous@.discussions.microsoft.com> wrote in
message[vbcol=seagreen]
>news:2f1001c4a231$27bf6b50$a601280a@.phx.gbl...
it[vbcol=seagreen]
change[vbcol=seagreen]
number
>
>.
>
Tuesday, March 20, 2012
Number of charts vary with respect to a parameter
Hi
I have a situation similar to this example - The X Axis represents the Date and the Y Axis represents the number of vehicles sold and the data i need to represent is the type of each vehicle(Line Graph). Hence there should be one graph for each Vehicle type. Is it possible to generate as many Chart Objects in the rdl file dynamically.
I tried representing all the lines in a single chart but the since the sales value is varied as an example for a particular vehicle type it shall vary from 10000 to 1000000 and for another it varies from 10 to 100. So one vehicle type gets represented clearly and the other looks like a straight line.
Please help with the solution.
Thanks
Saishyam
> Hence there should be one graph for each Vehicle type.
Ok, let's assume you have a VehicleType field. Steps:
1. Add a list to the report
2. Add a list grouping based on the expression: =Fields!VehicleType.Value
This will create one list instance per vehicle type.
3. Add a chart into the list (make sure the chart is really contained within the list instead of overlaying)
4. Design your chart
You should then get one chart per vehicle type at runtime.
-- Robert
|||Hi Robert
Thanks for the reply, I feel it will definitely help me out. Also will the layout be automatically taken care or should i code for that also.
|||Not sure what you mean exactly with "layout", but if you leave the y-axis maximum value blank, the individual charts will automatically scale the y-axis based on the actual data values.
-- Robert
Monday, March 12, 2012
Number Format
When setting the format property for a textbox containing a number the first parameter relates to a positive number, the second negative and the third to zero.
eg #,###; (#,###); 0
Is there a way of also formatting Null values in the same way without writing custom code?
Could you do an isnull in your query so that you don't get NULL showing on your report?
Jarret
|||I could. Just means I have to either type this in for every column in my dataset or every textbox (instead of doing a multi-select). Sounds a bit lazy I know but I have a lot of reports and columns to go through.
Mark
|||Sorry Mark, I can't seem to find anything that will replace NULL with a 0 just by changing using the format code.
I think you're best bet is using the ISNULL or an expression, but either way, you'd have to change each field.
Jarret
Nulls in stored procedure
When I run the stored procedure and use the "%" to show everything, it does not show any records that are null. I have tried to use the IsNull funtion to give the null values a value of 'none', but that did not help.
Any help would be appreciated.Originally posted by shearness
I have a stored procedure that is using Like and a parameter to query by Social Security Number. Not all of my records have SSN's, so some are null.
When I run the stored procedure and use the "%" to show everything, it does not show any records that are null. I have tried to use the IsNull funtion to give the null values a value of 'none', but that did not help.
Any help would be appreciated.
assign default value % to the parameter|||If you want to display records with NULL SSN (even though they should not be, unless I didn't get your requirements right) then just do ISNULL(SSN, @.SSN)|||I want to be able to search the SSN field for anything. For example:
last four digits 00
entire field 000-00-0000
or
if I don't know the social, I want to be able to use just % to display all social security #'s, even those with null values.
Does this make sense?|||Also, I have tried both of your posts and I am having the same problem. When the message box pops up asking for me to specify a value for SSN, I enter %, which in theory should display all records. Instead, it is only displaying records that do not have a null value for SSN. How do I get the % to include even those that have null values? Thanks in advance for any help.|||Originally posted by shearness
Also, I have tried both of your posts and I am having the same problem. When the message box pops up asking for me to specify a value for SSN, I enter %, which in theory should display all records. Instead, it is only displaying records that do not have a null value for SSN. How do I get the % to include even those that have null values? Thanks in advance for any help.
I think now I got it. I guess some of the records's SSN are NULL. If that is correct those records will be elimated no matter what you specify in the where clause.
TRYING USING
SELECT CASE WHEN ISNULL(SSN, '-1') = '-1' THEN 'NO SSN'
ELSE SSN
END
FROM TABLE1
WHERE
(
CASE WHEN ISNULL(SSN, '-1') = '-1' THEN 'NO SSN'
ELSE SSN
END) LIKE 'PARAM1%'
THIS IS NOT A COMPELE CODE. You have do decalare a variable and use it in the like operator
Hope it helps|||Originally posted by smasanam
I think now I got it. I guess some of the records's SSN are NULL. If that is correct those records will be elimated no matter what you specify in the where clause.
TRYING USING
SELECT CASE WHEN ISNULL(SSN, '-1') = '-1' THEN 'NO SSN'
ELSE SSN
END
FROM TABLE1
WHERE
(
CASE WHEN ISNULL(SSN, '-1') = '-1' THEN 'NO SSN'
ELSE SSN
END) LIKE 'PARAM1%'
THIS IS NOT A COMPELE CODE. You have do decalare a variable and use it in the like operator
Hope it helps
Sorry for my typo errors in the previous reply|||if @.PARAM1 is null
set @.PARAM1 = '%'
else
set @.PARAM1 = '%' + ltrim(rtrim(@.PARAM1)) + '%'
SELECT CASE WHEN ISNULL(SSN, '-1') = '-1' THEN 'NO SSN'
ELSE SSN
END
FROM TABLE1
WHERE ISNULL(SSN, @.PARAM1) LIKE @.PARAM1|||Mind you though, that using this approach may yield very undesireable results in terms of performance, because you may be returning ALL the rows in the table. Think about limiting your search range to a reasonable number of rows.|||I'm not able to use either of your code in my stored procedure. I'm get errors whenever I try to input it and save it. I'll admit, I'm new to this function, but I'm really stumped, it seems easy enough. Please help me draft this stored procedure so I can leave you alone.|||Okay, I've got the code in correctly, but I have one more question. I am able to view all entries now when I use %. But now, I am unable to limit the search to whatever I specified in the parameter box. How do I get the best of both worlds? Again, I want to be able to input any of the following in the parameter box and have the results:
% shows all records
321% shows all records with SSN that start with 321 only
321456789 shows only the one record with that SSN
Thanks again for all of your help.|||If you choose to control the contents of @.PARAM1 in the front-end, then the following should work:
SELECT CASE WHEN ISNULL(SSN, '-1') = '-1' THEN 'NO SSN'
ELSE SSN
END
FROM TABLE1
WHERE ISNULL(SSN,
case when datalength(@.PARAM1) != 1 then SSN else @.PARAM1 end
) LIKE @.PARAM1|||That's got it. I would ask for an explanation of what everything means, but you have done plenty. Thank you again for all of your help. That is exactly what I wanted.
Friday, March 9, 2012
Nulls -conditional display of value in Visual Studio
created a field which is supposed to evaluate the parameter and display the
appropriate field.
My code is as follows: =iif( Parameters!LastWeek.Value = "Y",
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value,
Fields!Measures_M9N_MTD.Value)
When I preview my report and select "Y" as the parameter, my field displays
nothing. I have checked the data and know there is a value in the field
represented by the "true" portion of my statement.
If I change the staement to this:=iif( Parameters!LastWeek.Value = "Y",
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value, 0)
I actually get the value I am expecting.
My conclusion is the data in the "false" portion of the statement is
actually null or non-existant. I think this is causing my statement to
malfunction. How do I account for this and make my statement work properly?
There will eventually be data in the field represented in the "false"
portion of the statement. The data will reside in either/or both depending
on the time of month.
Thank you... PB> My conclusion is the data in the "false" portion of the statement is
> actually null or non-existant. I think this is causing my statement to
> malfunction.
Assuming this conclusion is correct, you could use a nested IIF() test using
the ISNOTHING() function, like this:
=iif( Parameters!LastWeek.Value = "Y",
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value,
iif(ISNOTHING( Fields!Measures_M9N_MTD.Value), 0,
Fields!Measures_M9N_MTD.Value) )
... however (still assuming your conclusion about why it's not working is
correct) it might be safer to assume that *either* value could be missing,
so you could do the test in both places:
=iif( Parameters!LastWeek.Value = "Y",
iif(ISNOTHING(Fields!Measures_M30N_MTD_Last_Week_of_Month.Value),0,
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value),
iif(ISNOTHING(Fields!Measures_M9N_MTD.Value), 0,
Fields!Measures_M9N_MTD.Value) )
... double-however <g> when you look at it this way, it might be simpler to
do the same work in your data query. IOW use ISNULL() or COALESCE() in your
SELECT statement, to provide a default value for values that might be
missing, before you get to the report level.
Regards,
>L<
"ppbedz" <ppbedz@.discussions.microsoft.com> wrote in message
news:7F96FEB5-806D-4761-8077-4C3A7B85973D@.microsoft.com...
>I am trying to display one of 2 values based on an input parameter. I have
> created a field which is supposed to evaluate the parameter and display
> the
> appropriate field.
> My code is as follows: =iif( Parameters!LastWeek.Value = "Y",
> Fields!Measures_M30N_MTD_Last_Week_of_Month.Value,
> Fields!Measures_M9N_MTD.Value)
> When I preview my report and select "Y" as the parameter, my field
> displays
> nothing. I have checked the data and know there is a value in the field
> represented by the "true" portion of my statement.
> If I change the staement to this:=iif( Parameters!LastWeek.Value = "Y",
> Fields!Measures_M30N_MTD_Last_Week_of_Month.Value, 0)
> I actually get the value I am expecting.
> My conclusion is the data in the "false" portion of the statement is
> actually null or non-existant. I think this is causing my statement to
> malfunction. How do I account for this and make my statement work
> properly?
> There will eventually be data in the field represented in the "false"
> portion of the statement. The data will reside in either/or both
> depending
> on the time of month.
> Thank you... PB
Wednesday, March 7, 2012
Null values in cascading parameters
I want to make a Report with attractive selection parameters.
That I mean, there is a parameter, Tparam (Time Param) which will activate other parameters (3 parameters: TimeA_1, TimeA_2 & TimeA_3. These selection values have been registered in the "Aviable values => non-queried".)
when Tparam selected TimeA_1 then Parameter for TimeA_1 will activated (and the others will be disappeared/hidden), vice versa for the other control (TimeA_2 & TimeA_3)
any idea to do that?
thank you...What you want is available, they are called Cascading Parameters, there is a tutorial here
http://msdn2.microsoft.com/en-us/library/aa337426.aspx|||
Hi SNMSDN,
In the link ,you sent i can't find any source regarding hiding or ignoring one parameter using another parameter.
Even i have another problem in setting null values . I have 5 cascading parameters ,level1,level2,level3,level4 and level5
when level1 is compulsory ,i had the remaining 4 parameters to accept for null and are made optional
for this i tried with "Allow null value option" in Report parameters but its not accepting
as an alternative i tried with default value 'Query based' to return null.
None of them directs me towards accepting null
It is aksing to select the parameter
It will be really a great help if some body faced some problem like this and resolved it
Thanks in advance
Raj Deep.A
|||
I have the same problem.
Basically, it appears that if you reference a parameter directly or indirectly via any other parameter's DS, then it will not respect the "Allow Null" setting for that parameter, since it thinks that it is implicitly required.
For example, I have a report with State & County parameters that both need to be set to enable "Allow Null". The County parameter references the State parameter's value within its Dataset, but no other parameter references the County parameter.
As a result, the County parameter respects the "Allow Null" setting, but the "State" parameter does not.
There MUST be a way around this restriction!!!
I have tried to hack around it by creating a dummy parameter called "StateFilter" that uses an expression to either return the Parameter!State.Value or Null, and then the County dataset references this parameter instead of the actual "State" parameter. However, this doesnt work either. Sql RS is "smart" enough to see the indirect reference and continues to treat State as a required parameter.
Help!!!
~Lance
|||Nevermind.
I had forgotten about this wrinkle in how report parameters worked, but just now realized that you have to provide an option that has a value of NULL in order to select the "Allow Null" option. Makes sense when you think of it, but it would be nice if RS injected the NULL value option in such cases.
See this posting for the details:
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1067464&SiteID=17
Null values in cascading parameters
I want to make a Report with attractive selection parameters.
That I mean, there is a parameter, Tparam (Time Param) which will activate other parameters (3 parameters: TimeA_1, TimeA_2 & TimeA_3. These selection values have been registered in the "Aviable values => non-queried".)
when Tparam selected TimeA_1 then Parameter for TimeA_1 will activated (and the others will be disappeared/hidden), vice versa for the other control (TimeA_2 & TimeA_3)
any idea to do that?
thank you...What you want is available, they are called Cascading Parameters, there is a tutorial here
http://msdn2.microsoft.com/en-us/library/aa337426.aspx|||
Hi SNMSDN,
In the link ,you sent i can't find any source regarding hiding or ignoring one parameter using another parameter.
Even i have another problem in setting null values . I have 5 cascading parameters ,level1,level2,level3,level4 and level5
when level1 is compulsory ,i had the remaining 4 parameters to accept for null and are made optional
for this i tried with "Allow null value option" in Report parameters but its not accepting
as an alternative i tried with default value 'Query based' to return null.
None of them directs me towards accepting null
It is aksing to select the parameter
It will be really a great help if some body faced some problem like this and resolved it
Thanks in advance
Raj Deep.A
|||
I have the same problem.
Basically, it appears that if you reference a parameter directly or indirectly via any other parameter's DS, then it will not respect the "Allow Null" setting for that parameter, since it thinks that it is implicitly required.
For example, I have a report with State & County parameters that both need to be set to enable "Allow Null". The County parameter references the State parameter's value within its Dataset, but no other parameter references the County parameter.
As a result, the County parameter respects the "Allow Null" setting, but the "State" parameter does not.
There MUST be a way around this restriction!!!
I have tried to hack around it by creating a dummy parameter called "StateFilter" that uses an expression to either return the Parameter!State.Value or Null, and then the County dataset references this parameter instead of the actual "State" parameter. However, this doesnt work either. Sql RS is "smart" enough to see the indirect reference and continues to treat State as a required parameter.
Help!!!
~Lance
|||Nevermind.
I had forgotten about this wrinkle in how report parameters worked, but just now realized that you have to provide an option that has a value of NULL in order to select the "Allow Null" option. Makes sense when you think of it, but it would be nice if RS injected the NULL value option in such cases.
See this posting for the details:
http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1067464&SiteID=17
Monday, February 20, 2012
Null parameter in uniqueidentifier field
The table aspnet_users, which we all know
Another table with an uniqueidentifier which references the user iD
I want to set the value of the iD in one of the entries in the second table to null.
I tried this:
string assigned is null, i am passing this as a method parameter
............
string queryString = "UPDATE [table2] SET AssignedUserId=@.assigned WHERE ProblemId = @.id";
System.Data.IDbCommand dbCommand = new System.Data.SqlClient.SqlCommand();
...............
System.Data.IDataParameter dbParam_au_pr = new System.Data.SqlClient.SqlParameter();
dbParam_au_pr.ParameterName = "@.assigned";
if (assigned == null)
{
dbParam_au_pr.Value = null;
}
else
{
dbParam_au_pr.Value = assigned;
}
dbParam_au_pr.DbType = System.Data.DbType.String ;
dbCommand.Parameters.Add(dbParam_au_pr);
I also tried using "" instead of null, or not using that "if" statement at all.
I get an error that says:
Parameterized Query '(@.id nvarchar(1),@.assignednvarchar(4000))UPDATE [tracker_Probl' expects parameter @.assigned,which was not supplied.
Please help with this as soon as possible.ThanksTry using DBNull.Value instead of null:dbParam_au_pr.Value = DBNull.Value;
null parameter
In the report I created, there is a drop down used as a parameter, i.e. Sector.
This drop down gets populated with data. It also has <Select a Value> in there.
When no item is selected, i.e. only <Select a Value> is shown in the drop down list, when the view Report button is clicked, the message says:
Please select a value for the parameter 'Sector'
The view Report used a stored procedure which allows null for this Sector parameter.
The SP does work fine in the sql server query analyser because it returns data with and without the sector parameter.
Any thoughts please?
Thanks
If I uncheck that then I will have to select an item from the list.
I would like to have the option to NOT select an item from the list so that when View Report is clicked then all data is returned.
Thanks
|||If a parameter is Nullable, meaning "Allow null value" is checked, RS will not prohibit the parameter from having a value of NULL. However, if the parameter has a valid values list, NULL must also appear in that list. RS will not insert NULL as a valid value into the list you provide.
In your scenario, you will need to explicitly include NULL in the values returned by your parameter data set. If you are using the SQL data extension, one way of doing this is as follows:
Code Block
(select[Label],
[Value]
from [ParameterValues])
union
(select
'None',
NULL)
Where [Label], [Value], and [ParameterValues] are your column and table names.
|||and what if one use a connection of type Microsoft SQL Server Analysis Serves?If I already have an almost finished report, with the dataset already setted, how can I change it (producing the less side effects possible) in order to have null in the valid values?
thanks in advance!
Null Parameter
through report)? I've tried null, nothing, System.DBNull; none of these
work.
Thanks.I have the same question. Did you ever find a solution Elmer?
"Elmer Miller" wrote:
> How do you pass a set a parameter null from an expression (i.e. drill
> through report)? I've tried null, nothing, System.DBNull; none of these
> work.
> Thanks.
>
>|||No I haven't solved this one yet. I'm using a lame hack to work around. Set
the parameter to a special value that is then hard-coded to be treated like
null in the stored procedure. I'm glad I'm not the only one with the
problem. I'm sure there is a simple fix.
"Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
news:A94BBCDC-3021-4421-89A2-D791967765EE@.microsoft.com...
>I have the same question. Did you ever find a solution Elmer?
> "Elmer Miller" wrote:
>> How do you pass a set a parameter null from an expression (i.e. drill
>> through report)? I've tried null, nothing, System.DBNull; none of these
>> work.
>> Thanks.
>>|||Since I posted my question, I discovered that System.DBNull.Value does work
as a null (but System.DBNull alone does not).
This did not solve my problem, since null parameter value was not selected
in my target report, but I am convinced that is the correct method for
passing a null in an expression.
Randy Howie
"Elmer Miller" wrote:
> No I haven't solved this one yet. I'm using a lame hack to work around. Set
> the parameter to a special value that is then hard-coded to be treated like
> null in the stored procedure. I'm glad I'm not the only one with the
> problem. I'm sure there is a simple fix.
> "Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
> news:A94BBCDC-3021-4421-89A2-D791967765EE@.microsoft.com...
> >I have the same question. Did you ever find a solution Elmer?
> >
> > "Elmer Miller" wrote:
> >
> >> How do you pass a set a parameter null from an expression (i.e. drill
> >> through report)? I've tried null, nothing, System.DBNull; none of these
> >> work.
> >> Thanks.
> >>
> >>
> >>
>
>|||In the URL:
¶mname:isnull=true
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Elmer Miller" <millere@.empireco.nospam> wrote in message
news:%230KVJyB%23EHA.2112@.TK2MSFTNGP10.phx.gbl...
> No I haven't solved this one yet. I'm using a lame hack to work around.
> Set the parameter to a special value that is then hard-coded to be treated
> like null in the stored procedure. I'm glad I'm not the only one with the
> problem. I'm sure there is a simple fix.
> "Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
> news:A94BBCDC-3021-4421-89A2-D791967765EE@.microsoft.com...
>>I have the same question. Did you ever find a solution Elmer?
>> "Elmer Miller" wrote:
>> How do you pass a set a parameter null from an expression (i.e. drill
>> through report)? I've tried null, nothing, System.DBNull; none of these
>> work.
>> Thanks.
>>
>|||Jeff,
I have seen that tip for passing a null via a URL, but I was referring to
passing the parameter via a "jump to report" navigation expression
(drillthrough).
Randy Howie
--
"Jeff A. Stucker" wrote:
> In the URL:
> ¶mname:isnull=true
> --
> Cheers,
> '(' Jeff A. Stucker
> \
> Business Intelligence
> www.criadvantage.com
> ---
> "Elmer Miller" <millere@.empireco.nospam> wrote in message
> news:%230KVJyB%23EHA.2112@.TK2MSFTNGP10.phx.gbl...
> > No I haven't solved this one yet. I'm using a lame hack to work around.
> > Set the parameter to a special value that is then hard-coded to be treated
> > like null in the stored procedure. I'm glad I'm not the only one with the
> > problem. I'm sure there is a simple fix.
> >
> > "Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
> > news:A94BBCDC-3021-4421-89A2-D791967765EE@.microsoft.com...
> >>I have the same question. Did you ever find a solution Elmer?
> >>
> >> "Elmer Miller" wrote:
> >>
> >> How do you pass a set a parameter null from an expression (i.e. drill
> >> through report)? I've tried null, nothing, System.DBNull; none of these
> >> work.
> >> Thanks.
> >>
> >>
> >>
> >
> >
>
>|||I have also tried the System.DBNull.Value, but it doesn't work because
DBNull is of a different type. My parameter is a Date type and the
DBNull.Value causes an error:
The value you provided for the report parameter 'service_date' is not valid
for its type.
It should be this easy, but in this case type-checking is hurting us. I've
run into this situation before with Strong-typed datasets and in that case
you need to set a separate propterties and methods to handle nulls
(IsFieldNull() and SetFieldNull()). I'm sure there is something similar
going on here.
"Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
news:EFCD8BB2-5DA9-43FC-970B-33B7E20CA426@.microsoft.com...
> Since I posted my question, I discovered that System.DBNull.Value does
> work
> as a null (but System.DBNull alone does not).
> This did not solve my problem, since null parameter value was not selected
> in my target report, but I am convinced that is the correct method for
> passing a null in an expression.
> Randy Howie
> "Elmer Miller" wrote:
>> No I haven't solved this one yet. I'm using a lame hack to work around.
>> Set
>> the parameter to a special value that is then hard-coded to be treated
>> like
>> null in the stored procedure. I'm glad I'm not the only one with the
>> problem. I'm sure there is a simple fix.
>> "Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
>> news:A94BBCDC-3021-4421-89A2-D791967765EE@.microsoft.com...
>> >I have the same question. Did you ever find a solution Elmer?
>> >
>> > "Elmer Miller" wrote:
>> >
>> >> How do you pass a set a parameter null from an expression (i.e. drill
>> >> through report)? I've tried null, nothing, System.DBNull; none of
>> >> these
>> >> work.
>> >> Thanks.
>> >>
>> >>
>> >>
>>|||I found another workaround.
Instead of using 'Jump to report:' and setting parameters. Use 'Jump to URL'
and build the correct URL string with the param:null=true in it. It will
open up in a browser window (even when previewing)
"Randy Howie" <RandyHowie@.discussions.microsoft.com> wrote in message
news:A94BBCDC-3021-4421-89A2-D791967765EE@.microsoft.com...
>I have the same question. Did you ever find a solution Elmer?
> "Elmer Miller" wrote:
>> How do you pass a set a parameter null from an expression (i.e. drill
>> through report)? I've tried null, nothing, System.DBNull; none of these
>> work.
>> Thanks.
>>
Null Parameter
work
I have a list (Male & Female) drop down based on another dataset. I have
included ALL in this list. I want to be able return results from both gender
when the ALL is selected from the drop down.
I need help on how i can do this : by expression or by anyother means.SELECT * From MyTable WHERE Gender=@.Gender OR @.Gender = 'All'
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"bibo" <bibo@.discussions.microsoft.com> wrote in message
news:7B3FBF72-27E0-492F-B34B-0C092D97FBD5@.microsoft.com...
> how does the isnull parameter work? I am at my wits end trying to get this
> to
> work
> I have a list (Male & Female) drop down based on another dataset. I have
> included ALL in this list. I want to be able return results from both
> gender
> when the ALL is selected from the drop down.
> I need help on how i can do this : by expression or by anyother means.
Null Paramemter in Store Procedure
I am sending a an argument to a store procedure, I will
add a value to the "where" condition depending of that
parameter.
For example, the parameter is name, if i send "name1" I
will add "AND name = 'name'" to the store produre
(dynamic sql).
Is there a way to do it without concatenating it to a
nvarchar?
like "where name = *" or sometign like this?
Thanks a lot for your help!!
JCWithout dynamic SQL:
WHERE @.name IS NULL OR name = @.name
--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.
"Juan Carlos" <jcarlos_mn@.hotmail.com> wrote in message
news:03eb01c34431$51a993a0$a301280a@.phx.gbl...
> Hi,
> I am sending a an argument to a store procedure, I will
> add a value to the "where" condition depending of that
> parameter.
> For example, the parameter is name, if i send "name1" I
> will add "AND name = 'name'" to the store produre
> (dynamic sql).
> Is there a way to do it without concatenating it to a
> nvarchar?
> like "where name = *" or sometign like this?
> Thanks a lot for your help!!
> JC|||For a detailed list of options refer to:
http://www.algonet.se/~sommar/dyn-search.html
--
- Anith
( Please reply to newsgroups only )|||Hi JC,
You may try something like this:
ISNULL( 'AND name = ''' + @.name + ''', '')
then, if @.name is null, the condition won't appear in WHERE clause... hope
this help
--
---
Charlie Yukio Nakagawa
---
"Juan Carlos" <jcarlos_mn@.hotmail.com> escreveu na mensagem
news:03eb01c34431$51a993a0$a301280a@.phx.gbl...
> Hi,
> I am sending a an argument to a store procedure, I will
> add a value to the "where" condition depending of that
> parameter.
> For example, the parameter is name, if i send "name1" I
> will add "AND name = 'name'" to the store produre
> (dynamic sql).
> Is there a way to do it without concatenating it to a
> nvarchar?
> like "where name = *" or sometign like this?
> Thanks a lot for your help!!
> JC
Null multi-value parameters
I'm using integer multi-value parameters. I can't set the parameter to allow null, and when I preview the report and leave the parameter blank, it tells me to enter at least one value. I tried it with string parameters, and the report just doesn't run in preview if you don't enter any values, even if you choose "allow blank".
How do you specify a multi-value parameter to allow "empty" or "null"?Hope this will help you,
use TSQL for mutiple value parameter
select NULL as ID
union
select ID from table1|||I'm talking about Report Parameters in SSRS. Your SQL doesn't even use any parameters. How can this help?
|||Yes, I guess that he was also talkling about :-) Define a dataset which is filled with the parameters you want to display and in addition the NULL parameter (with the UNION mentioned above) You can also use something like "Select a value" as your display value for the NULL parameter. Then set the default value to non-queried and set the value to NULL. The Report will then open with the Report parameter list and set the "Select a value" value. In qour query you will have to handle the NULL appearance like the following mentioned example
WHERE
@.YourParameter IS NULL OR
YourColumn IN (@.YourParameter)
Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Ah, I see. This is for "Available values" in the parameter configuration. However, this wouldn't work for me, because when I deploy my reports the parameters are configured by a separate program, which then passes them to the webservice.
I did try what you suggested, and it didn't work as you describe. In preview, the values from the table were available to choose from, but the null value I created with UNION was not there.
I'm not sure how this would work anyway, because the parameter configuration is actually set to not "Allow null". So even if you could pick a null you might still get an error.
What I need is to be able to check "Allow null" for a multi-value parameter, but it gives an error when I try that. Does anyone even know why this is not allowed for multi-value parameters? It seems like a last-minute hack to protect some coding flaw.
|||then file it as a bug on connect.microsoft.com . The RS team keeps track of the posted bugs there.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
null label in parameter area
We have some reports that allow null values for parameters and I find the "Null" label next the parameters in the report viewer to be completly the wrong thing i want to show to business users.
Has anyone worked out a way to change this label to something more meaningful?
aaron
The only solution for this could be using a conditional expression in the field which you are using to display the parameter. In the textbox, use an expression something like this:
IIf(IsNothing(Parameters!YourParameter.Value, "Some Meaningful Text", Parameters!YourParameter.Value))
Shyam
|||Shyman, I should have been more specific. This is to do with datetime fields, where the allow blank field is ticked and disabled but will not allow blank, so we had to set the allow null flag. Which is fine, i just hate the text it displays.thanks
aaron
Null Hidden Parameter
In my report I have a dataset that is returning an ID field among other things. I am setting a hidden parameter = to that ID field. That parameter is then used to return another dataset.
My problem is that the original dataset with the ID field does not always bring back data (this is expected). If data is not brought back, I get an error when I try to execute the report ("The 'X' parameter is missing a value").
I have the parameter set to "Allow Null Values".
This value is not required in the SQL Server stored procedure that returns values for the new dataset.
The parameter is of type Integer. (So I am not able to set the "Allow Blank Value" property)
This is NOT a multi-value parameter.
Does anyone have any suggestions/ideas/workarounds to solve my problem?
Could you add a UNION to your first dataset to also return a record full of NULL values?Would this mess with the rest of your report?
Something like:
SELECT
Id, Description
FROM X
UNION
SELECT
Null, Null
That way your dataset will always return a value even if there is no data in table X.
|||
That may work, the other option with SQL would be for me to use IF EXISTS
IF EXISTS (select ID, Desc) THEN
select ID, Desc
ELSE
Select null, null
I am more interested in why reporting services gives me that error when I am allowing null values. I suspect it has something to do with trying to assign the parameter value from an empty dataset.
Null filter
in the dataset; the parameter is not in the sql query.
I want the user to be able to select a single Superintendent from a queried
list, and have the report return filtered data. I also want the user to be
able to select none (or null) and see a full report from an unfiltered
dataset or table.
Problem is that even though I'm allowing null in the param, the report still
demands that a Superintendent be selected.Any solution to this? I have something similar where I
have two filters on a Report and I would like to have
an "All" option on both filters where one or both are
basically ignored.
I am using parameter lists and have tried to set the
value to ALL as '%', '*', <BLANK>, <Null> etc with no
luck.
>--Original Message--
>I'm using a parameter for Superintendents. The
parameter drives a filter is
>in the dataset; the parameter is not in the sql query.
>I want the user to be able to select a single
Superintendent from a queried
>list, and have the report return filtered data. I also
want the user to be
>able to select none (or null) and see a full report from
an unfiltered
>dataset or table.
>Problem is that even though I'm allowing null in the
param, the report still
>demands that a Superintendent be selected.
>.
>|||There is a difference between a filter and a query parameter. Filters filter
the data after first bringing over all the data. If you have a query
parameter then it only brings over the data you want. If you do the latter
then you can define the query parameter like so:
select * from sometable where myfieldname like @.myparam
Bruce L-C
"Dave" <anonymous@.discussions.microsoft.com> wrote in message
news:100801c48b96$8f804540$3a01280a@.phx.gbl...
> Any solution to this? I have something similar where I
> have two filters on a Report and I would like to have
> an "All" option on both filters where one or both are
> basically ignored.
> I am using parameter lists and have tried to set the
> value to ALL as '%', '*', <BLANK>, <Null> etc with no
> luck.
> >--Original Message--
> >I'm using a parameter for Superintendents. The
> parameter drives a filter is
> >in the dataset; the parameter is not in the sql query.
> >I want the user to be able to select a single
> Superintendent from a queried
> >list, and have the report return filtered data. I also
> want the user to be
> >able to select none (or null) and see a full report from
> an unfiltered
> >dataset or table.
> >Problem is that even though I'm allowing null in the
> param, the report still
> >demands that a Superintendent be selected.
> >.
> >|||Hi Bruce. I understand that. What I am looking for is
an option to basically discard the filter for that record
set. Basically the ability to ignore the filter.
So if I returned back a recordset of all people who lived
in my state, and I had a filter on Gender as well as a
filter on City, I would like to be able to select a
Gender and select all for city and then show all the men
or women in the state, or select a city, and select all
and then show all the men and women in the city.
Right now if I have a filter on city and a filter on
gender, there is no option for a union, just an
intersection.
IMHO, this is a huge shortcoming especially with snapshot
reports. For example to run a sales report for a company
and have a filter on department. As constructed, you
must have a department, so if you wanted to show for the
whole company, you either have to do this at the database
and pass a parameter, or right a separate report.
I am looking for a way to add an "All" option to the
filter which basically will treat as a wildcard or
ignore, and currently it looks like that is not possible.
>--Original Message--
>There is a difference between a filter and a query
parameter. Filters filter
>the data after first bringing over all the data. If you
have a query
>parameter then it only brings over the data you want. If
you do the latter
>then you can define the query parameter like so:
>select * from sometable where myfieldname like @.myparam
>Bruce L-C
>"Dave" <anonymous@.discussions.microsoft.com> wrote in
message
>news:100801c48b96$8f804540$3a01280a@.phx.gbl...
>> Any solution to this? I have something similar where I
>> have two filters on a Report and I would like to have
>> an "All" option on both filters where one or both are
>> basically ignored.
>> I am using parameter lists and have tried to set the
>> value to ALL as '%', '*', <BLANK>, <Null> etc with no
>> luck.
>> >--Original Message--
>> >I'm using a parameter for Superintendents. The
>> parameter drives a filter is
>> >in the dataset; the parameter is not in the sql query.
>> >I want the user to be able to select a single
>> Superintendent from a queried
>> >list, and have the report return filtered data. I also
>> want the user to be
>> >able to select none (or null) and see a full report
from
>> an unfiltered
>> >dataset or table.
>> >Problem is that even though I'm allowing null in the
>> param, the report still
>> >demands that a Superintendent be selected.
>> >.
>> >
>
>.
>|||--There is a difference between a filter and a query
--parameter. Filters filter the data after first bringing
--over all the data. If you have a query parameter then
--it only brings over the data you want.
Yes and no... I understand what you are saying, but what
I am looking ofr is the option to not apply the filter
and get access to the full reocrd set that is returned.
As it looks like so far to me.. when you set up a filter
for a field, there is no Wildcard or "All" value, so with
a filter you can only see a subset of the recordset, and
never the full unfiltered recordset, which I think you
should be able to see.|||I tried a simply filter on a value with like and then put in * and it
returned everything. So it is possible to have a wildcard.
Bruce L-C
<anonymous@.discussions.microsoft.com> wrote in message
news:032d01c48f87$f9f0eed0$3501280a@.phx.gbl...
> --There is a difference between a filter and a query
> --parameter. Filters filter the data after first bringing
> --over all the data. If you have a query parameter then
> --it only brings over the data you want.
> Yes and no... I understand what you are saying, but what
> I am looking ofr is the option to not apply the filter
> and get access to the full reocrd set that is returned.
> As it looks like so far to me.. when you set up a filter
> for a field, there is no Wildcard or "All" value, so with
> a filter you can only see a subset of the recordset, and
> never the full unfiltered recordset, which I think you
> should be able to see.
>|||Was that a Textbox you entered the '*' in or did you
create a list for it.
I think we are getting close maybe.
I have set up a list for the filter to hide/make it
easier for the values. like Open for status of 'A',
Closed for status 'C', and want to add a All for all
statuses. I have tried assigning to <blank>, <null>, as
well as *, '*', %, '%', etc., and can not seem to assign
a wildcard to a labed value to creat a drop down list.
>--Original Message--
>I tried a simply filter on a value with like and then
put in * and it
>returned everything. So it is possible to have a
wildcard.
>Bruce L-C
><anonymous@.discussions.microsoft.com> wrote in message
>news:032d01c48f87$f9f0eed0$3501280a@.phx.gbl...
>> --There is a difference between a filter and a query
>> --parameter. Filters filter the data after first
bringing
>> --over all the data. If you have a query parameter then
>> --it only brings over the data you want.
>> Yes and no... I understand what you are saying, but
what
>> I am looking ofr is the option to not apply the filter
>> and get access to the full reocrd set that is returned.
>> As it looks like so far to me.. when you set up a
filter
>> for a field, there is no Wildcard or "All" value, so
with
>> a filter you can only see a subset of the recordset,
and
>> never the full unfiltered recordset, which I think you
>> should be able to see.
>
>.
>
NULL default for query-based parameter
a report with two parameters - @.StoreID and @.ParkName.
@.StoreID is a "non-queried" parameter with "Allow null value" checked.
@.ParkName is a "From query" parameter with "Allow null value" checked.
"Null" is checked under Default value for both parameters.
The stored procedure behind the report is setup to interpret "NULL" as "all
values" for both parameters, so you could select all stores and all parks, or
one park or one store, etc.
When I run the report, the @.StoreID parameter fields comes up with a NULL
checkbox next to it; that checkbox is checked by default and the parameter
field itself is blank and grayed out. If I uncheck NULL, I can enter a
specific store ID. This is exactly what I expect.
However, the @.ParkName parameter field comes up with "<Select a value>" as a
default and no NULL checkbox. If I leave the "<Select a value>" and click
View Report, I get an error about specifying a value for Park Name. If I
select a specific value from the drop-down-list, it works correctly.
Since both parameters are configured the same way with respect to NULL
values, I expected them to behave the same way (NULL checkbox checked by
default), but they don't. Is this an issue specifically with query-based
parameters? If so, how do I get the query-based parameter @.ParkName to
default to and accept a NULL input the same way @.StoreID does?Hi Mike,
The most common workaround I've found for the problem you are
encountering is to UNION an 'All' entry into the @.Parkname parameter such as
follows.
SELECT DISTINCT 1 as Sort, ParkName FROM Parks
UNION ALL
SELECT 0, 'All'
Order By Sort
You then also have to configure your dataset WHERE to have an entry that
includes
WHERE Parkaname in (@.ParkName) OR 'All' in (@.ParkName)
Michael C
"Mike Miller" wrote:
> I'm using DevStudio 2005 with Reporting Services and SQL Server 2005. I have
> a report with two parameters - @.StoreID and @.ParkName.
> @.StoreID is a "non-queried" parameter with "Allow null value" checked.
> @.ParkName is a "From query" parameter with "Allow null value" checked.
> "Null" is checked under Default value for both parameters.
> The stored procedure behind the report is setup to interpret "NULL" as "all
> values" for both parameters, so you could select all stores and all parks, or
> one park or one store, etc.
> When I run the report, the @.StoreID parameter fields comes up with a NULL
> checkbox next to it; that checkbox is checked by default and the parameter
> field itself is blank and grayed out. If I uncheck NULL, I can enter a
> specific store ID. This is exactly what I expect.
> However, the @.ParkName parameter field comes up with "<Select a value>" as a
> default and no NULL checkbox. If I leave the "<Select a value>" and click
> View Report, I get an error about specifying a value for Park Name. If I
> select a specific value from the drop-down-list, it works correctly.
> Since both parameters are configured the same way with respect to NULL
> values, I expected them to behave the same way (NULL checkbox checked by
> default), but they don't. Is this an issue specifically with query-based
> parameters? If so, how do I get the query-based parameter @.ParkName to
> default to and accept a NULL input the same way @.StoreID does?|||Michael,
Thanks for the tip. I had considered that previously, but was hoping there
was a simpler solution. It seems strange that Reporting Services treats a
non-queried parameter differently than a queried parameter with respect to
NULL values.
Mike
"Michael C" wrote:
> Hi Mike,
> The most common workaround I've found for the problem you are
> encountering is to UNION an 'All' entry into the @.Parkname parameter such as
> follows.
> SELECT DISTINCT 1 as Sort, ParkName FROM Parks
> UNION ALL
> SELECT 0, 'All'
> Order By Sort
> You then also have to configure your dataset WHERE to have an entry that
> includes
> WHERE Parkaname in (@.ParkName) OR 'All' in (@.ParkName)
> Michael C
> "Mike Miller" wrote:
> > I'm using DevStudio 2005 with Reporting Services and SQL Server 2005. I have
> > a report with two parameters - @.StoreID and @.ParkName.
> >
> > @.StoreID is a "non-queried" parameter with "Allow null value" checked.
> > @.ParkName is a "From query" parameter with "Allow null value" checked.
> > "Null" is checked under Default value for both parameters.
> > The stored procedure behind the report is setup to interpret "NULL" as "all
> > values" for both parameters, so you could select all stores and all parks, or
> > one park or one store, etc.
> >
> > When I run the report, the @.StoreID parameter fields comes up with a NULL
> > checkbox next to it; that checkbox is checked by default and the parameter
> > field itself is blank and grayed out. If I uncheck NULL, I can enter a
> > specific store ID. This is exactly what I expect.
> >
> > However, the @.ParkName parameter field comes up with "<Select a value>" as a
> > default and no NULL checkbox. If I leave the "<Select a value>" and click
> > View Report, I get an error about specifying a value for Park Name. If I
> > select a specific value from the drop-down-list, it works correctly.
> >
> > Since both parameters are configured the same way with respect to NULL
> > values, I expected them to behave the same way (NULL checkbox checked by
> > default), but they don't. Is this an issue specifically with query-based
> > parameters? If so, how do I get the query-based parameter @.ParkName to
> > default to and accept a NULL input the same way @.StoreID does?