Wrox Programmer Forums
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 31st, 2006, 02:06 AM
Registered User
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal reports

I working crystal reports in .net . report viwer is used toopen the reports in web application. Database(sql server) is connecting using oledb with Windows authentication.

now my problem is in run time crystal reports is giving login failed.
Otherwise how can i specify "windows authentication" in loginfo of the crystal reports.

can anybody help?

Old February 1st, 2006, 04:09 AM
Authorized User
Join Date: Jan 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts

HI there .
If u r using SQL DATABASE , then y dont u go for sqlclient connectivity. i mean use sqldataadapter and its connectivity , bcz its much more relaible. anyways your problem is no where releted to this topic.
let me show u the code to make the login for crystal report web applications.
 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>

              Dim Rport As New CryRWebForm13

          ' providing the log on authentication
            Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
            Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
            For Each myTable In Rport.Database.Tables
                myLogin = myTable.LogOnInfo
                myLogin.ConnectionInfo.ServerName = ServerName
                myLogin.ConnectionInfo.DatabaseName = DatabaseName
                myLogin.ConnectionInfo.Password = Password
                myLogin.ConnectionInfo.UserID = UserName
            Rport.SetDatabaseLogon(UserName, Password, ServerName, DatabaseName)
' username -> database username eg: sa
' password -> DB password eg : ""
' Servarname -> ServerName eg: sqlServer
' Databasename -> Db Name eg: SaudiSystemsDB

               ' passing parameters
            Rport.SetParameterValue("YEAR_ID", lstYear.SelectedValue)
            Rport.SetParameterValue("GLOBAL_STATUS", lstGStatus.SelectedValue)
            Rport.SetParameterValue("PRO_TYPE", lstType.SelectedValue)
            Rport.SetParameterValue("PRO_STATUS", lstStatus.SelectedValue)
            'Rport.FormatEngine.PrintOptions.PaperOrientation = PaperOrientation.Landscape
            Rport.PrintOptions.PaperOrientation = PaperOrientation.Landscape

           ' binding the report
            CrystalReportViewer1.ReportSource = Rport

thts it,
now i think u will get the idea how to go for dynamic reports using web application in dotnet
best of luck

Mohammed Raza Ullah Khan
Old February 3rd, 2006, 12:53 AM
Registered User
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts


I am using sqladapter only.
my sample code is below:

dim rpt as crystalreport1
dim myadapter as new sqladapter("select * from employee",sqlconn)
dim mydataset as new dataset

the abovecode is givingthe following error:
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.LogOnExcept ion: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[LogOnException: Logon failed.]
   .F(String  , EngineExceptionErrorID 
) +506
   .A(Int16 , Int32 ) +537
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.GetPage(PageRequestContext reqContext) +539
   CrystalDecisions.ReportSource.LocalReportSourceBas e.GetPage(PageRequestContext pageReqContext) +189
   CrystalDecisions.Web.ReportAgent.u(Boolean N) +164
   CrystalDecisions.Web.CrystalReportViewer.OnPreRend er(EventArgs e) +108
   System.Web.UI.Control.PreRenderRecursiveInternal() +62
   System.Web.UI.Control.PreRenderRecursiveInternal() +125
   System.Web.UI.Control.PreRenderRecursiveInternal() +125
   System.Web.UI.Page.ProcessRequestMain() +1489

.............. pls help me rgd this

Old September 20th, 2011, 08:41 AM
Registered User
Join Date: Sep 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I don't know if it can help you and other with Crystal Report, but we have an amazing online course (with a lot of free videos) that complete all of the Wrox books about it.
You can see it at:

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get reports in crystal reports using ASP3.0 candy133 Classic ASP Basics 2 January 26th, 2006 08:26 AM
Comparitive Reports in Crystal Reports tarunm Crystal Reports 1 January 21st, 2006 01:08 AM
comparision among crystal reports and Data reports avats Crystal Reports 0 April 13th, 2005 01:01 PM
How to create/design reports with crystal reports BassmaniaQ Crystal Reports 0 December 14th, 2004 04:58 AM
crystal reports emprise VB Databases Basics 0 July 26th, 2004 03:30 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.