CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2000
    Posts
    13

    To Run Reports Generated Using Crystal Report In An VB 6.0 Exe Application

    HI All,

    Can Anybody tell me how can i deploy the reports that i have developed using
    Crystal Report 7.0 In VB 6.0 Application Along with my package.
    In deveolpment environment it is fine to run the report using system DSN & Crystal report control , but what do i do with the reports when making my application a package with regards to reports.


    Help will be most welcome.

    Bye all.




  2. #2
    Join Date
    Jul 1999
    Location
    USA
    Posts
    101

    Re: To Run Reports Generated Using Crystal Report In An VB 6.0 Exe Application

    When you use PDW or any other set up wizard, it automatically includes all the necassary dll's required to install crystal reports on the client machine. you may have to add any of the files required to run your application, though.

    Hope it helps


  3. #3
    Guest

    Re: To Run Reports Generated Using Crystal Report In An VB 6.0 Exe Application

    CODE IN THE CRformShow:

    Dim Report as new CR_1
    Dim DbName as CRAXDRT.Database
    Dim DbTables as CRAXDRT.DatabaseTables
    Dim DbTable as CRAXDRT.DatabaseTable
    Dim CRTables as CRAXDRT.DatabaseTables
    Dim CRTable as CRAXDRT.DatabaseTable
    Dim CRSections as CRAXDRT.Sections
    Dim CRSection as CRAXDRT.Section
    Dim CRSubreportObj as CRAXDRT.SubreportObject
    Dim CRReportObjects as CRAXDRT.ReportObjects
    Dim CRSubreport as CRAXDRT.Report
    Dim ReportObject as Object


    private Sub Form_Load()

    Screen.MousePointer = vbHourglass

    Report.DiscardSavedData
    set DbName = Report.Database

    set DbTables = DbName.Tables
    for i = 1 to DbTables.Count
    set DbTable = DbTables.Item(i)
    DbTable.location = DB_FILE
    next i

    'change location to subreports (subreports on same mdb file)
    'get the sections from the Main report
    set CRSections = Report.Sections

    'Go through each section in the main report...
    for Each CRSection In CRSections
    'get all the objects in this section...
    set CRReportObjects = CRSection.ReportObjects
    'Go through each object in the reportobjects for this section...
    for Each ReportObject In CRReportObjects
    'Find the object which is the SubreportObject
    If ReportObject.Kind = crSubreportObject then
    'Found a subreport, now get a hold of it
    set CRSubreportObj = ReportObject
    'Open the subreport and treat it as any other report
    set CRSubreport = CRSubreportObj.OpenSubreport
    'get the Tables collection for the subreport
    set CRTables = CRSubreport.Database.Tables
    for i = 1 to CRTables.Count
    'get the first table from the Tables collection
    set CRTable = CRTables.Item(i)
    'set the location of the .mdb file
    CRTable.location = DB_FILE
    next i
    End If
    next ReportObject
    next CRSection

    Report.VerifyOnEveryPrint = true
    CRViewer1.ReportSource = Report
    CRViewer1.ViewReport
    Screen.MousePointer = vbNormal

    End Sub
    private Sub Form_Resize()
    CRViewer1.Top = 0
    CRViewer1.Left = 0
    CRViewer1.Height = ScaleHeight
    CRViewer1.Width = ScaleWidth

    End Sub




    FILES TO INSTALL IN WINDOWS\SYSTEM:

    craxdrt.dll
    crpaig32.dll
    CRViewer.dll
    crxlat32.dll
    p2bdao.dll 'needed with Office 2000, and when you get the error:
    p2ctdao.dll "file DBDAO.dll missing"
    p2irdao.dll 'see above
    u2ddisk.dll 'to export the report in a variety of formats: there are
    u2?????.dll '14 files with the name u2???.dll

    hope this helps....



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured