Solved

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

Posted on 2009-07-04
6
476 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS ReportViewer report timeout 7 100
Export import database 4 41
Get Duration of last Status Update 4 29
Updating a table from a temp table 4 26
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

914 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now