Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom ReportViewer ReportController Example
public class ReportController : AlanJuden.MvcReportViewer.ReportController
{
protected override ICredentials NetworkCredentials
{
get
{
//Custom Domain authentication (be sure to pull the info from a config file)
//return new System.Net.NetworkCredential("username", "password", "domain");
//Default domain credentials (windows authentication)
return System.Net.CredentialCache.DefaultNetworkCredentials;
}
}
protected override string ReportServerUrl
{
get
{
//You don't want to put the full API path here, just the path to the report server's ReportServer directory that it creates (you should be able to access this path from your browser: https://YourReportServerUrl.com/ReportServer/ReportExecution2005.asmx )
return "https://YourReportServerUrl.com/ReportServer";
}
}
//Only override this property if your controller is not called ReportController.
//You'll want to enter whatever your controller's name is in place of "YourController" below.
protected override string ReportImagePath
{
get
{
//This is the default as an example
//return "/Report/ReportImage/?originalPath={0}";
return "/YourController/ReportImage/?originalPath={0}";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment