Solved

SQL Reporting Services SSRS 2005 - Adding Parater with Default Value Causes Error

Posted on 2009-07-04
6
481 Views
Last Modified: 2012-05-07
I have a SQL Report that I would like to include drop down values for users to pick from.  I created a Parameter in the report.  If I don't try to make it a drop down, it works fine. I enter a value and the restricted report runs.  If I try to make it a drop down, I get the error shown in the screenshots.  I have included my parameter setup and errors in the screenshots.  My query code is below also.

P.S. - I get this error EVERY TIME I write a report so I am sure I am missing something, but I'm tired of the error and I'd love to get it right.  Thanks for your help!
select 'OPEN' as TABLEID, JRNENTRY, SOURCDOC, REFRENCE, TRXDATE, ORCTRNUM, ORMSTRID, ORDOCNUM, ORTRXSRC, CRDTAMNT, DEBITAMT from GL20000 
where ACTINDX = '41' AND SOURCDOC = @SourceDoc
UNION ALL
select 'HIST' as TABLEID, JRNENTRY, SOURCDOC, REFRENCE, TRXDATE, ORCTRNUM, ORMSTRID, ORDOCNUM, ORTRXSRC, CRDTAMNT, DEBITAMT from GL30000 
where ACTINDX = '41' AND SOURCDOC = @SourceDoc
order by SOURCDOC, JRNENTRY, TRXDATE

Open in new window

SSRS2005ParameterValue01.jpg
SSRS2005ParameterValue02.jpg
0
Comment
Question by:pmasseycpa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:mfreuden
ID: 24777004
It looks like you need to remove the default value from this paramete.  Try blanking it out on the default parameter section.
0
 

Author Comment

by:pmasseycpa
ID: 24777028
I should have said, but I did try to change it to NULL on the parameter screen and that didn't help.  Is that what you meant?  If I have a value in EITHER place (available or default) I get the error.
0
 
LVL 17

Expert Comment

by:pssandhu
ID: 24777366
Under default values click non-queried and hand type the value. Your dataset ie returning multiple values and that is probably what is confusing the report server engine. By typing one value under the Non-Queried you are providing one value which the engine should be able to parse.
Hopefully that should fix it.
P.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:pmasseycpa
ID: 24778804
But I made the default value NULL and it didn't help.  Wouldn't that be the same or better than your suggestion pssandhu?  
0
 

Accepted Solution

by:
pmasseycpa earned 0 total points
ID: 24778837
Nevermind.  I had to create a second dataset to use for the parameter. I could not use the same dataset that my report was based on.  It confuses the report.  See here  http://msdn.microsoft.com/en-us/library/aa337234.aspx.
0
 
LVL 17

Expert Comment

by:pssandhu
ID: 24778845
Oh, that would explain it. Yes, you cannot use the same datasource to get parameters values as your main dataset for the report.
P.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question