Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-07-04
6
Medium Priority
?
487 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
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.
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 combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

618 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