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

ReportBook, reportsources - datasource

3 Answers 119 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Marko Gluhak
Top achievements
Rank 1
Marko Gluhak asked on 04 Mar 2017, 11:36 PM

I don't know how to solve my issue (to get rid of obsolete methods).

I have reportbook in which I dinamicaly inject diferent reports. Problem is that I'm setting datasource at runtime and not in report. This my code:

var resultMedalistReport = new Result_Medalists { DataSource = someDATA };
resultMedalistReport.ReportParameters["TournamentFullName"].Value = _tournament.Title;
resultMedalistReport.ReportParameters["TournamentDate"].Value = _tournament.DTTournamentStart.ToString( "dd.MM.yyyy" );
resultMedalistReport.ReportParameters["PageTitle"].Value = "Report.Medalists.PageTitle".Localize();
resultMedalistReport.ReportParameters["PageFooter"].Value = cCommon.GetSettingString( groupName: "Report", hashName: "PageFooter" );
 
reportBook.ReportSources.Add( resultMedalistReport ); //this line has implicit conversion that is obsolete.

My problem is I dont know how to use TypeReportSource or something similar so that I can set DataSource of report (its bold letters in code sample)!

3 Answers, 1 is accepted

Sort by
0
Jeroen
Top achievements
Rank 1
Iron
answered on 28 Jan 2021, 01:43 PM
Same question, sad to see no answerwas formulated
0
Dimitar
Telerik team
answered on 02 Feb 2021, 11:46 AM

Hi Jeroen,

You can check out our How to Create a Report Book at run-time article which includes 2 examples for setting the ReportSources(with Uri and Type report sources). Here's the example code from the article:

// For reports created with the VS Designer
var reportBook = new ReportBook();
var weekdayReportSource = new TypeReportSource();
weekdayReportSource.TypeName = typeof(WeekdayReport).AssemblyQualifiedName;
reportBook.ReportSources.Add(weekdayReportSource);

// For reports created with Standalone/Web Report Designer
var glossaryReportSource = new UriReportSource();
glossaryReportSource.Uri = "Reports\\Glossary.trdp";
reportBook.ReportSources.Add(glossaryReportSource);

You might also have a look at the ReportBook Class API Reference for more information.

I hope that I have been able to help, please let me know if you have any other questions.

Regards,
Dimitar
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/.

0
Jeroen
Top achievements
Rank 1
Iron
answered on 04 Feb 2021, 02:38 PM

Solved it by using this Support-call

 

Jeroen

Tags
General Discussions
Asked by
Marko Gluhak
Top achievements
Rank 1
Answers by
Jeroen
Top achievements
Rank 1
Iron
Dimitar
Telerik team
Share this question
or