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

Master Detail and ObjectDataSource

4 Answers 231 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kure256
Top achievements
Rank 1
kure256 asked on 12 Mar 2009, 07:44 PM
Hello,
 I am new in telerik. I would like to figure data + collection in one Report from my Bussiness object.

for example (it is only example but it describes my situation):

I have this classes:

public  class  Thing
{
     public string Name {get; set;}
     public string Price {get; set;}
}

public class  Person
{
 public string Name {get; set;}
 public string SurName{get; set;}
 public List<Thing> Things{get; set;}
}

result should be something like this:
--------------------------
name + surname  John Novak
things
 Car $100
 Toilet paper 42
 Mask $20
--------------------------

My question is, how do I figure out information about one person and person's things at the one report. I investigated "Telerik reporting tep by step" guide, but it deals only with database.

I am creating PDF from my bussiness object and I really don't know how to bind subreport.  I investigated that I can use subreports: Master report will show name + surname and subreport will show things.
Question is how to fill DataSource of  subreport.

My method for creating report is :

 

var dp = new DataProvider();

 

 

var myReport = new Report1();

 

myReport.DataSource = dp;
//!!!! Is tehere way, how to say, that Report2 (which is subreport in Report 1) will be filled by dp.SomeCollection

 

string mimType = string.Empty;

 

 

string extension = string.Empty;

 

 

Encoding encoding = null;

 

 

byte[] buffer = Telerik.Reporting.Processing.ReportProcessor.Render(

 

 

"PDF", myReport, null, out mimType, out extension, out encoding);

 

 

FileStream fs = new FileStream("c:\\reportWithExternalDataSource.pdf", FileMode.Create);

 

fs.Write(buffer, 0, buffer.Length);

fs.Flush();

fs.Close();


I hope I described my problem. Can anybody help me please.


thanks

kure256

4 Answers, 1 is accepted

Sort by
0
kure256
Top achievements
Rank 1
answered on 15 Mar 2009, 03:45 PM
0
Steve
Telerik team
answered on 16 Mar 2009, 12:53 PM
Hello kure256,

It is not clear whether you still need our assistance. Anyway please take a look at our online Business Objects Binding example and this forum thread as well.

Regards,
Steve
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Michal Kuritka
Top achievements
Rank 1
answered on 16 Mar 2009, 01:34 PM
thank you, I have already found a solution
0
Kalpesh
Top achievements
Rank 1
answered on 24 Sep 2012, 12:14 PM
Hi,
What solution you found? Can you please share with us?
Tags
General Discussions
Asked by
kure256
Top achievements
Rank 1
Answers by
kure256
Top achievements
Rank 1
Steve
Telerik team
Michal Kuritka
Top achievements
Rank 1
Kalpesh
Top achievements
Rank 1
Share this question
or