Page 1 of 1

problem in binding dataset to report

Posted: Mon Mar 15, 2010 1:09 am
by Shahram_Shobeiri
Hello
Here is my code in vb.net 2008

Code: Select all

Imports Stimulsoft.Report
Imports System.Data.SqlClient

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ds As New DataSet
        Dim con As SqlConnection
        Dim com As SqlCommand
        Dim da As SqlDataAdapter

        con = New SqlConnection(Class_Connection_String.Connection_String)
        com = New SqlCommand()
        com.Connection = con
        da = New SqlDataAdapter

        com.CommandText = "SELECT * FROM [View_Operator's_Operation] WHERE (([کد کاربر] = " + TextBox1.Text + ") AND ([نام عملکرد] = '" + ComboBox1.Text + "'))"
        da.SelectCommand = com
        Try
            ds.Clear()
            da.Fill(ds)
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

        ds.DataSetName = "stimul_con"
        ds.Tables(0).TableName = "stimul_ds"
        Dim rtp As New StiReport()
        rtp.Load("E:\Create Dinamic Report With StimulReports\Sample\Report00.mrt")
        rtp.RegData(ds)
        rtp.Dictionary.Synchronize()
        rtp.Show()
    End Sub
End Class
this code execute correctly but the query dose not filter the result. such as time you don't bind any dataset to the report and just load and show it. the names of connection and datasource in report are the same as dataset and dataset.table in the program. what is the problem?

problem in binding dataset to report

Posted: Mon Mar 15, 2010 2:51 am
by Andrew
Hello,

Could you please send your report to support@stimulsoft.com or to attach it to this post.

Thank you.

problem in binding dataset to report

Posted: Mon Mar 15, 2010 3:58 am
by Shahram_Shobeiri

problem in binding dataset to report

Posted: Mon Mar 15, 2010 10:27 pm
by Shahram_Shobeiri
can it be a new version bug or something?
please help me, i am going crazy!!!

problem in binding dataset to report

Posted: Tue Mar 16, 2010 1:13 am
by Jan
Hello,

Please use following code:

Code: Select all

rtp.RegData("stimul_con", ds)
rtp.Databases.Clear()
instead

Code: Select all

rtp.RegData(ds)
Thank you.