problem in binding dataset to report

Stimulsoft Reports.NET discussion
Post Reply
Shahram_Shobeiri
Posts: 4
Joined: Mon Mar 15, 2010 12:56 am

problem in binding dataset to report

Post 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?
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

problem in binding dataset to report

Post by Andrew »

Hello,

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

Thank you.
Shahram_Shobeiri
Posts: 4
Joined: Mon Mar 15, 2010 12:56 am

problem in binding dataset to report

Post by Shahram_Shobeiri »

Shahram_Shobeiri
Posts: 4
Joined: Mon Mar 15, 2010 12:56 am

problem in binding dataset to report

Post by Shahram_Shobeiri »

can it be a new version bug or something?
please help me, i am going crazy!!!
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

problem in binding dataset to report

Post 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.
Post Reply