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. Web Development
  3. ASP.NET
  4. why it gives an error in crystal report?

why it gives an error in crystal report?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netdatabasesysadmin
1 Posts 1 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.
  • H Offline
    H Offline
    hi_everybody
    wrote on last edited by
    #1

    hi to all, i am new in asp.net, i want to create parameterised crystal report. i did it i create parameter "Empid " using "Parameter Fields" then i want to show the report on click event of button so code is as follows, Protected Sub btnShow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShow.Click Dim ConnInfo As New ConnectionInfo With ConnInfo .ServerName = ".sqlexpress" .DatabaseName = "Northwind" .UserID = "sa" .Password = "" End With Me.CrystalReportViewer1.ParameterFieldInfo.Clear() If Me.txtEmployeeID.Text.Trim.Length > 0 Then Me.CrystalReportViewer1.ReportSource = Server.MapPath("SampleParam1.rpt") Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo Dim p_EmpID As New ParameterField p_EmpID.Name = "p_EmployeeID" Dim p_EmpID_Value As New ParameterDiscreteValue p_EmpID_Value.Value = Me.txtEmployeeID.Text p_EmpID.CurrentValues.Add(p_EmpID_Value) ParamFields.Add(p_EmpID) Else Me.CrystalReportViewer1.ReportSource = Server.MapPath("SampleRpt01.rpt") End If For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo cnInfo.ConnectionInfo = ConnInfo Next Me.CrystalReportViewer1.RefreshReport() End Sub i am using sql2000, but after the clicking on button it will show me an error ,"Object Reference not set to an instance of an object". why i gives me error? is the servername is wrong? what the name should i provide? my database is on another computer and i am accessing it through networking the name of the computer is "RS1" so should i give the servername="RS1" if i debug the code , CrystalReportViewer1.LogOnInfo have count=0. what is error?

    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