Error in the printing

Stimulsoft Reports.NET discussion
Post Reply
waleedhm
Posts: 39
Joined: Fri May 31, 2013 1:26 pm

Error in the printing

Post by waleedhm »

I have a problem I am a junior in the use of your report
I use the Search function

Code: Select all

    Public Function GetDataSet(ByVal cmdText As String) As DataSet
        mSqlCommand.Connection = mConnection
        mSqlCommand.CommandType = CommandType.StoredProcedure
        mSqlCommand.CommandText = cmdText
        Using Adapter As New SqlDataAdapter
            Adapter.SelectCommand = mSqlCommand
            Dim ds As New DataSet
            Adapter.Fill(ds)
            Return ds
        End Using
    End Function

Code: Select all

   Dim Ds_Documents As New DataSet

Code: Select all

  Private Sub UiButton1_Click(sender As Object, e As EventArgs) Handles UiButton1.Click
        Try
            Using db As New GeneralDataBase
                With db
                    Dim FromDate As String = txtFromDate.Text
                    Dim ToDate As String = txtToDate.Text
                    GridEX1.RemoveFilters()
                    .ClearParameters()
                    .AddParameters("FromDate", SqlDbType.VarChar, FromDate)
                    .AddParameters("ToDate", SqlDbType.VarChar, ToDate)
                    Ds_Documents = .GetDataSet("Get_Dynamic_Documents")
                    If Ds_Documents.Tables(0).Rows.Count <= 0 Then
                        MessageBox.Show("No data found ")
                        GridEX1.DataSource = Nothing
                        txtFromDate.SetNow = True
                        txtToDate.SetNow = True
                        txtFromDate.Focus()
                        Exit Sub
                    End If
                    Me.GridEX1.DataSource = Ds_Documents.Tables(0)
                End With
            End Using
        Catch ex As Exception
            MessageBox.Show(ex.Message, "SystemError", MessageBoxButtons.OK, MessageBoxIcon.Error)
            GridEX1.DataSource = Nothing
            txtFromDate.SetNow = True
            txtToDate.SetNow = True
            txtFromDate.Focus()
        End Try
    End Sub
This code is the search process
ِAnd This code is printed output

Code: Select all

            StiReport1.Load("C:\Users\Dev\Desktop\my_rpt\Archive\xx.mrt")
            StiReport1.Dictionary.Databases.Clear()
            StiReport1.Dictionary.DataSources.Clear()
            StiReport1.RegData(Ds_Documents)
            StiReport1.Dictionary.Synchronize()
            StiReport1.Show()
Attachments
error.png
error.png (88.6 KiB) Viewed 997 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Error in the printing

Post by Alex K. »

Hello,

Can you please send us a sample project which reproduce the issue for analysis.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Error in the printing

Post by HighAley »

Hello.

It seems that you reg data with different name. Please, try to next method:

Code: Select all

StiReport1.RegData("YourDataSourceName", Ds_Documents)
Than you.
Post Reply