Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Dynamic loading data in crystal report

Dynamic loading data in crystal report

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi, I have develop an application in vb2005 and want to produce the report in crystal report. From here, does anyone know how to display a report in crystal report (which integrated with vb2005) with a dynamic coding? Thank in advance

    J 1 Reply Last reply
    0
    • L Lost User

      Hi, I have develop an application in vb2005 and want to produce the report in crystal report. From here, does anyone know how to display a report in crystal report (which integrated with vb2005) with a dynamic coding? Thank in advance

      J Offline
      J Offline
      JamesS C1
      wrote on last edited by
      #2

      Hello, To include the report on the Web page, we need to drag and drop the Crystal Report Viewer control from the Toolbox. Because the Crystal Report Viewer control doesn't have a ReportSource property available at design time, you have to set that property inside your code. Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer #Region " Windows Form Designer generated code " Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CrystalReportViewer1.ReportSource = Server.MapPath("crystalreport1.rpt") End Sub End Class. or you can create instance of the report class which was created by Visual Studio.NET when you designed your report. The name of that file is same as report that you create CrystalReport1.vb. To see this file expand CrystalReport1.rpt (click on + sign in front of the CrystalReport1.rpt). Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer #Region " Windows Form Designer generated code " Dim crpt As CrystalReport1 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load crpt = New CrystalReport1() CrystalReportViewer1.ReportSource = crpt End Sub End Class. If you set WebForm1.aspx to be the Start Up page for the project, and start the project, you will get the report page if you have blank password in database for "sa". If "sa" or any other user name that you want to use to access database has password, when you run the report, you will see the "LogonFailed" error. If we were developing windows application, Crystal Reports will ask us for password information. This error occured, because when you design and save report, all of the connection information is saved within the report except password. If the password is blank, there will be no problem to create or generate the report. To prevent this, you will need to provide login information in your code before you set ReportSource property. To do so, you will add some code in Page_Load event. Now, your code should look like: Imports CrystalDecisions.CrystalReports.Engine

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups