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. Passing parameters to crystl Report at runtime using vb.et

Passing parameters to crystl Report at runtime using vb.et

Scheduled Pinned Locked Moved Visual Basic
helpcsharp
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.
  • S Offline
    S Offline
    saneng
    wrote on last edited by
    #1

    hello i m using vb.net 2005 and crystal report 9 the problem is that when i pass the parameters to my report the crystal report viewer that is on another does not show the report my code is below Dim reportdocument As New ReportDocument Dim strRptPath As String strRptPath = "d:\Attendance System\Attendance Reports\TodayAbsRpt.rpt" reportdocument.Load(strRptPath) Dim todayval As Long Dim paramfields As New ParameterFields Dim paramfield As New ParameterField Dim paramdisval As New ParameterDiscreteValue todayval = Me.DTPsdate.Text.Substring(6, 4) & Mid(Me.DTPsdate.Text, 4, 2) & Me.DTPsdate.Text.Substring(0, 2) paramfield.ParameterFieldName = "DpttNm" paramdisval.Value = Me.cmbDptt.Text paramfield.CurrentValues.Add(paramdisval) paramfields.Add(paramfield) paramfield = New ParameterField paramfield.ParameterFieldName = "pDate" paramdisval.Value = todayval paramfield.CurrentValues.Add(paramdisval) paramfields.Add(paramfield) Dim frm As New FrmRpt(reportdocument) frm.CrystalReportViewer1.ParameterFieldInfo = paramfields frm.CrystalReportViewer1.ReportSource = reportdocument frm.Show() please help me out ,ur help is highly appreciated

    K 1 Reply Last reply
    0
    • S saneng

      hello i m using vb.net 2005 and crystal report 9 the problem is that when i pass the parameters to my report the crystal report viewer that is on another does not show the report my code is below Dim reportdocument As New ReportDocument Dim strRptPath As String strRptPath = "d:\Attendance System\Attendance Reports\TodayAbsRpt.rpt" reportdocument.Load(strRptPath) Dim todayval As Long Dim paramfields As New ParameterFields Dim paramfield As New ParameterField Dim paramdisval As New ParameterDiscreteValue todayval = Me.DTPsdate.Text.Substring(6, 4) & Mid(Me.DTPsdate.Text, 4, 2) & Me.DTPsdate.Text.Substring(0, 2) paramfield.ParameterFieldName = "DpttNm" paramdisval.Value = Me.cmbDptt.Text paramfield.CurrentValues.Add(paramdisval) paramfields.Add(paramfield) paramfield = New ParameterField paramfield.ParameterFieldName = "pDate" paramdisval.Value = todayval paramfield.CurrentValues.Add(paramdisval) paramfields.Add(paramfield) Dim frm As New FrmRpt(reportdocument) frm.CrystalReportViewer1.ParameterFieldInfo = paramfields frm.CrystalReportViewer1.ReportSource = reportdocument frm.Show() please help me out ,ur help is highly appreciated

      K Offline
      K Offline
      kkb_2001
      wrote on last edited by
      #2

      search in msdn with the title= "Setting Parameters Manually in Code" and "Creating a Report with Parameters" may be you get some one good for you -- modified at 8:04 Friday 12th October, 2007

      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