Last active
November 9, 2016 20:44
-
-
Save alanjuden/9f1524bbee681b92fc87645fe39d20ee to your computer and use it in GitHub Desktop.
Custom ReportViewer ReportController Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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