microsoft reportviewer-VBForums
Results 1 to 2 of 2

Thread: microsoft reportviewer

Threaded View

  1. #1

    Thread Starter
    Frenzied Member met0555's Avatar
    Join Date
    Jul 2006
    Posts
    1,358

    microsoft reportviewer

    Hi,

    I'm running on ASP.NET 4 , I just upgraded my report-viewer from 9.0 to 10.0 .
    Everything still works fine on my local PC, but when I upload it to the server, i can't see the report, no error is shown. I'm not sure where the problem is hiding.

    This is my code :

    d Code:
    1. For Each row As GridViewRow In GridView1.Rows ' Access the CheckBox
    2.                Dim cb As CheckBox = row.FindControl("CheckBox2")
    3.                If cb IsNot Nothing AndAlso cb.Checked Then
    4.                    ReportViewer1.Visible = True
    5.                    atLeastOneRowDeleted = True ' First, get the ProductID for the selected row
    6.                     Dim ID As Integer = (GridView1.DataKeys(row.RowIndex).Value) ' "" the row
    7.  
    8.                    bb &= String.Format("{0},", ID)
    9.  
    10.  
    11.                End If
    12.            Next ' Show the Label if at least one row
    13.             actionsDropDownList.Text = ""
    14.  
    15.  
    16.  
    17.             ReportViewer1.Reset()
    18.             ReportViewer1.ProcessingMode = ProcessingMode.Local
    19.  
    20.             Dim rep As LocalReport = ReportViewer1.LocalReport
    21.             rep.ReportPath = "invoice.rdlc"
    22.  
    23.             Dim ds As DataSet = GetSalesData("InvoiceData")
    24.  
    25.             'Create a report data source for the sales order data
    26.            Dim dsSalesOrder As New ReportDataSource()
    27.            dsSalesOrder.Name = "InvoiceData_invoice"
    28.            dsSalesOrder.Value = ds.Tables("InvoiceData")
    29.            '+++++++++++++++++++++++++++++++++++++++++++++ Send Parameter +++++++++++++++++++++++++++++
    30.             Dim params(0) As Microsoft.Reporting.WebForms.ReportParameter
    31.  
    32.             Dim p As Microsoft.Reporting.WebForms.ReportParameter
    33.             p = New Microsoft.Reporting.WebForms.ReportParameter("searchcriteria", searchcriteria.Text)
    34.  
    35.             params(0) = p
    36.  
    37.             ReportViewer1.LocalReport.SetParameters(params)
    38.             '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    39.            rep.DataSources.Add(dsSalesOrder)


    tt Code:
    1. Private Function GetSalesData(ByVal sourcetable As String)
    2.  
    3.  
    4.         Dim len As Integer
    5.         Dim bbc As String
    6.  
    7.         len = bb.Length
    8.         bbc = bb.Remove(len - 1, 1)
    9.  
    10.         Dim ds As New DataSet
    11.  
    12.         Dim sqlSalesData As String = "SELECT * FROM   xxxxxxx where ID in(" & bbc & " ) order by datee"
    13.  
    14.         Using connection As New SqlConnection(ConfigurationManager.ConnectionStrings("xxxxxx").ToString)
    15.  
    16.             Dim command As New SqlCommand(sqlSalesData, connection)
    17.  
    18.             Dim salesOrderAdapter As New SqlDataAdapter(command)
    19.  
    20.             salesOrderAdapter.Fill(ds, sourcetable)
    21.  
    22.             salesOrderAdapter.Dispose()
    23.  
    24.             command.Dispose()
    25.  
    26.         End Using
    27.  
    28.         Return ds
    29.  
    30.     End Function

    thanks
    Last edited by met0555; Feb 10th, 2012 at 08:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.