Click here to Skip to main content
16,011,626 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Good Day. Can somebody please help me in viewing ssrs report in vb.net 2010 i have code in c# you can see it below may be if someone can convert the code in vb.net thanks.
C#
RptVwer.Reset();
RptVwer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
//rvTopSheet.ServerReport.ReportServerUrl = new Uri("http://reportserver/reports"); // Report Server URL
RptVwer.LocalReport.ReportPath = Environment.CurrentDirectory + "\\ItemListByCategory.rdl";

ReportParameter[] param = new ReportParameter[1];
param[0] = new ReportParameter("CategoryID", CategoryID.ToString());
RptVwer.LocalReport.SetParameters(param);

DataSet dsSummary = Reports.ItemList_ByCategory(CategoryID);
ReportDataSource rdS = new ReportDataSource("DataSet1", dsSummary.Tables[0]);
RptVwer.LocalReport.DataSources.Clear();
RptVwer.LocalReport.DataSources.Add(rdS);
RptVwer.ServerReport.Refresh();
RptVwer.RefreshReport();
Posted
Updated 10-Sep-13 19:06pm
v2

1 solution

See the following Link to Convert C#.Net Code To VB.Net :
http://converter.telerik.com/[^]
Here is your Code :
VB
RptVwer.Reset()
RptVwer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
'rvTopSheet.ServerReport.ReportServerUrl = new Uri("Your Report Server URL")
RptVwer.LocalReport.ReportPath = Environment.CurrentDirectory & "\ItemListByCategory.rdl"

Dim _mParaList As Generic.List(Of ReportParameter) = New Generic.List(Of ReportParameter)
Dim _mReportParam1 As ReportParameter = New ReportParameter("CategoryID", CategoryID.ToString())
_mParaList.Add(_mReportParam1)
RptVwer.LocalReport.SetParameters(mParaList)

Dim dsSummary As DataSet = Reports.ItemList_ByCategory(CategoryID)
Dim rdS As New ReportDataSource("DataSet1", dsSummary.Tables(0))
RptVwer.LocalReport.DataSources.Clear()
RptVwer.LocalReport.DataSources.Add(rdS)
RptVwer.ServerReport.Refresh()
RptVwer.RefreshReport()
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900