I created a Telerik
report from a separate project.
I have report viewer from my ASP.NET MVC project to load the report.
Here is the code:
private ViewResult ReportViewer(Report report)
{
report.ExternalStyleSheets.Clear();
var serverUrl = UrlExtension.BaseUrl();
var relativeUrl = Url.Action("ReportStyleSheet", "Theme");
var url = string.Format("{0}{1}", serverUrl, relativeUrl);
var styleSheet = new ExternalStyleSheet(url);
report.ExternalStyleSheets.Add(styleSheet);
return View("ReportViewer", report);
}
The action ReportStyleSheet
from the Theme
controller requires authentication
After successful login and try to view the report, The report can't access the /Theme/ReportStyleSheet. But when I run the Url from the browser its authenticated. How can I resolve this issue?
Its using Form Authentication.
When trying to pass MemoryStream to ExternalStyleSheet constructor, an error occurred that says An error has occurred while processing Report 'MyReport': Buffer cannot be null. Parameter name: buffer
. I am sure that the stream was passed. Here is the screenshot: