OK, the basic error message is this: An error has occurred while processing Report 'myReport': The expression contains object 'myField' that is not defined in the current context.
I've followed the instructions here: http://www.youtube.com/watch?v=t-iA05KpDFM for adding a partial view to MVC to allow a report viewer, and it works as long as I use a statically defined report.
However, if I go in to the OnLoad method and try to change the report to something else, it throws the above error.
Here is my sample code:
Note the use of the ViewBag to provide access to the new report. This seems to work, except that the new report isn't properly linking to its fields.
Thanks for your timely response!
I've followed the instructions here: http://www.youtube.com/watch?v=t-iA05KpDFM for adding a partial view to MVC to allow a report viewer, and it works as long as I use a statically defined report.
However, if I go in to the OnLoad method and try to change the report to something else, it throws the above error.
Here is my sample code:
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
ReportViewer1.Report = ViewBag.ReportSource;
ReportViewer1.RefreshReport();
}
Note the use of the ViewBag to provide access to the new report. This seems to work, except that the new report isn't properly linking to its fields.
Thanks for your timely response!