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. loading report using crystal report

loading report using crystal report

Scheduled Pinned Locked Moved Visual Basic
helpsharepointdatabasesysadmintesting
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.
  • W Offline
    W Offline
    Wael Hawari
    wrote on last edited by
    #1

    hi evryone i am developping a window application and i need to use the crystal report to generate reports i have 2 databases named : Butterfly and Butterfly_Test Butterfly is used to real Data Butterfly_Test is used for testing i am using this code to load the report Dim myDbConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo With myDbConnectionInfo .ServerName = Glbl_Conn_Config.Server_Name .DatabaseName = Glbl_Conn_Config.Database_Name .Password = Glbl_Conn_Config.Password .UserID = Glbl_Conn_Config.Login End With Dim myTableLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo Dim myDatabase As CrystalDecisions.CrystalReports.Engine.Database = My_Report.Database Dim myTables As CrystalDecisions.CrystalReports.Engine.Tables = myDatabase.Tables Dim myTable As CrystalDecisions.CrystalReports.Engine.Table For Each myTable In myTables myTableLogonInfo = myTable.LogOnInfo myTableLogonInfo.ConnectionInfo = myDbConnectionInfo myTable.ApplyLogOnInfo(myTableLogonInfo) Next ' ' Get the report parameters collection. ' crParameterFieldDefinitions = My_Report.DataDefinition.ParameterFields ' Add a parameter value - START crParameterFieldLocation = crParameterFieldDefinitions.Item("@Language") crParameterValues = crParameterFieldLocation.CurrentValues crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue crParameterValues.Clear() crParameterDiscreteValue.Value = 1 crParameterValues.Clear() crParameterValues.Add(crParameterDiscreteValue) crParameterFieldLocation.ApplyCurrentValues(crParameterValues) Me.CrystalReportViewer1.ReportSource = My_Report Me.CrystalReportViewer1.PrintReport() evrything work fine when Glbl_Conn_Config.Database_Name = Butterfly_Test once i changed into Butterfly i have an error on loading report: Procedure or function SP_Select_All_User Expect Parameter @Language :doh: Can please any one help me

    waelhawari

    N 1 Reply Last reply
    0
    • W Wael Hawari

      hi evryone i am developping a window application and i need to use the crystal report to generate reports i have 2 databases named : Butterfly and Butterfly_Test Butterfly is used to real Data Butterfly_Test is used for testing i am using this code to load the report Dim myDbConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo With myDbConnectionInfo .ServerName = Glbl_Conn_Config.Server_Name .DatabaseName = Glbl_Conn_Config.Database_Name .Password = Glbl_Conn_Config.Password .UserID = Glbl_Conn_Config.Login End With Dim myTableLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo Dim myDatabase As CrystalDecisions.CrystalReports.Engine.Database = My_Report.Database Dim myTables As CrystalDecisions.CrystalReports.Engine.Tables = myDatabase.Tables Dim myTable As CrystalDecisions.CrystalReports.Engine.Table For Each myTable In myTables myTableLogonInfo = myTable.LogOnInfo myTableLogonInfo.ConnectionInfo = myDbConnectionInfo myTable.ApplyLogOnInfo(myTableLogonInfo) Next ' ' Get the report parameters collection. ' crParameterFieldDefinitions = My_Report.DataDefinition.ParameterFields ' Add a parameter value - START crParameterFieldLocation = crParameterFieldDefinitions.Item("@Language") crParameterValues = crParameterFieldLocation.CurrentValues crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue crParameterValues.Clear() crParameterDiscreteValue.Value = 1 crParameterValues.Clear() crParameterValues.Add(crParameterDiscreteValue) crParameterFieldLocation.ApplyCurrentValues(crParameterValues) Me.CrystalReportViewer1.ReportSource = My_Report Me.CrystalReportViewer1.PrintReport() evrything work fine when Glbl_Conn_Config.Database_Name = Butterfly_Test once i changed into Butterfly i have an error on loading report: Procedure or function SP_Select_All_User Expect Parameter @Language :doh: Can please any one help me

      waelhawari

      N Offline
      N Offline
      Netblue
      wrote on last edited by
      #2

      Waoula, Check the connection type your report uses internally when you designed it. Crystal likes to flake out when using certain connections. Try using the OLE DB (ADO) connection as a datasource when designing the report. Easiest way to change the datasource internally is by using the Set Datasource Location function, otherwise you will have to recreate some of the report. Let me know if that helps at all.

      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