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

Exception has been thrown by the target of an invocation.

0 Answers 138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sri
Top achievements
Rank 1
Sri asked on 01 Mar 2012, 10:51 AM
Hi,

I am using telerik repotrviewer for reports and here is my code that dynamically accessing report and assigning to reportviewer.
When I run the application I am getting the following error message.

"Exception has been thrown by the target of an invocation."

Here is my code:
            Type reportManagerType = typeof(ReportClass);
            _reportAssembly = reportManagerType.Assembly;
            string assemblyName = _reportAssembly.GetName().Name;
            _reportName = String.Concat(assemblyName,".", _currentReportInfo.Name);
            _reportType = _reportAssembly.GetType(_reportName);
            _report = (IReportDocument)Activator.CreateInstance(_reportType);
               
            IReportDocument report = (IReportDocument)Activator.CreateInstance(_reportType);
            this.DefaultReportViewer.Report = report;

Please help me...

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Sri
Top achievements
Rank 1
Share this question
or