Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports Logon Failed 1

Status
Not open for further replies.

theoryofben

IS-IT--Management
Aug 25, 2001
149
US
Ok, this one is bugging me.

I have a very simple crystal report, I'm loading it a crystal viewer, it works great as long as I hard code the parameter value
Code:
cr.SetParameterValue("ev_id", "asdffweKhersdf")

But if I use a variable I get a logon failed error. I have to use a variable because it's pretty useless if I only can run the report for one value.
Code:
cr.SetParameterValue("ev_id", my_id)

I'm getting the following error
CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Any ideas?

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
are you using a dataset? if so, you still have to login to the DB to get your data. I know that would seem like your logging in twice but your not. when setting up your dataset all you doing is accessing your tables at that time.

post your viewer page load code.

 
no, I'm using the pull method. There is only one parameter, an id value. The report gets the data it needs based on the input parameter.

The weird part is that it works perfectly when I put set the parameter value with a direct string like:
Code:
cr.SetParameterValue("ev_id", "asdffweKhersdf")
but it throws this error if I use a variable for the parameter value like:
Code:
Dim my_id as string
my_id="asdffweKhersdf"
cr.SetParameterValue("ev_id", my_id)
That's just an example, I'm actually getting the my_id value from a session variable. I've verified that it is pulling the correct value from the session variable.

Any idea why that would make a difference?

I'm at home now, I'll post the code tomorrow morning when I get to work.

Thanks

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
I use the "Push" method. since your using a session value..why not add a hidden label to your viewer form and pass the session to that lable, then pass the value of that label as your CR parameter. see if that works

 
Still no go. I'm at a loss.

But my supervisor has developed a different method of doing what we need. So I will just finish the app and I can plug in his solution for this task (barcodes).

I have no idea what's going on. I would say that it's the actual rpt file, but it's such a simple report...that I don't see how that could be it.

Unfortunately, because of our deadline, I can't spend any more time trying to make it work. I may tinker with it this weekend just to see if I can figure it out. I'll post the results if I find a solution.

I appreciate all of your help.

________________________________________________
"I have not failed. I've just found 10,000 ways that won't work."-Thomas Edison

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top