Telerik Forums
Reporting Forum
0 answers
71 views

I'm trying to achieve something in a report, and I'm getting nowhere and beginning to wonder whether I'm doing this all wrong.

As a data source for my report, I have a CLR object; It has the following structure (specifically the Bundle object):

 public class Bundle
    {
        public uint BatchId { get; set; }
        public uint BundleId { get; set; }
        public List<BundleItem> Items { get; set; } = new List<BundleItem>();
    }

    public class BundleItem
    {
        public uint CheckNo { get; set; }
        public string ReceivedFrom { get; set; }
        public string Bank { get; set; }
        public string Memo { get; set; }
        public decimal Amount { get; set; }
        public ushort AccountNo { get; set; }
        public string AccountDescription { get; set; }
#if NET6_0
        public DateOnly ContribDate {get;set;}
#else
        public string ContribDate { get; set; }
#endif
        public ushort PaymentType { get; set; }
        public DateTime EntryDateTime { get; set; }
    }

I'm able to instantiate that object, and want to pass it off to a report to render; it's a complicated scenario regarding how that CLR object is instantiated, so I'm not able to use something like a SqlDataSource, so I'm assuming the correct data source type to use is an objectDataSource. That side of things so far is working (as best as I can tell):

I need to build two different reports from this data: one that aggregates the BundleItems (contained in the Items property), and one that displays the list of BundleItems and their fields. I can drag-drop [= Fields.BatchId] and [= Fields.BundleId] to the report designer (I'm using VS integrated designer) and that works fine. I'm binding the datasource to the report via:

BundleReport report = new ();
report.DataSource = (object)_detailsList;
ReportViewer1.ReportSource = report;
ReportViewer1.ViewMode = ViewMode.PrintPreview;
ReportViewer1.RefreshReport();

That causes the report to open and display successfully. Success so far! 

The problems I'm having are related to the List<BundleItems>; no matter what I do the ReportViewer is just (I'm guessing) calling .ToString() on the list and getting back the type name. This has left me to wonder if I'm trying to do something that's just not supported; is there a way for me to visualize a List<BundleItem> in a report directly? Does it have to be done via a sub report? I'm feeling lost - and wondering if I'm just trying to achieve something that it's not really designed for (I know the old ReportViewer WinForm control hated working with anything other than DataSets).

Any guidance is greatly appreciated!

0 answers
109 views

Hi Team ,

After updating version of Telerik assemblies, Itemdatabound event[I have attached one screenshot for reference (its written in .vb file)]  is getting called while creating report as well while printing report. but I don't want it to get called while I am printing report. Is there any way that I can set autopostback(in telerik report) to false in telerik report ? Or any other solution will be appreciated to call Itemdatabound event only while creating report and not while printing.

Anyone can help me ? 

Kind regards, 

Payal

Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?