Results 1 to 4 of 4

Thread: Can't set the report source

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    122

    Can't set the report source

    I have crystal reports 9 and vb .net. In my windows application. I manipulate a table which is to be used as the source of a crystal report. When the user clicks the report button, the app. should open a new form with the crystal reports viewer, showing a pre-Designed local report for printing. I am stuck, because no matter how I try, I cannot bind the data to the report.

    I have tried by name using full path and relative path. I get an error that says no such interface supported.

    I have tried by creating a report object, but I cannot add the namespace CrystalDecisions.CrystalReports.Engine , as it says it can't be found.

    I have tried also adding the report to my project, and creating a new instance of the report, but it says the type is not defined.

    It almost seems like I don't have crystal installed properly, but I just re-installed it and am still running into the same problems. Can anybody offer me some advice?

    Thanks, Jonathan

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    I assume you have the Crystal Viewer Control selected in the properties menu. I use this code to send a report to the screen using the viewer. The printer drivers, etc are selected by the user. If they choose "screen", then glbPrinterDestination is set to 0.


    Set Report = crxApplication.OpenReport("Z:\DAD\balanceByLabel.rpt", 1)
    For Each crxDatabaseTable In Report.Database.Tables
    crxDatabaseTable.SetLogOnInfo "", "", "", "password"
    crxDatabaseTable.LOCATION = "Y:\DAD\Techni.mdb"
    Next crxDatabaseTable
    Report.SelectPrinter glbPrinterDriver, glbPrinterName, glbPrinterPort
    If glbPrinterDestination = 0 Then
    glbReportForm = "frmProduction"
    CRViewer.Show vbModal
    Else
    Report.PrintOut False
    End If

    I have a form called CRViewer. The code in the Form Load is:


    Select Case glbReportForm
    Case "frmProduction"
    CRViewer1.ReportSource = frmA10.Report
    end Select
    SCREEN.MousePointer = 0
    CRViewer1.ViewReport

    I also have a resize procedure

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

    CRViewer1.Zoom 75



    I hope this helps some.

  3. #3
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    This should read:

    CRViewer1.ReportSource = frmProduction.Report


    I am using 8.5 with VB6. Maybe it is completely different from the versions you are using.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2002
    Posts
    122
    What is CRXApplication? I think I am missing that component. Thats what I think my problem is, I think I am missing some necessary things. I reinstalled crystal, but couldn't find any options to install vb components seperately, so I just assumed they were installed on their own.

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