Solved

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

Posted on 2009-07-04
6
477 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Some sers suddenly getting error popup msg 28 87
Webservices in T-SQL 3 30
SSRS 2016 KPI 2 14
Create snapshot on MSSQL 2012 3 17
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

776 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