pmasseycpa
asked on
SQL Reporting Services SSRS 2005 - Adding Parater with Default Value Causes Error
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!
SSRS2005ParameterValue02.jpg
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
SSRS2005ParameterValue01.jpgSSRS2005ParameterValue02.jpg
It looks like you need to remove the default value from this paramete. Try blanking it out on the default parameter section.
ASKER
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.
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.
Hopefully that should fix it.
P.
ASKER
But I made the default value NULL and it didn't help. Wouldn't that be the same or better than your suggestion pssandhu?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh, that would explain it. Yes, you cannot use the same datasource to get parameters values as your main dataset for the report.
P.
P.