crystal report  error  Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: 18456 ]

insane 007 .
insane 007 . used Ask the Experts™
on
hiii im using crystal report in my web application in which i have a main report and a subreport my problem is that in my subreport i have passed a store procedure which except parameter @relationid so in code behind i have used this code to set that parameter value which is  

rpt.SetParameterValue("@relationid", documentId, rpt.Subreports[0].Name.ToString());

i have linked subreport with main report parameter but im getting this error  which is attached below  any solution thanks in advance
Capture.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sam Simon NasserIT Support Professional
Commented:
It might be report specific, a sub-report maybe trying to logon using credentials stored within the report, rather than the credentials you've passed into it via the code; You need to loop through all sub-reports rather than just the main report setting the login information.
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
DOes your code pass the logon parameters to the report?
They are not stored with the report.

As stated above you need to s logon for the main report and all subreports.  The code for passing the logon credentials changes slightly with version and method.
What version of Crystal?

What code are you using to call the report?

Author

Commented:
I have pass logon parameters as suggested by you guys for reports and its working now  thanks for the help

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial