Results 1 to 4 of 4

Thread: Run existing Crystal Report in VB.NET

Hybrid View

  1. #1
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 05
    Location
    Canada
    Posts
    794

    Run existing Crystal Report in VB.NET

    I have an existing Crystal report built (using Crystal Reports), and I want to be able to share it with other users who don't have Crystal installed. Actually, I want them to be able to run it themselves. I figure the best way to do that is to setup a little VB.NET app that calls the report and sends a few parameters like date, llocation - whatever.

    I know there is a Crystal Reports "viewer" in VS 2010 but I'm not sure how to use it to run my report. I've found a couple of examples online but I must be missingsomething. This one in particular seems pretty good, but myVB doesn't like the code snippet highlighted in bold below:

    Imports CrystalDecisions.CrystalReports.Engine
    Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles Button1.Click
    Dim cryRpt As New ReportDocument
    cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
    CrystalReportViewer1.ReportSource = cryRpt
    CrystalReportViewer1.Refresh()
    End Sub
    End Class

    Any help/insight is appreciated. Oh - and I'm putting in the actual path/file name for my file in the program - not using "PUT CRYSTAL PATH HERE" as shown above!

  2. #2
    Frenzied Member
    Join Date
    Sep 05
    Location
    Modesto, Ca.
    Posts
    1,590

    Re: Run existing Crystal Report in VB.NET

    You should post this in the Reporting Forum, also , what is the error?

  3. #3
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 05
    Location
    Canada
    Posts
    794

    Re: Run existing Crystal Report in VB.NET

    Quote Originally Posted by wes4dbt View Post
    You should post this in the Reporting Forum, also , what is the error?
    I had it loaded but I didn't save it. Basically, after pasting the code VS underlined a bunch of code with squiggly blue lines. Its like I was missing a reference or something.

  4. #4
    Super Moderator Hack's Avatar
    Join Date
    Aug 01
    Location
    Searching for mendhak
    Posts
    58,283

    Re: Run existing Crystal Report in VB.NET

    Moved To The Reporting Section
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

Posting Permissions

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