how to add selected values into crystal report thorugh checkboxes in vb.net2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harikap
    New Member
    • Nov 2007
    • 10

    how to add selected values into crystal report thorugh checkboxes in vb.net2005

    hi ,
    here im using vb.net 2005how can i add radiobuttons as column to windows datagridview control
    plz help me....
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    Originally posted by harikap
    hi ,
    here im using vb.net 2005how can i add radiobuttons as column to windows datagridview control
    plz help me....
    Hi,
    Guess radio buttons are not supported within datagridviews.
    You could use a checkbox.

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by harikap
      hi ,
      here im using vb.net 2005how can i add radiobuttons as column to windows datagridview control
      plz help me....
      see here....

      Radiobutton in Gridview

      Comment

      • harikap
        New Member
        • Nov 2007
        • 10

        #4
        add radiobuttons to datagridview vb.net2005

        I have added checkboxes to datagridview dynamicaly in vb.net 2005
        Like…….
        Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
        Try
        Dim rb As New RadioButton
        con.ConnectionS tring = "Server= harika;uid=sa; initial catalog=superly nx"
        con.Open()
        cmd.CommandText = "select * from reports"
        cmd.Connection = con
        cmd.CommandType = CommandType.Tex t
        Call populategrid()
        Catch ex As Exception
        MsgBox("Load" & ex.Message)
        Finally
        con.Close()
        End Try
        End Sub
        Private Sub populategrid()
        Dim dtcCheck As New DataColumn("Sel ect")
        dtcCheck.DataTy pe = System.Type.Get Type("System.Bo olean")
        dtcCheck.Defaul tValue = False
        adpt = New SqlDataAdapter( "SELECT * FROM reports", con)
        ds = New DataSet
        adpt.Fill(ds, "reports")
        'dvEmp = New DataView
        'dvEmp.Table = dsEmp.Tables(0)
        dt = New DataTable
        dt = ds.Tables("repo rts")
        dt.Columns.Add( dtcCheck)
        DataGridView1.D ataSource = dt


        End Sub
        O/p is:


        Like wise how can I add radiobuttons to this windows datagridview dynamically

        Comment

        • harikap
          New Member
          • Nov 2007
          • 10

          #5
          how to add selected values into crystal report thorugh checkboxes in vb.net2005

          I have added checkboxes to datagridview dynamicaly in vb.net 2005
          Like…….
          Code:
          Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                  Try
                      Dim rb As New RadioButton
                      con.ConnectionString = "Server= harika;uid=sa; initial catalog=superlynx"
                      con.Open()
                      cmd.CommandText = "select * from reports"
                      cmd.Connection = con
                      cmd.CommandType = CommandType.Text
                      Call populategrid()
                  Catch ex As Exception
                      MsgBox("Load" & ex.Message)
                  Finally
                      con.Close()
                  End Try
              End Sub
          Private Sub populategrid()
                  Dim dtcCheck As New DataColumn("Select")
                  dtcCheck.DataType = System.Type.GetType("System.Boolean")
                  dtcCheck.DefaultValue = False
                  adpt = New SqlDataAdapter("SELECT * FROM reports", con)
                  ds = New DataSet
                  adpt.Fill(ds, "reports")
                  'dvEmp = New DataView
                  'dvEmp.Table = dsEmp.Tables(0)
                  dt = New DataTable
                  dt = ds.Tables("reports")
                  dt.Columns.Add(dtcCheck)
                  DataGridView1.DataSource = dt
          
          
              End Sub
          O/p is:


          If I check those checkboxes how can I get the (rep_no,rep_nam e) values for each row into crystal report

          i.e., how the selected values can be appeared in the crystal report header as columns……..

          Comment

          • harikap
            New Member
            • Nov 2007
            • 10

            #6
            how to add selected values into crystal report thorugh checkboxes in vb.net2005

            I have added checkboxes to datagridview dynamicaly in vb.net 2005
            Like…….[CODE=vb]
            Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
            Try
            Dim rb As New RadioButton
            con.ConnectionS tring = "Server= harika;uid=sa; initial catalog=superly nx"
            con.Open()
            cmd.CommandText = "select * from reports"
            cmd.Connection = con
            cmd.CommandType = CommandType.Tex t
            Call populategrid()
            Catch ex As Exception
            MsgBox("Load" & ex.Message)
            Finally
            con.Close()
            End Try
            End Sub
            Private Sub populategrid()
            Dim dtcCheck As New DataColumn("Sel ect")
            dtcCheck.DataTy pe = System.Type.Get Type("System.Bo olean")
            dtcCheck.Defaul tValue = False
            adpt = New SqlDataAdapter( "SELECT * FROM reports", con)
            ds = New DataSet
            adpt.Fill(ds, "reports")
            'dvEmp = New DataView
            'dvEmp.Table = dsEmp.Tables(0)
            dt = New DataTable
            dt = ds.Tables("repo rts")
            dt.Columns.Add( dtcCheck)
            DataGridView1.D ataSource = dt


            End Sub[/CODE]
            O/p is:


            Like wise how can I add radiobuttons to this windows datagridview dynamically
            Last edited by bartonc; Nov 21 '07, 05:04 AM. Reason: Added [CODE=vb][/CODE] tags.

            Comment

            • Shashi Sadasivan
              Recognized Expert Top Contributor
              • Aug 2007
              • 1435

              #7
              Hi harikap
              Please read the FAQ about double Posting
              Please do not double Post Your Questions

              If you feel that your Post has gone down the ladder without anyone replying, post / bump in the same thread to bring it up.

              Please use your previous thread to continue with the same question.

              Comment

              • harikap
                New Member
                • Nov 2007
                • 10

                #8
                crystal report

                hi
                im using vb.net2005
                &
                i want to generate a crystal report dynamically as the data shown from the data gridview i.e.,
                i have added checkboxes to 1st datagridview & if i check those checkboxes
                the respective data values can be shown in 2nd datagridview
                now i need to print those values in crystal report dynamically
                can i use the same dataset to generate report which i have used to show the selected values in 2nd datagridview
                plz help me out its urgent

                Comment

                Working...