This is a migrated thread and some comments may be shown as answers.

Report source cannot be processed Exception Occured

4 Answers 438 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 10 Jan 2018, 01:02 AM

Hi Telerik, I am creating Telerik Report using Telerik REST Services. I created my report and now I want to use it in my company project. For that I created reference of Reporting project to my Company' Project and called the Constructor of Report. Here is code for that:

string ReportsPath = @"C:\ReportsDownload";
string reportFileName = String.Format("FormReport-{0}.pdf", frm);
string reportWebPath = String.Format("/Reports/{0}", reportFileName);
var formReport = new AQSRestServiceObject.AQSReport(); // Calling Report Constructor 
formReport.ReportParameters["FormNumber"].Value = 12476;
var processor = new ReportProcessor();
var result = processor.RenderReport("PDF", formReport, null);
using (var pdfStream = new MemoryStream(result.DocumentBytes))

using (var reportFile = new FileStream(Path.Combine(ReportsPath, reportFileName), FileMode.Create))
      {
          pdfStream.CopyTo(reportFile);
       }

As you can see above I am having FormNumber as parameter for my Report and it is coming by objectDataSource. When I run my project I get an exception and I need help to solve it.
Here is an Exception: 
System.InvalidOperationException: The view 'An error occured while evaluating the report parameters. Report source cannot be processed.' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/An error occured while evaluating the report parameters. Report source cannot be processed..aspx
~/Views/Home/An error occured while evaluating the report parameters. Report source cannot be processed..ascx
~/Views/Shared/An error occured while evaluating the report parameters. Report source cannot be processed..aspx
~/Views/Shared/An error occured while evaluating the report parameters. Report source cannot be processed..ascx
~/Views/Home/An error occured while evaluating the report parameters. Report source cannot be processed..cshtml
~/Views/Home/An error occured while evaluating the report parameters. Report source cannot be processed..vbhtml
~/Views/Shared/An error occured while evaluating the report parameters. Report source cannot be processed..cshtml
~/Views/Shared/An error occured while evaluating the report parameters. Report source cannot be processed..vbhtml

SourceControl Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

 

Here is my ReportController Paths:
var appPath = HttpContext.Current.Server.MapPath("~/AQSReport");
var reportsPath = Path.Combine(appPath, "Reports");

 

Can anyone please help me to solve this exception.?

4 Answers, 1 is accepted

Sort by
0
Software
Top achievements
Rank 1
answered on 10 Jan 2018, 05:32 AM

If I use following code then I get new error

Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
typeReportSource.TypeName = typeof(AQSReport).AssemblyQualifiedName;
typeReportSource.Parameters["FormNumber"].Value = frm;
var result = processor.RenderReport("PDF", typeReportSource, null);

Error:

[InvalidOperationException: The view 'Object reference not set to an instance of an object.' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Home/Object reference not set to an instance of an object..aspx ~/Views/Home/Object reference not set to an instance of an object..ascx ~/Views/Shared/Object reference not set to an instance of an object..aspx ~/Views/Shared/Object reference not set to an instance of an object..ascx ~/Views/Home/Object reference not set to an instance of an object..cshtml ~/Views/Home/Object reference not set to an instance of an object..vbhtml ~/Views/Shared/Object reference not set to an instance of an object..cshtml ~/Views/Shared/Object reference not set to an instance of an object..vbhtml] System.Web.Mvc.ViewResult.FindView(ControllerContext context) +499 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +143 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +185 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +43 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +607 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134

0
Todor
Telerik team
answered on 12 Jan 2018, 02:20 PM
Hi,

Going through the error, I assume that a string parameter is returned by a Home controller action (as View name). However, instead of the correct View name, the corresponding string parameter receives an exception message as a value. Hence, a View with the specified name (the error message) cannot be found.

The information is not sufficient for locating the problem. I suggest you to open a support ticket and attach the project (runnable), so that we can investigate it locally and try to give you an appropriate advice.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
William
Top achievements
Rank 1
answered on 31 Jan 2018, 04:50 PM

Error creating Document!
An error occurred while evaluating the report parameters. Report source cannot be processed.

 

If my memory is correct, this error is new to 2018 telerik reporting... Is there a way to get a more detailed error message?

I have a lot of report parameters so this error is confusing to me, also it just starting doing this after upgrading from Q17 to Q18

0
Todor
Telerik team
answered on 05 Feb 2018, 10:08 AM
Hello William,

Thank you for the feedback. The error "An error occurred while evaluating the report parameters. Report source cannot be processed." is not informative enough and we have logged the issue for improvement in our system.
The error with this message is not new in Telerik Reporting R1 2018. It exists also in previous versions.

Currently you cannot get the Parameter(s) name which values cannot be evaluated from the error stack trace. You could, however, receive more information concerning the problematic parameters from it. I suggest you to configure the trace listener of your application as explained here for this purpose.
For example if the parameter cannot get its AvailableValues form the database, this would be indicated in the Inner exception, i.e. you would know that a report parameter that fetches its values from the database is involved.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Software
Top achievements
Rank 1
Answers by
Software
Top achievements
Rank 1
Todor
Telerik team
William
Top achievements
Rank 1
Share this question
or