Click here to Skip to main content
15,897,704 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Do I need to implement Dispose() ? Pin
Richard Deeming26-Jul-13 5:41
mveRichard Deeming26-Jul-13 5:41 
GeneralRefactoring my code now Pin
David Mujica26-Jul-13 8:03
David Mujica26-Jul-13 8:03 
QuestionCreate Dynamic Label with Drag and Drop Function Pin
Val Gerald Dela Cruz24-Jul-13 14:53
Val Gerald Dela Cruz24-Jul-13 14:53 
AnswerRe: Create Dynamic Label with Drag and Drop Function Pin
Dave Kreskowiak24-Jul-13 17:07
mveDave Kreskowiak24-Jul-13 17:07 
QuestionThree column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee23-Jul-13 19:44
Biplob Singha Shee23-Jul-13 19:44 
AnswerRe: Three column autocomplete Combobox in form and datagridview Pin
Eddy Vluggen31-Jul-13 8:59
professionalEddy Vluggen31-Jul-13 8:59 
GeneralRe: Three column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee1-Aug-13 21:34
Biplob Singha Shee1-Aug-13 21:34 
QuestionHow to pass parameter in reportviewer which is calling .RDLC report Pin
Member 381516522-Jul-13 18:43
Member 381516522-Jul-13 18:43 
Hi,

I am using vb.net form Reportviewer control which is calling .RDLC file but I want to pass two parameter toDate and fromDate to the report. I tried many option but no luck yet. can anyone please help.... below is the code options I have used..


Imports Microsoft.Reporting.WinForms

Public Class frmGuestPassReport

Private Sub frmGuestPassReport_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'GuestPassDS.GuestPass_Transaction' table. You can move, or remove it, as needed.
Me.GuestPass_TransactionTableAdapter.Fill(Me.GuestPassDS.GuestPass_Transaction)
Me.ReportViewer1.RefreshReport()
Me.ReportViewer1.RefreshReport()
Me.ReportViewer1.RefreshReport()
End Sub

'Private Sub FillByToolStripButton_Click(sender As System.Object, e As System.EventArgs)
' Try
' Dim RP(1) As Microsoft.Reporting.WinForms.ReportParameter
' RP(0) = New Microsoft.Reporting.WinForms.ReportParameter("fromDate", "2013-07-17")
' RP(1) = New Microsoft.Reporting.WinForms.ReportParameter("toDate", "2013-07-18")
' Me.GuestPass_TransactionTableAdapter.FillBy(Me.elevateDataSet.GuestPass_Transaction, FromDateToolStripTextBox.Text, ToDateToolStripTextBox.Text)
' Me.ReportViewer1.LocalReport.SetParameters(RP)
' Me.ReportViewer1.RefreshReport()
' Catch ex As System.Exception
' System.Windows.Forms.MessageBox.Show(ex.Message)
' End Try

'End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs)
'Dim adapter As New GuestPassDSTableAdapters.GuestPass_TransactionTableAdapter()
'Dim table As New GuestPassDS.GuestPass_TransactionDataTable()
'adapter.FillBy(table, Format(CDate(dtFromDate.Text.Trim), "yyyy-MM-dd"), Format(CDate(dtToDate.Text.Trim), "yyyy-MM-dd"))
'Dim myNewSource As New ReportDataSource("dsGuestPass", CType(table, DataTable))
'Me.ReportViewer1.LocalReport.DataSources.Clear()
'Me.ReportViewer1.LocalReport.DataSources.Add(myNewSource)
'Me.ReportViewer1.LocalReport.Refresh()
'Me.ReportViewer1.RefreshReport()


Try
Dim adapter As New GuestPassDSTableAdapters.GuestPass_TransactionTableAdapter()
Dim table As New GuestPassDS.GuestPass_TransactionDataTable()
adapter.FillByDate(table, Format(CDate(fromDate.Text.Trim), "yyyy-MM-dd"), Format(CDate(toDate.Text.Trim), "yyyy-MM-dd"))
Dim pInfo As ReportParameterInfoCollection

Dim paramList As New Generic.List(Of ReportParameter)

Dim sfdate As String = Format(fromDate.Value, "yyyy-MM-dd")
paramList.Add(New ReportParameter("fromDate", sfdate, False))

Dim stdate As String = Format(toDate.Value, "yyyy-MM-dd")
paramList.Add(New ReportParameter("toDate", stdate, False))


ReportViewer1.LocalReport.SetParameters(paramList)

pInfo = ReportViewer1.LocalReport.GetParameters()

Me.ReportViewer1.RefreshReport()

Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub



