Wrox Programmer Forums
|
BOOK: Professional ASP.NET 1.0, Special Edition/1.1
This is the forum to discuss the Wrox book Professional ASP.NET 1.1 by Alex Homer, Dave Sussman, Rob Howard, Brian Francis, Karli Watson, Richard Anderson; ISBN: 9780764558900
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 1.0, Special Edition/1.1 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 April 23rd, 2004, 01:28 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login failed

 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        BindReport()
    End Sub

    Sub BindReport()
        Dim myConnection As New SqlClient.SqlConnection()
        myConnection.ConnectionString = "data source=localhost;integrated security=sspi;database=mydatabase"
        Dim MyCommand As New SqlClient.SqlCommand()
        MyCommand.Connection = myConnection
        MyCommand.CommandText = "Select * from mytable "
        MyCommand.CommandType = CommandType.Text
        Dim MyDA As New SqlClient.SqlDataAdapter()
        MyDA.SelectCommand = MyCommand
        Dim myDS As New Dataset1()
        MyDA.Fill(myDS, "mytable")
        Dim oRpt As New CrystalReport1()
        oRpt.SetDataSource(myDS)

        For Each myTable In oRpt.Database.Tables
            myLogin = myTable.LogOnInfo
           myTable.ApplyLogOnInfo(myLogin)
        Next
        CrystalReportViewer1.ReportSource = oRpt
        '''''''''''''''''''''

    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myReport As CrystalReport1 = New CrystalReport1()
        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
        Try
            myReport.Export()
        Catch e1 As Exception
            Response.Write(e1.Message)
        End Try

    End Sub


'So my crystal report shown results accuratilly but when i click on button for export report then error show which is "Login failed"






Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting 'Login failed for user ' Squeakrz44 VB.NET 2002/2003 Basics 0 November 18th, 2006 06:09 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM
Login Failed for Email ??? reidcor BOOK: ASP.NET Website Programming Problem-Design-Solution 7 May 25th, 2004 11:51 AM





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