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


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



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

    Reply
     
    Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 3.00 average. Display Modes
      #1    
    Old August 11th, 2003, 05:39 AM
    Lorna Lorna is offline
    Member
     
    Join Date: Aug 2000
    Location: South Africa
    Posts: 195
    Lorna is an unknown quantity at this point (<10)
    Crystal reports

    I need some help with Crystal - I am new to the package and I'm battling with the VB integration

    My current .vbp project has a form with the following code

    General Declaration

    Public CrxApplication As New CRAXDRT.Application
    Public CrxReport As New CRAXDRT.Report

    Then in my code (I'm showing a menu - depending what the user chooses...)

    Select Case Index
    Case 0
    openfile.Filter = "Reports (*.rpt)|*.rpt"
    openfile.ShowOpen
    If openfile.FileName <> "" Then
    Set CrxReport = CrxApplication.OpenReport(openfile.FileName, 0)
    CrxReport.Database.LogOnServer "p2sodbc.dll", dsn, dbName, UserName, UserPassword
    '? "p2ssql.dll" vir sql?
    CRViewer1.ReportSource = CrxReport
    CRViewer1.ViewReport
    End If
    Case 2
    --------------------------------
    CrxReport.PrinterSetup Me.hWnd (HERE the error occurs)
    ---------------------------------
    Case 3
    CRViewer1.PrintReport

    Case 5
    End

    End Select


    when CASE = 2 my program errors - 'Method 'printersetup' of object 'Ireport' failed

    what does this mean? I am not using an "Ireport' somewhere

    Pse help

    Thanks!
    Reply With Quote
      #2    
    Old August 11th, 2003, 11:48 AM
    VB4Fun VB4Fun is offline
    Member
     
    Join Date: Apr 2003
    Posts: 53
    VB4Fun is an unknown quantity at this point (<10)
    Not sure about the IReport.

    But, you havent SET CrxReport under "2"...

    shouldnt that have been done ?
    __________________
    The secret of life, is enjoying the passage of time. - James Taylor
    Reply With Quote
      #3    
    Old August 11th, 2003, 01:19 PM
    UkeTopalli UkeTopalli is offline
    Member
     
    Join Date: Jun 2003
    Location: Vancouver
    Posts: 30
    UkeTopalli is an unknown quantity at this point (<10)
    IReport is the interface
    Reply With Quote
      #4    
    Old February 17th, 2006, 02:44 AM
    bogyoke bogyoke is offline
    Junior Member
     
    Join Date: Feb 2006
    Posts: 1
    bogyoke is an unknown quantity at this point (<10)
    Thumbs up Re: Crystal reports

    Dim crystal As New CRAXDRT.Application
    Dim report As New CRAXDRT.report
    Dim ms As String
    Private Sub Command1_Click()
    ms = "1"
    Set report = crystal.OpenReport("C:\test\Report\test.rpt")
    report.Database.LogOnServer "p2sodbc.dll", "test", "test", "test", "test"

    CRViewer91.ReportSource = report
    CRViewer91.ViewReport
    Do While CRViewer91.IsBusy
    DoEvents
    Loop
    CRViewer91.Zoom 77

    End Sub
    Private Sub CmdPrinterSetting_Click()
    If ms = "" Then
    MsgBox "ReportSource is Nothing"
    Exit Sub
    Else

    report.PrinterSetup Me.hWnd
    End If
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    ms = ""
    Set crystal = Nothing
    Set report = Nothing
    End Sub


    pls check

    if CRViewer91.ReportSource is nothing
    this error will be found

    Last edited by bogyoke; February 17th, 2006 at 04:21 AM.
    Reply With Quote
    Reply

    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 09:42 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009