Log on exception in asp.net??

anand

Well-known member
Joined
Jan 29, 2003
Messages
76
Location
chicago
Hi friends
I am getting an error while using the Crystal reports with asp.net..pls give me a idea whats my mistake...

my file path is c:\anand\crysrep2" and there is a report in that path named as report.rpt..i am exporting the report as .pdf..i am getting the logon failed error...

i am using the following code


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myReport As Report2 = New Report2()
Dim DiskOpts As CrystalDecisions.Shared.DiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions()

myReport.ExportOptions.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile

myReport.ExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat

DiskOpts.DiskFileName = "c:\Output.pdf"
myReport.ExportOptions.DestinationOptions = DiskOpts
myReport.Export()
End Sub


error is:


Server Error in /anand/cryrep2 Application.
--------------------------------------------------------------------------------

Logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Source Error:


Line 103: DestinationOptions property to point to the
Line 104: DiskFileDestinationOption object.
Line 105: myReport.Export()
Line 106:
Line 107: This statement exports the report based on the previously set properties.

Source File: C:\anand\cryrep2\WebForm1.aspx.vb Line: 105

pls give me a idea what mistake i did...

Thanks
Satya
gummadi009@yahoo.com
gummadilli@hotmail.com
 
Anand:

You are dimensioning "myReport" as a New Report2. Is that "Report2" object a report document object? And if so, have you already taken care of logging into the table/stored proc (datasource) that the report uses? That may be from where the "Logon failed" message is generated.

Another possibility (although I think youd get a different error message) is that you have not properly set the security rights for the folder/drive/etc. that the exported file will be exported to, for the ASPNET account. That account will have to have rights to write to that path, read items in that path, blah blah...

I think if you check those couple of things, youll find the problem. Thanks and good luck. :D
 
Hi friend
there report2 is the stringly typed report ...i created that using oledb connection ..i gave user name and password also....at that time it didnt give error..report was created...when i am exporting that its giving error...
but its working properly when i dorectly crtaed a report using db file from access...when i am using datasourec or oledb(ado) its giving error..pls let me know whats the solution..
Thanks
Anand
 
anand:
I dont have much experience in using strongly-typed reports. Ive only attempted working with pre-existing Crystal reports, so I dont believe Im going to be much to you on this one. But, I guess to cover the obvious questions: 1) have you double-checked your logon information for the report? 2) are you sure that the database is running when you attempt to export? (in other words, I use SQL 7.0 on my machine, and I have to make sure that the proper MSSQL service is running, or I get nothin.)

These are probably all raw, newbie questions, but its a start. Hope this gives you some additional ideas from which to start. If I find out anything else, Ill re-post it. Good luck. :)
 
Hi Daspoo
How are u??i want to know how to pass pearmeters to teh crystal reports in .Net..i think i already tryed for that.i created 2 perameters ...i want to know how to use those...pls let me know how to add some controls like combobox or text field in crystal report..and tell me how to use those with crystal reports...

Thank you
Satya/anand
gummadi009@yahoo.com
 
Back
Top