using System.Collections.Generic;
var rvReport = new Report();
foreach (var item in ResultSession.@return)
string carId = item.carId;
rvReport.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
rvReport.ServerReport.ReportServerUrl = Helpers.ReportServerUri;
rvReport.ShowParameterPrompts = false;
string UserNameReportServer, PasswordReportServer, DomainReportServer;
UserNameReportServer = ConfigurationSettings.AppSettings.Get ("UserNameReportServer");
PasswordReportServer = ConfigurationSettings.AppSettings.Get ("PasswordReportServer");
DomainReportServer = ConfigurationSettings.AppSettings.Get ("DomainReportServer");
rvReport.ServerReport.ReportServerCredentials = new CustomReportCredentials (UserNameReportServer, PasswordReportServer, DomainReportServer);
List<ReportParameter> parameters = new List<ReportParameter> ();
ReportParameter CARID = new ReportParameter ("IN_STRINGCARID", carId);
string ReportsFolderPath = Helpers.GetReportsFolderPath (enumCompany.enInsurance);
string ReportName = "CarIdReport";
string ReportPath = string.Concat (ReportsFolderPath, ReportName);
rvReport.ServerReport.ReportPath = ReportPath;
rvReport.ServerReport.SetParameters (parameters);
string FileName = "CarID" + "_" + carId;
Helpers.ExportReportToPDF (Response, rvReport, FileName);
public Microsoft.Reporting.WebForms.ProcessingMode ProcessingMode { get; set; }
public ServerReport ServerReport { get; set; } = new ServerReport();
public bool ShowParameterPrompts { get; set; }
public string ReportServerUrl { get; set; }
public CustomReportCredentials ReportServerCredentials { get; set; }
public string ReportPath { get; set; }
public void SetParameters(List<ReportParameter> parameters)
class CustomReportCredentials
public CustomReportCredentials(params string[] parameters)
public static string ReportServerUri { get; set; }
public static string GetReportsFolderPath(string thing) => string.Empty;
public static void ExportReportToPDF(object response, Report report, string fileName){ }
class ConfigurationSettings
public static AppSettings AppSettings { get; set; } = new AppSettings();
public string Get(string name) => string.Empty;
public ReportParameter(params string[] parameters){}
namespace Microsoft.Reporting.WebForms
public enum ProcessingMode { Remote }