CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2
  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

     
     
    Thread Tools Search this Thread Rate Thread Display Modes
    Prev Previous Post   Next Post Next
      #6    
    Old March 18th, 2008, 05:18 PM
    vbnov vbnov is offline
    Member
     
    Join Date: Jan 2003
    Posts: 193
    vbnov is an unknown quantity at this point (<10)
    Re: Export Crystal reports to PDF

    Thank you!

    But I have a new problem now. I am using report document and dataadapter to fill the dataset.

    Even though I have a SQL Query for the dataset, it pulls all the rows from the table.

    Below is the code.

    Code:
    dbConnection.Open()
    Dim Report As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    Dim sqlAdap, fname As String
    
    Report.Load(Server.MapPath("SR.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
    
    sqlAdap = "SELECT STARTDATE, ENDDATE, PREPAREDBY, PREPAREDDATE, AMOUNT, CURRENCY  FROM SREPORTS WHERE CYID = '" & PID & "' AND STARTDATE = '" & SDate & "' AND ENDDATE = '" & EDate & "'"
    
                Dim DSresults = New System.Data.DataSet()
                Dim Adap As New System.Data.OleDb.OleDbDataAdapter()
                Adap.SelectCommand = New System.Data.OleDb.OleDbCommand(sqlAdap, dbConnection)
    
                Adap.Fill(DSresults, "SR")
    
                fname = "C:\Rpts\SR" & PID & ".PDF"
    
                Report.SetDataSource(DSresults)
                Report.SetDatabaseLogon(USR, PWD)
                Report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, fname)
    Reply With Quote
     

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Crystal Reports


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:10 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.