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

ObjectDataSource with TRDP file produces empty report

1 Answer 38 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 22 Dec 2020, 04:36 PM

I am programmatically generating a PDF from a TRDP file which uses an ObjectDataSource.  When I preview my report using default values in the standalone report designer, the data is displayed correctly.  When I set the parameters programatically and render the report in code, no data is displayed.  Here is the code to generate the PDF.  Appreciate any help.

Telerik.Reporting.UriReportSource reportSource =
    new Telerik.Reporting.UriReportSource
    {
        Uri = "Reports\\MyReport.trdp"
    };
 
reportSource.Parameters.Add(new Telerik.Reporting.Parameter("batchId", batchId));
reportSource.Parameters.Add(new Telerik.Reporting.Parameter("accession", accession));
 
Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
 
var result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);

 

1 Answer, 1 is accepted

Sort by
0
Tony
Top achievements
Rank 1
answered on 22 Dec 2020, 04:47 PM
I found the problem.  The assembly containing the type of the ObjectDataSource was not referenced or added in the Telerik.Reporting configuration section.
Andreas
Top achievements
Rank 1
commented on 22 Jul 2021, 06:21 AM

Hi Tony, i am struggling to get ObjectDataSource working in stand alone designer. How did you get your ObjectDataSource working? In which config-file was the reference missing? Best Regards
Dimitar
Telerik team
commented on 26 Jul 2021, 01:35 PM

Hi Andreas, we discussed this issue in a separate ticket and you were able to find out the cause for it and resolve the problem, I will now share the possible information in this forum thread so that we can people with similar issues.

The problem was regarding the ObjectDataSource's incompatibility with .NET Core assemblies. The Standalone Report Designer is a WPF application built against .NET Framework 4.0. For that reason, it cannot load and resolve classes from assemblies built against .NET Standard 2.1, .NET Core, and .NET5. You can see the .NET Standard compatibility chart which explains how and when the assemblies can be loaded in different framework versions.

Tags
Report Designer (standalone)
Asked by
Tony
Top achievements
Rank 1
Answers by
Tony
Top achievements
Rank 1
Share this question
or