Welcome to the Report Viewer SDK feedback portal. We’re happy you’re here! If you have feedback on how to improve the Report Viewer SDK, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Hi,
We have public SSRS report, with can be locally run without entering any credentials, because these information is included.
But when we want to run report using Bold Report viewer control (ASP MVC) system asks for credentials.
Please help.
Index.cshtml:
@section control {
@(Html.Bold().ReportViewer("viewer")
.ReportServiceUrl("/api/ReportViewerWebApi")
.ReportServerUrl("http://LOCALSSRSSERVER:80/ReportServer")
.ReportPath("/Path_to_report"))
}
ReportViewerWebApiController.cs:
public class ReportViewerWebApiController : ApiController, IReportController{private string resourceRootLoc = "~/Resources/Report/";public object GetResource(string key, string resourcetype, bool isPrint){return ReportHelper.GetResource(key, resourcetype, isPrint);}public void OnInitReportOptions(ReportViewerOptions reportOption){reportOption.ReportModel.EmbedImageData = true;string reportName = reportOption.ReportModel.ReportPath;string directoryName = Path.GetDirectoryName(reportName);if (directoryName.Length <= 0){reportOption.ReportModel.ReportPath = HttpContext.Current.Server.MapPath(resourceRootLoc + reportName);}reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("full access user", "secret password");}public void OnReportLoaded(ReportViewerOptions reportOption){ }public object PostReportAction(DictionaryjsonResult) {return ReportHelper.ProcessReport(jsonResult, this);}}