Can not use ObjectDataSource

I am evaluating FastReport to see if it can be used in my asp.net application.

I have a page with an ObjectDataSource and a Gridview. The page works fine. Here is the ObjectDataSource:

<asp:ObjectDataSource ID="OdsReport" runat="server" SelectMethod="RetrieveAll"
TypeName="ProductCategory"></asp:ObjectDataSource>

Now, I am going to print the content on the Gridview through FastReport. I tried following the instruction on the Programmer's menu:

1. Add a WebReport component on my page.
2. Set my ObjectDataSource on WebReport: ReportDataSources="OdsReport".
3. Click the "smart tip" and select "Design Report ...".
4. I got the following exceptions:

FastReport.Net v1.7.37
Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at SynProductsDataContext..ctor()
at ProductCategory.RetrieveAll()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at FastReport.Web.WebReport.RegisterDataAsp(Report report, IDataSource data, String name)
at FastReport.VSDesign.WebReportComponentDesigner.ActionList.RegisterData(WebReport webreport, Report report, IServiceProvider provider)
at FastReport.VSDesign.WebReportComponentDesigner.ActionList.DesignReport()

What wrong did I do?

Thanks,
p.s. I also tried another way, but still failed. I will post it by another topic soon.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.