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

SubReport ItemDataBound

6 Answers 422 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fredrick Smith
Top achievements
Rank 1
Fredrick Smith asked on 07 Jun 2007, 03:43 PM
Hello,

I have a pretty basic question.

I have a SubReport. I want to access items when they are being "DataBound", so I wired the SubReport's ItemDataBound inside the document I use as the SubReport (and not inside the main report's SubReport item).

Is this the correct way to do it?

Thanks,

Ricardo

6 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 08 Jun 2007, 04:18 PM
Hello Ricardo,

Attached you may find a sample that demonstrates one of the possible ways to access the subreport's data from the master (outside) report.

For the purpose of the example I'm using a simple data tables filled in by hand.

The idea is as follows: the detail section of the nested report - DetailReport - was exposed (making in public) and inside the MasterReport I've handled the DetailReport detail section's ItemDataBound event.


Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fredrick Smith
Top achievements
Rank 1
answered on 08 Jun 2007, 05:39 PM
Ok, I tried the demo, but the problem is, I'm not getting any value in the textbox at the botom, it just says textBox3. And I had to change the line from
textBox3.Text = string.Format("Total Sum of detail IDs: {0}"this.totalSum); 
 to

textBox3.Value = string.Format("Total Sum of detail IDs: {0}"this.totalSum); 


so that it would compile. Any ideas on what is not working?

Thanks!

Ricardo
0
Svetoslav
Telerik team
answered on 11 Jun 2007, 10:51 AM
Hi Ricardo,

It seems that you're still working with the pre-SP1 version, where the Telerik.Reporting.Processing.TextBox.Text property was read-only. In SP1 (aka Telerik Reporting v1.1) we made it read-write.

Please follow the instructions of this KB article to update to the latest Telerik Reporting version.

 
Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fredrick Smith
Top achievements
Rank 1
answered on 12 Jun 2007, 02:57 PM
Thanks for the help. It is almost done right now.

My last problem is this:

In each subreport(details record), what I do is the following:
  1. Read values from the DataItem of the current row.
  2. Evaluate the read integer and use its bit value to set variables
  3. Output the value of the set variables to the fields on the details report.
The problem I'm facing now is that the information is being shown one record behind. For example, the details that correspond to the first record are being displayed on the second record's fields and so on. This only happens on the fields I'm setting using the detail_ItemDataBound Event function.

 I made a printout of all the reports and my data in the DataBase and I can confirm they are being displayed one record behind.

Any ideas?

Thanks for all the help. I'm almost done!!

Ricardo
0
Fredrick Smith
Top achievements
Rank 1
answered on 12 Jun 2007, 05:53 PM
I found a solution.

Instead of using detail_ItemDataBound event of the details part on the SubReport, I used the detail_ItemDataBinding event and this solved my problems.

Thanks for all the help!

Ricardo
0
Chavdar
Telerik team
answered on 13 Jun 2007, 12:31 PM
It's great that you have managed to solve the problem by yourself, Ricardo! Thank you for sharing the solution.

 
Sincerely yours,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Fredrick Smith
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Fredrick Smith
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or