Friday, March 30, 2012
Parameter Prompt with Wildcard
partial field using wildcard(s) in SRS. The list is lengthy and the user
does not always know the full name to enter.
Is this possible?
Thanks,
KarenVery much it can be done. Just you need to keep in mind about the single
quotes you are using for string paramters. eg '%userrequest' which you will
be passing the parameters to the "where" clause.
Amarnath
"Moving rpts from Access to Rptg Services" wrote:
> I'd like to create a report parameter to allow the user to enter only a
> partial field using wildcard(s) in SRS. The list is lengthy and the user
> does not always know the full name to enter.
> Is this possible?
> Thanks,
> Karen|||Thank you for our reply! in the where clause I currently have this:
WHERE (dbo.UP_Agents.AgentName = @.AgentName)
is this where I would add the wildcard? Or would I add in a separate
string? (sorry, i'm learning this as I go)
Thank you,
Karen
"Amarnath" wrote:
> Very much it can be done. Just you need to keep in mind about the single
> quotes you are using for string paramters. eg '%userrequest' which you will
> be passing the parameters to the "where" clause.
> Amarnath
> "Moving rpts from Access to Rptg Services" wrote:
> > I'd like to create a report parameter to allow the user to enter only a
> > partial field using wildcard(s) in SRS. The list is lengthy and the user
> > does not always know the full name to enter.
> >
> > Is this possible?
> >
> > Thanks,
> >
> > Karen|||AHA, this worked:
WHERE (dbo.UP_Agents.AgentName LIKE '%' + @.AgentName + '%')
Thanks for getting me started.
Karen
"Amarnath" wrote:
> Very much it can be done. Just you need to keep in mind about the single
> quotes you are using for string paramters. eg '%userrequest' which you will
> be passing the parameters to the "where" clause.
> Amarnath
> "Moving rpts from Access to Rptg Services" wrote:
> > I'd like to create a report parameter to allow the user to enter only a
> > partial field using wildcard(s) in SRS. The list is lengthy and the user
> > does not always know the full name to enter.
> >
> > Is this possible?
> >
> > Thanks,
> >
> > Karen
Parameter passing to a stored procedure
--start :)
CREATE PROCEDURE USP_MactchUser
@.domainUserID NVARCHAR(50) ,
@.EmployeeID NVARCHAR(50) ,
@.loginType bit = '0'
AS
INSERT INTO T_Login
(employeeID, loginType, domainUserID)
Values
(@.EmployeeID, @.loginType, @.domainUserID)
GO
--end :)
then I got this VB.Net code in my ASP.net page...
--begin :)
Private Sub matchUser()
Dim insertMatchedUser As SqlClient.SqlCommand
Dim daMatchedUser As SqlClient.SqlDataAdapter
SqlConnection1.Open()
'conn openned
daMatchedUser = New SqlClient.SqlDataAdapter("USP_MatchUser", SqlConnection1)
daMatchedUser.SelectCommand.CommandType = CommandType.StoredProcedure
daMatchedUser.SelectCommand.Parameters.Add(New SqlClient.SqlParameter("@.EmployeeID", SqlDbType.NVarChar, 50))
daMatchedUser.SelectCommand.Parameters.Add(New SqlClient.SqlParameter("@.domainUserID", SqlDbType.NVarChar, 50))
daMatchedUser.SelectCommand.Parameters("@.EmployeeID").Value = Trim(lblEmployeeID.Text)
daMatchedUser.SelectCommand.Parameters("@.domainUserID").Value = Trim(lblDomainuserID.Text)
daMatchedUser.SelectCommand.Parameters("@.EmployeeID").Direction = ParameterDirection.Output
daMatchedUser.SelectCommand.Parameters("@.domainUserID").Direction = ParameterDirection.Output
SqlConnection1.Close()
'conn closed
End Sub
--
If I try this it doesn't work (maybe that's normal :) ) Am I doing it wrong. The thing is, in both label.text properties a values is stored that i want to as a parameter to my stored procedure. What am I doing wrong?no.
Private Sub matchUser()
Dim insertMatchedUser As SqlClient.SqlCommand
insertMatchedUser = new SqlCommand;
insertMatchedUser.CommandText = "USP_MactchUser"
insertMatchedUser.CommandType = CommandType.StoredProcedure
insertMatchedUser.Parameters.Add(New SqlClient.SqlParameter("@.EmployeeID", SqlDbType.NVarChar, 50))
insertMatchedUser.Parameters.Add(New SqlClient.SqlParameter("@.domainUserID", SqlDbType.NVarChar, 50))
insertMatchedUser.Parameters("@.EmployeeID").Value = lblEmployeeID.Text.Trim()
insertMatchedUser.Parameters("@.domainUserID").Value = lblDomainuserID.Text.Trim()
insertMatchedUser.Connection = SqlConnection1;
SqlConnection1.Open()
'conn openned
insertMatcheduser.ExecuteNonQuery()
insertMatchedUser.Dispose()
SqlConnection1.Dispose()
End Sub|||Also:
CREATE PROCEDURE USP_MactchUser
@.domainUserID NVARCHAR(50) ,
@.EmployeeID NVARCHAR(50) ,
@.loginType bit = 0
AS
the bit data type literal should not have single quotes.sql
Wednesday, March 28, 2012
Parameter Number is Invalid
I am trying to create a Report on a Stored Procedure.
My Stored Procedure is having 3 parameters (2 datetime parameters and 1 integer parameter).
When i select the stored procedure in the initial stage, it asks for the parameters. I tried entering 2050-01-01 00:00:00.000, etc etc ...
But I am getting an error "Parameter Number 1 is invalid" which is the same datetime field.
When I run the stored procedure in the query analyser. Its runs fine:
exec spTravelRpt_Person_chargeno '01-01-1990 00:00:00.000','01-01-2050 00:00:00.000',-1.
Can anyone plzzzz plzzz help me.. bcoz i am stuck.. i cannot move forward..
Ur help will be appreicated.Give only 2050-01-01 to datetime field and when calling the SP from your front end, pass the parameter in the format you want|||Hi Madhi,
I tried giving that too ... just
2050-01-01 ...
but it didnt help me...
Its giving the same error:
Parameter number 1 is invalid.
What do i do ????|||change the parameters datatype to varchar(20) instead of datetime and check.sql
Parameter multi-value problem when using a stored procedure
I am describing the issue as below:
1. create a stored procedure as below
....where age in (@.p_age)
note: age is the table coumn of table table1 with datatype tinyint
2. .... and create a second dataset for parameter @.p_age
select distinct age from table1
3. associate the parameter...run it
4. There is no problem with single value. But when two ages are selected,
I got error message, "...Erro convert data type nvarchar to tinyint"
Please advise. PeterYou cannot pass and use multi-value parameters to a stored procedure and use
it in a query as you have. If that query was in RS itself then it would
work. This is not a RS thing, it is a SQL Server stored procedure issue.
Just try it from Query Analyzer and you will see what I mean. I do the
following, I create
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:74D9A9F0-B1F9-4925-8080-87FC99215462@.microsoft.com...
> Hi folks,
> I am describing the issue as below:
> 1. create a stored procedure as below
> ....where age in (@.p_age)
> note: age is the table coumn of table table1 with datatype tinyint
> 2. .... and create a second dataset for parameter @.p_age
> select distinct age from table1
> 3. associate the parameter...run it
> 4. There is no problem with single value. But when two ages are selected,
> I got error message, "...Erro convert data type nvarchar to tinyint"
> Please advise. Peter|||Try again, sent before done:
What doesn't work has nothing really to do with RS but has to do with Stored
Procedures in SQL Server. You cannot do the following in a stored procedure.
Let's say you have a Parameter called @.MyParams
Now you can map that parameter to a multi-value parameter but if in your
stored procedure you try to do this:
select * from sometable where somefield in (@.MyParams)
It won't work. Try it. Create a stored procedure and try to pass a
multi-value parameter to the stored procedure. It won't work.
What you can do is to have a string parameter that is passed as a multivalue
parameter and then change the string into a table.
This technique was told to me by SQL Server MVP, Erland Sommarskog
For example I have done this
inner join charlist_to_table(@.STO,Default)f on b.sto = f.str
So note this is NOT an issue with RS, it is strictly a stored procedure
issue.
Here is the function:
CREATE FUNCTION charlist_to_table
(@.list ntext,
@.delimiter nchar(1) = N',')
RETURNS @.tbl TABLE (listpos int IDENTITY(1, 1) NOT NULL,
str varchar(4000),
nstr nvarchar(2000)) AS
BEGIN
DECLARE @.pos int,
@.textpos int,
@.chunklen smallint,
@.tmpstr nvarchar(4000),
@.leftover nvarchar(4000),
@.tmpval nvarchar(4000)
SET @.textpos = 1
SET @.leftover = ''
WHILE @.textpos <= datalength(@.list) / 2
BEGIN
SET @.chunklen = 4000 - datalength(@.leftover) / 2
SET @.tmpstr = @.leftover + substring(@.list, @.textpos, @.chunklen)
SET @.textpos = @.textpos + @.chunklen
SET @.pos = charindex(@.delimiter, @.tmpstr)
WHILE @.pos > 0
BEGIN
SET @.tmpval = ltrim(rtrim(left(@.tmpstr, @.pos - 1)))
INSERT @.tbl (str, nstr) VALUES(@.tmpval, @.tmpval)
SET @.tmpstr = substring(@.tmpstr, @.pos + 1, len(@.tmpstr))
SET @.pos = charindex(@.delimiter, @.tmpstr)
END
SET @.leftover = @.tmpstr
END
INSERT @.tbl(str, nstr) VALUES (ltrim(rtrim(@.leftover)),
ltrim(rtrim(@.leftover)))
RETURN
END
GO
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:74D9A9F0-B1F9-4925-8080-87FC99215462@.microsoft.com...
> Hi folks,
> I am describing the issue as below:
> 1. create a stored procedure as below
> ....where age in (@.p_age)
> note: age is the table coumn of table table1 with datatype tinyint
> 2. .... and create a second dataset for parameter @.p_age
> select distinct age from table1
> 3. associate the parameter...run it
> 4. There is no problem with single value. But when two ages are selected,
> I got error message, "...Erro convert data type nvarchar to tinyint"
> Please advise. Peter
Parameter list with root 'All ...' member
I am trying to create simple parameter list that include members of some
dimension with their root 'All ...' member.
I want to accomplish list like this
All Countries
France
Germany
USA
...
Simple MDX, but in Reporting services dataset I get
<null> 1000
France 100
Germany 100
USA 100
... ...
Both 'All Countries' and Country members are present but with <null> for
'All Countries'.
I try different MDX-es with same result.
How can I get such results?
Thanks.Hi,
I too have the same problem..I am using Analysis services dataset. I am
seeing the "ALL" parameter in the drop-down list, for countries..But,when I
click on "all" I don't see any result..the rest works fine..why would this
happen?..
Please help us.
Thanks,
Sankar
"Don" <Don@.discussions.microsoft.com> wrote in message
news:7AD87583-D1A6-4453-86E1-70D39F99BB45@.microsoft.com...
> Hi,
> I am trying to create simple parameter list that include members of some
> dimension with their root 'All ...' member.
> I want to accomplish list like this
> All Countries
> France
> Germany
> USA
> ...
> Simple MDX, but in Reporting services dataset I get
> <null> 1000
> France 100
> Germany 100
> USA 100
> ... ...
> Both 'All Countries' and Country members are present but with <null> for
> 'All Countries'.
> I try different MDX-es with same result.
> How can I get such results?
> Thanks.
>
Monday, March 26, 2012
Parameter direction of a stored procedure
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ProcRetDbl]
@.Threshold real, @.Result real OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SELECT @.Result = Channel1 FROM DataTable WHERE Channel2 < @.Threshold
END
But then when I look at the properties of the @.Result parameter in the Object Explorer's tree, it is shown as "Input/Output". Now, this seems like no problem at all since it will work fine as output, even though I don't need it to be able to do input as well, but I'm wondering why that is happening.
I am using ADO.Net on the other end to execute the procedure and I need to decide what parameter type to set to the SqlParameter object: "Output" or "InputOutput". I'm sure I can sort this out but I usually like to know what I'm doing. Thanks for the help.
KamenYou are probably thinking too hard :)
You need to supply a parameter in to give you something to read when the value comes out. I can't remember what I use for sqlParameters - probably inputoutput. Try both - what have you got to lose?|||The only pure output from a stored procedure is the return code value and any result sets. Procedure parameters must be input, and can optionally be output too.
-PatP
Friday, March 23, 2012
Parameter - Set default values - Some fields missing
Thanks a lot to all who respond!
- SCham -What is the database you are using?
Why do you want to set default value to 150 columns?
Parameter
I am new in RS. I use Report Designer to create a report and use Report
Manger to view it. My question is I want to use parameter passing to let the
end-user to select multiple item in the parameter list, however, by using
Report Designer the parameter list only alow user to select one item. Anyone
know the good solution for this problem.
Thanks,
KentKent,
Version 1.0 of Reporting Services doesn't support multi-value parameters. As
a workaround, consider building your own front end to support multi
selection. Once this is in place, you can make your report query expression
based, e.g. by using the SQL IN clause.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"kent kent" <kentkent@.discussions.microsoft.com> wrote in message
news:7FC417C5-078E-433D-98BF-C511EAB28D9A@.microsoft.com...
> Hi all:
> I am new in RS. I use Report Designer to create a report and use
Report
> Manger to view it. My question is I want to use parameter passing to let
the
> end-user to select multiple item in the parameter list, however, by using
> Report Designer the parameter list only alow user to select one item.
Anyone
> know the good solution for this problem.
> Thanks,
> Kent
>
Parametarize Reports
milindsaraswala
Firstly if you can get your hands on the Reporting Services Book Online, you will find some very useful information.
There are a number of ways to add a parameter the easiest way for me is to add some criteria to your query, for eg,
Change it from
SELECT * FROM table1
to
SELECT * FROM table1 WHERE name = @.Parameter1
When you look at the report parameters option in your layout tab you will now see Parameter1 as a parameter for the report, in this view you can set things like prompt, where nulls/blanks are allowed. It is here that you can select the values for the paramter be based on a query, which when you go to your preview tab will display the parameter now as a combo box.
HTH
Wednesday, March 21, 2012
Parallel processing not supported in standard edition (use developer)
Hi,
I have a developer edition of SQL2005 upgraded to SP1 plus hotfixes on the dev box where I create my stuff.
Now, when I try to set a SSIS cube processing task to process in parallel, it tells me "Parallel processing is not supported in standard edition of analysis services."
Why?
I cannot edit the package on the enterprise edition used on production. I have to deploy as it is on dev.
Thanks,
Philippe
Hi,
The SQL Server build is 9.00.2153.00
I note that the problem exist only in the SSIS task. If I specify the parallel processing option when processing from management Studio, I do not get the error.
I bet it is a bug in SP1 or in the hotfix
Philippe
|||I have this exact same problem - I'm running Enterprise Edition, but in SSIS I get the error that "Parallel processing is not supported on STandard edition of Analysis Services". Can anyone confirm if this is a known issue and whether there is a workaround?Parallel processing not supported in standard edition (use developer)
Hi,
I have a developer edition of SQL2005 upgraded to SP1 plus hotfixes on the dev box where I create my stuff.
Now, when I try to set a SSIS cube processing task to process in parallel, it tells me "Parallel processing is not supported in standard edition of analysis services."
Why?
I cannot edit the package on the enterprise edition used on production. I have to deploy as it is on dev.
Thanks,
Philippe
Hi,
The SQL Server build is 9.00.2153.00
I note that the problem exist only in the SSIS task. If I specify the parallel processing option when processing from management Studio, I do not get the error.
I bet it is a bug in SP1 or in the hotfix
Philippe
|||I have this exact same problem - I'm running Enterprise Edition, but in SSIS I get the error that "Parallel processing is not supported on STandard edition of Analysis Services". Can anyone confirm if this is a known issue and whether there is a workaround?Tuesday, March 20, 2012
Parallel CREATE INDEX
edition.
I've had a look at BOL, but am none the wiser. What does this mean exactly?
Does it mean that I can't get the standard edition to run two or more create
index commands at the same time? If so, what would happen if I attempted to
do that? Would all but the first get ignored or would SQLServer simply
queue them to run them sequentially?
Thanks
Griff
They're referring to using multiple CPU's to build the same index.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Griff" <Howling@.The.Moon> wrote in message
news:Oc49pdjfEHA.4092@.TK2MSFTNGP10.phx.gbl...
This is apparently supported by Enterprise edition, but not by Standard
edition.
I've had a look at BOL, but am none the wiser. What does this mean exactly?
Does it mean that I can't get the standard edition to run two or more create
index commands at the same time? If so, what would happen if I attempted to
do that? Would all but the first get ignored or would SQLServer simply
queue them to run them sequentially?
Thanks
Griff
Parallel CREATE INDEX
edition.
I've had a look at BOL, but am none the wiser. What does this mean exactly?
Does it mean that I can't get the standard edition to run two or more create
index commands at the same time? If so, what would happen if I attempted to
do that? Would all but the first get ignored or would SQLServer simply
queue them to run them sequentially?
Thanks
GriffThey're referring to using multiple CPU's to build the same index.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Griff" <Howling@.The.Moon> wrote in message
news:Oc49pdjfEHA.4092@.TK2MSFTNGP10.phx.gbl...
This is apparently supported by Enterprise edition, but not by Standard
edition.
I've had a look at BOL, but am none the wiser. What does this mean exactly?
Does it mean that I can't get the standard edition to run two or more create
index commands at the same time? If so, what would happen if I attempted to
do that? Would all but the first get ignored or would SQLServer simply
queue them to run them sequentially?
Thanks
Griff
Parallel CREATE INDEX
edition.
I've had a look at BOL, but am none the wiser. What does this mean exactly?
Does it mean that I can't get the standard edition to run two or more create
index commands at the same time? If so, what would happen if I attempted to
do that? Would all but the first get ignored or would SQLServer simply
queue them to run them sequentially?
Thanks
GriffThey're referring to using multiple CPU's to build the same index.
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Griff" <Howling@.The.Moon> wrote in message
news:Oc49pdjfEHA.4092@.TK2MSFTNGP10.phx.gbl...
This is apparently supported by Enterprise edition, but not by Standard
edition.
I've had a look at BOL, but am none the wiser. What does this mean exactly?
Does it mean that I can't get the standard edition to run two or more create
index commands at the same time? If so, what would happen if I attempted to
do that? Would all but the first get ignored or would SQLServer simply
queue them to run them sequentially?
Thanks
Griff
Friday, March 9, 2012
Paging in Business Intelligent Reports
Any help would be appreciated.
Thanks
CalI'd be interested in hearing how you got BIDS to run. I'm still not able to use it. No devenv.exe file!!!!!!!!!!!!|||Well, it wasn't easy. I had installed to Sql Server included with Visual Basic Express. I then downloaded and installed the SQL Express Editon with Advanced Services. I then installed the SQL Express Edition Toolkit SP1. I did this twice before it worked. I hope this helps.
Cal|||I have installed the tool kit twice but still no devenv.exe. I haven't tried to re-nstall 2005 express advanced yet.|||
I'm going to move this question to the RS forum, they'll have specific advice about writting reports.
(we're working on the BIDS install issue in several other threads)
Mike
Paging Header and Detail
I would like to create a report with header and detail, like an invoice with invoice # and line items. I'd like the invoice # to come from a summary query that breaks 1 invoice # per page. Then I'd like to display the line items below the invoice # on each page, from a second query passing the invoice number as a parameter. How is this done? Do I need a subreport?
ie:
header from summary query:
invoice 101
detail from detail query passed invoice # = 101:
line 1 item A
line 2 item B
line 3 item C
page
header from summary query:
invoice 102
detail from detail query passed invoice # = 102:
line 1 item A
line 2 item B
line 3 item C
page
...
Thanks.
If you want to use two queries, yes, you need a subreport to display the line items.
If you can return all the data in one query, then you just need a table with group (by invoice #). The invoice information would be in the group header, and the line items would be in the detail rows.
Wednesday, March 7, 2012
Pagination does not work after Table Visiblity false.? Help : Urgent ? Please
Hi,
You know I was trying to create new report and found that works fine with
Pagining- URL Access.
But I want to hide report when there is not data return. In that case my
pagining does not work.
For hiding my table when no data return i do following steps:-
Table -> Properties-> Visiblity Tag-> Expression ->
IIF(count(Fields!FormName.Value)=0,True,False)
Which hide my table when no data return, but paginition also does not work.
Please Help me. What shall i proceed with these things..
Waiting for Response.
Thanks
Labhesh S
Bangalore
In This.
1. I want to hide my details table which return data , when there is no data returned.
2. I want pagination should work when there is data. But is it not happening. ?
3. Pagination is not happening because i have written code in expression for Hiding the table when there is no data.
But i need Pagination also.
Please help..
Labhesh Shrimali
Bangalore
|||
HTML renderer and Preview (which are soft page break renderers) will ignore page breaks of conditionally hidden items and their children.
PrintPreview , Image and PDF renderers (which are physical page break renderers) will respect these page breaks.
If there is no data for the table, than we will render:
NoRowsMessage property if you defined one
or
table header and footer
What is the case for you? What are trying to achieve by hidden the table?
If you are in case 2 and you don't want the header and footer, you can set their visibility instead of the table.
Thank you,
Nico
Saturday, February 25, 2012
page splits
create table test
(col1 int identity(1,1) primary key,
col2 varchar(10),
col3 varchar(10))
and now you pound this table with heavy inserts from multiple clients
Can it cause page splits ? It would appear that its inserting in order in
col1 and that pages will be ordered and written sequentially.. If it does
cause page splits, can you explain how ? And also will changing col1 to
nonclustered help ?
ThanksIt should not create page splits on inserts alone but if you update the
varchars later to a value larger than the original it can cause a split.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"Hassan" <hassan@.hotmail.com> wrote in message
news:%23B8bqUlFIHA.4308@.TK2MSFTNGP06.phx.gbl...
> Say you have a table as such
> create table test
> (col1 int identity(1,1) primary key,
> col2 varchar(10),
> col3 varchar(10))
> and now you pound this table with heavy inserts from multiple clients
> Can it cause page splits ? It would appear that its inserting in order in
> col1 and that pages will be ordered and written sequentially.. If it does
> cause page splits, can you explain how ? And also will changing col1 to
> nonclustered help ?
> Thanks
>
Monday, February 20, 2012
Page Number Needed in Report Header
I need to create a page number in a report header.
I wrote a function to calculate a number, however I do not know how to associate this with a new page event. How can this be handled and is there an easier way?
Here is my simple function:
Public Function getPageNumber(ByRef iPageNo As Integer) As Integer
Dim iNo as Integer
iNo = iNo + 1
Return iNo
End Function
Thanks,
cj
You can put the page number into a report header without using custom code.
Drop a textbox into the report header and use this expression:
=Globals!PageNumber
-Chris
|||I don't think that will work because the "=Globals!PageNumber" only works in the Page Header, not the Report Header, correct?
I get this error:
The value expression for the textbox ‘textbox97’ refers to the global variable PageNumber or TotalPages. These global variables can be used only in the page header and page footer.
~cj