Private Sub Button1_Click_1(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Try
'Me.ReportViewer1.LocalReport.DataSources.Clear()
'Dim adapter As New GuestPassDSTableAdapters.GuestPass_TransactionTableAdapter()
'Dim table As New GuestPassDS.GuestPass_TransactionDataTable()
'adapter.FillByDate(table, Format(CDate(fromDate.Text.Trim), "yyyy-MM-dd"), Format(CDate(toDate.Text.Trim), "yyyy-MM-dd"))
'Dim myNewSource As New ReportDataSource("dsGuestPass", CType(table, DataTable))

'Me.ReportViewer1.LocalReport.DataSources.Add(myNewSource)
'Me.ReportViewer1.Show()
'Me.ReportViewer1.LocalReport.Refresh()
'Me.ReportViewer1.RefreshReport()
ReportViewer1.ProcessingMode = ProcessingMode.Local
ReportViewer1.LocalReport.ReportPath = "GuestPassTransaction.rdlc"
Dim adapter As New GuestPassDSTableAdapters.GuestPass_TransactionTableAdapter()
Dim table As New GuestPassDS.GuestPass_TransactionDataTable()
adapter.FillByDate(table, Format(CDate(fromDate.Text.Trim), "yyyy-MM-dd"), Format(CDate(toDate.Text.Trim), "yyyy-MM-dd"))
Dim pInfo As ReportParameterInfoCollection

Dim paramList As New Generic.List(Of ReportParameter)

Dim sfdate As String = Format(fromDate.Value, "yyyy-MM-dd")
paramList.Add(New ReportParameter("fromDate", sfdate, False))

Dim stdate As String = Format(toDate.Value, "yyyy-MM-dd")
paramList.Add(New ReportParameter("toDate", stdate, False))


ReportViewer1.LocalReport.SetParameters(paramList)

pInfo = ReportViewer1.LocalReport.GetParameters()

Me.ReportViewer1.RefreshReport()

Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Thanks,
dfdff

AnswerRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
Mycroft Holmes22-Jul-13 19:12
professionalMycroft Holmes22-Jul-13 19:12 
GeneralRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
Member 381516523-Jul-13 7:01
Member 381516523-Jul-13 7:01 
AnswerRe: How to pass parameter in reportviewer which is calling .RDLC report Pin
TnTinMn23-Jul-13 7:34
TnTinMn23-Jul-13 7:34 
QuestionVB6 output Access 2000 report to pdf Pin
Member 981947022-Jul-13 9:53
Member 981947022-Jul-13 9:53 
AnswerRe: VB6 output Access 2000 report to pdf Pin
Mycroft Holmes22-Jul-13 12:48
professionalMycroft Holmes22-Jul-13 12:48 
AnswerRe: VB6 output Access 2000 report to pdf Pin
Dave Kreskowiak22-Jul-13 13:55
mveDave Kreskowiak22-Jul-13 13:55 
Questionvbaproject.bin read Pin
JR21220-Jul-13 3:35
JR21220-Jul-13 3:35 
AnswerRe: vbaproject.bin read Pin
Dave Kreskowiak20-Jul-13 7:08
mveDave Kreskowiak20-Jul-13 7:08 
AnswerRe: vbaproject.bin read Pin
TnTinMn20-Jul-13 11:52
TnTinMn20-Jul-13 11:52 
QuestionHow to find mysql table field is empty ? Pin
Biplob Singha Shee19-Jul-13 22:42
Biplob Singha Shee19-Jul-13 22:42 
AnswerRe: How to find mysql table field is empty ? Pin
Biplob Singha Shee20-Jul-13 0:32
Biplob Singha Shee20-Jul-13 0:32 
QuestionERROR When I Show Openfiledialog.ShowDialog() Pin
Sang Nguyen Minh19-Jul-13 8:44
Sang Nguyen Minh19-Jul-13 8:44 
SuggestionRe: ERROR When I Show Openfiledialog.ShowDialog() Pin
Richard Deeming19-Jul-13 8:59
mveRichard Deeming19-Jul-13 8:59 
AnswerRe: ERROR When I Show Openfiledialog.ShowDialog() Pin
Richard MacCutchan19-Jul-13 22:19
mveRichard MacCutchan19-Jul-13 22:19 
AnswerRe: ERROR When I Show Openfiledialog.ShowDialog() Pin
Dave Kreskowiak20-Jul-13 2:57
mveDave Kreskowiak20-Jul-13 2:57 
GeneralRe: ERROR When I Show Openfiledialog.ShowDialog() Pin
Sang Nguyen Minh20-Jul-13 6:21
Sang Nguyen Minh20-Jul-13 6:21 
QuestionEncryption AES256 Trouble.. Pin
markapk18-Jul-13 7:56
markapk18-Jul-13 7:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.