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. setting up Crystal

setting up Crystal

Scheduled Pinned Locked Moved Visual Basic
databasesql-serversysadminhelpquestion
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.
  • T Offline
    T Offline
    twsted f8
    wrote on last edited by
    #1

    Hi Has any one out there used crystal with sql server to generate reports? I have been trying to get my code running that passes my login info and password to sql automatically. I have followed the instructions in the MSDN to set up these reports and one of the variables which I know I have declared is simply not being picked up. The code I ahve been making use of is as follows Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Public Class Form1 Private Sub configurecrystalreports() Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = "Northwind" myConnectionInfo.UserID = "limitedPermissionAccount" myConnectionInfo.Password = "1234" Dim reportpath As String = Application.StartupPath & "\" & "northwind.rpt" myCrystalReportViewer.ReportSource = reportpath setdblogforreport(myConnectionInfo) End Sub Private Sub setdblogforreport(ByVal myconnectioninfo As ConnectionInfo) Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos] ' vbstates that I 'have not declared mytablelogonInfo. myTableLogOnInfo.ConnectionInfo = myconnectioninfo Next End Sub I have gone over the instructions in the MSDN several times and I am still getting the same error. What am I doing wrong, or is there an easier way of doing this that is not using the wizards?

    C 1 Reply Last reply
    0
    • T twsted f8

      Hi Has any one out there used crystal with sql server to generate reports? I have been trying to get my code running that passes my login info and password to sql automatically. I have followed the instructions in the MSDN to set up these reports and one of the variables which I know I have declared is simply not being picked up. The code I ahve been making use of is as follows Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Public Class Form1 Private Sub configurecrystalreports() Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = "Northwind" myConnectionInfo.UserID = "limitedPermissionAccount" myConnectionInfo.Password = "1234" Dim reportpath As String = Application.StartupPath & "\" & "northwind.rpt" myCrystalReportViewer.ReportSource = reportpath setdblogforreport(myConnectionInfo) End Sub Private Sub setdblogforreport(ByVal myconnectioninfo As ConnectionInfo) Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos] ' vbstates that I 'have not declared mytablelogonInfo. myTableLogOnInfo.ConnectionInfo = myconnectioninfo Next End Sub I have gone over the instructions in the MSDN several times and I am still getting the same error. What am I doing wrong, or is there an easier way of doing this that is not using the wizards?

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      twsted f8 wrote:

      Dim mytablelogoninfo As TableLogOnInfos = myCrystalReportViewer.LogOnInfo

      twsted f8 wrote:

      For Each myTableLogOnInfo As TableLogOnInfo In [myTableLogOnInfos]

      Is that the difference, maybe?

      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