0

I am facing a minor challenge in my coding i am trying to generate reports from sql statements.however the method i was using ealier involves making a crystal report using the "Add new item".in the menu and using the wizard until you end up putting the table you want on the crystal report and the column names.....This method is complicated in a situation where you have many tables and you want to generate reports.I want a situation where i can type in any sql statement and get a report without having to use the wizard to put tables and column names on the report.Can any one help . i have the code below and help with how to go about will be appreciated or help with my code.

Sub cryview0()
        Dim rpt As New CrystalReport12() 'The report you created.
        'Dim sql_personnel As String = procesSQL(txtSQL.Text, cmbTableName.Text) '"select * from tendai_table2"
        Dim sql_personnel As String = "select * from tendai_table2"
        Dim dt As New DataTable

        dt = MyFormz.cl_Class.SelectRows(sql_personnel)
        'rpt.SetDataSource(dt)cms_dbDataSe

        rpt.Database.Tables.Item("tendai_table2")

        CrystalReportViewer1.ReportSource = rpt

    End Sub
1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by tendaimare
0

When i use the code above i get the error:"Property access must assign to the property or use its value."on this line:"rpt.Database.Tables.Item("tendai_table2") "

Any Help

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.