I'm using Telerik Reports v10.0.16.113 with Visual Studio Update 3.
I'm facing an issue that is the Object Data Source Wizard doesn't discover any of my classes. it only show the classes inside the assemblies that I'm referencing in my solution.
My solution is multiple projects and I'm building Any CPU.
How can i resolve this issue?
5 Answers, 1 is accepted
Check if the projects with custom objects are referenced in the reports project and if those objects are of the type supported by ObjectDataSource component - Supported object types.
Also, double-check if you use "Any CPU" for "Debug" builds. As Visual Studio is a 32-bit application, the report designer is restricted to x86 mode even on x64 platforms, which prevents the ObjectDataSource Wizard from discovering any types from x64 assemblies.
I hope this will help.
Regards,
Katia
Telerik by Progress
Hi Katia,
My Solution is Building as "Any CPU".
my reports should get the data from application service. below is a sample of it.
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
Abp.Domain.Repositories;
using
KanooIT.DynamicsTemplate.Mapping;
using
KanooIT.DynamicsTemplate.Users;
using
KanooIT.DynamicsTemplate.Users.Dto;
namespace
KanooIT.DynamicsTemplate.Samples
{
public
class
SampleAppService : ISampleAppService
{
private
readonly
IRepository<User,
long
> userRepository ;
public
SampleAppService(IRepository<User,
long
> userRepository)
{
this
.userRepository = userRepository;
}
public
List<UserListDto> GetAllUsers()
{
var users = userRepository.GetAllList();
return
new
List<UserListDto>(
users.MapTo<List<UserListDto>>()
);
}
}
}
It's Required to call this function in run-time and bind the List<UserListDto> to the data source.
Thanks,
I have tested using the ObjectDataSource Wizard to connect to the sample data as described in your previous post and was able to set DataMember property to GetAllUsers() method. The objects are discovered by the wizard successfully - check this screenshot.
In case, the issue is different please send us the demo project with custom assemblies in a support ticket so we can test it locally.
Regards,
Katia
Telerik by Progress
To edit the report I must put the report back in "AnyCPU" and recreate the reference of the ObjectDataSource. It is very restrictive to work. Is there a solution to be able to edit reports in "X64"?
Hello Yannick,
The ObjectDataSource Wizard will list all available types from the current project and from all other referenced projects which includes all public, non-abstract, non-generic classes and structures organized in a hierarchical manner and grouped by namespace.
If you use the Visual Studio Report Designer have in mind that Visual Studio is a 32-bit application, so the designer is restricted to x86 mode even on x64 platforms, which prevents the ObjectDataSource Wizard from discovering any types from x64 assemblies. The solution is to use different platform configurations: for "Debug" builds it is best to use "Any CPU", while for "Release" builds you can use "x64" instead.
A similar issue has been discussed in our forums and you may find useful the suggested solutions in the forum thread: Custom Type/Class unavailable in Configure Object Data Source Wizard.
I would also suggest you to check the ObjectDataSource component troubleshooting help article to avoid issues when previwing reports that use ObjectDataSource.
Regards,
Neli
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.