0

Hi all,

Can anybody tell me how can i give option to user to design there own reports????
i.e They should be able to define

1. Report Title
2. Reports Fields(When they click on Work Order button they should be able to view Work Order Table column and they should be able to select columns then a report should be composed.

Then all the Column should be in the form datagrid.

Is it possible.

1
Contributor
1
Reply
5
Views
5 Years
Discussion Span
Last Post by Naveed_786
0

Here is my code which displays all the table from a Table space in Oracle

With ListView1
            .View = View.Details : .CheckBoxes = True : .FullRowSelect = True
        End With
        con.ConnectionString = ConnectionString
        Try
            dsOle.Clear()
            dtOle.Clear()
            cmdOle = con.CreateCommand
            cmdOle.CommandText = "SELECT * FROM TAB"
            da.SelectCommand = cmdOle
            da.Fill(dsOle, "TAB")
            Dim i As Integer = 0
            Dim j As Integer = 0
            For i = 0 To dsOle.Tables(0).Columns.Count - 1
                Me.ListView1.Columns.Add(dsOle.Tables(0).Columns(i).ColumnName.ToString())
            Next
            For i = 0 To dsOle.Tables(0).Rows.Count - 1

                For j = 0 To dsOle.Tables(0).Columns.Count - 1

                    itemcoll(j) = dsOle.Tables(0).Rows(i)(j).ToString()
                Next

                Dim lvi As New ListViewItem(itemcoll)
                Me.ListView1.Items.Add(lvi)
                Me.ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)

            Next
        Catch ex As Exception
            If ConnectionState.Open Then
                con.Close()
            End If
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "NO DATA FOUND !!")
        End Try

It works fine now i am using "ListView1_ItemCheck" event when this event fires it should list table column names.

But the problem is this when i load the form it shows all the Tables

1. when i click on check box it didn't list all the columns

2. When i click on a checkbox against WO it should list all the columns of Wo table and when i click on checkbox against KEY_MAKING_REC it should display the columns of KEY_MAKING_REC table

How to achieve this please guide me.

Private Sub ListView1_ItemCheck(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck
        If e.NewValue = CheckState.Checked Then
            With ListView1
                .View = View.Details : .CheckBoxes = True : .FullRowSelect = True
            End With
            con.ConnectionString = ConnectionString
            Try
                dsOle.Clear()
                dtOle.Clear()
                cmdOle = con.CreateCommand
                cmdOle.CommandText = "DESCRIBE WO"
                da.SelectCommand = cmdOle
                da.Fill(dsOle, "WO")
                Dim i As Integer = 0
                Dim j As Integer = 0
                For i = 0 To dsOle.Tables(0).Columns.Count - 1
                    Me.ListView1.Columns.Add(dsOle.Tables(0).Columns(i).ColumnName.ToString())
                Next
                For i = 0 To dsOle.Tables(0).Rows.Count - 1

                    For j = 0 To dsOle.Tables(0).Columns.Count - 1

                        itemcoll(j) = dsOle.Tables(0).Rows(i)(j).ToString()
                    Next

                    Dim lvi As New ListViewItem(itemcoll)
                    Me.ListView1.Items.Add(lvi)
                    Me.ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent)

                Next
            Catch ex As Exception
                If ConnectionState.Open Then
                    con.Close()
                End If
                MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "NO DATA FOUND !!")
            End Try
        End If
    End Sub

Edited by Naveed_786: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.