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

Reporting How to get footer value of Subreport to Textbox in Main Report

1 Answer 166 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Karuppa
Top achievements
Rank 1
Karuppa asked on 25 Apr 2012, 08:11 AM
Hi,
        I'm Samy Currently Working on Telerik Reporting. I'm serializing the Report to a XML and saving to the Database. and deserializing the XML and Show the Report.

        Now I need is In Detailed Section I'm having two Sub Reports and a text box. I have to assign the Footer of the Sub report value to the Textbox in the Main report. how to do this? Please Provide with Sample Code.


      also Can you please guide me How to add water marking in telerik 2011 Q2.

                    Thanks in advance.


Regards,
K.K.Samy

1 Answer, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 30 Apr 2012, 10:28 AM
Hi Samy,

You can achieve your goal by utilizing the ItemDataBound event of the detail section after deserializing the report from XML. Here is a sample approach:

1. Attaching the event handler:
var report = (Report)serializer.Deserialize(new StringReader(reportXml));
 
var detailSection = report.Items.Find("detail", true)[0];
 
detailSection.ItemDataBound += new EventHandler(detailSection_ItemDataBound);

2. The ItemDataBound event handler implementation:
void detailSection_ItemDataBound(object sender, EventArgs e)
{
    var detailSection = (Telerik.Reporting.Processing.DetailSection)sender;
    var subReport1 = detailSection.ChildElements.Find("SubReport1", true)[0];
    var subReport1TextBox1 = (Telerik.Reporting.Processing.TextBox)subReport1.ChildElements.Find("textBox1", true)[0];
 
    var textBox = (Telerik.Reporting.Processing.TextBox)detailSection.ChildElements.Find("textBox1", true)[0];
    textBox.Value = subReport1TextBox1.Value;
}

As for your second question - watermarks are available since the Q3 2011 release. You have to upgrade from Q2 2011 if you want to use them. More information about Watermarks you can find in the product's documentation.

Hope this helps.

All the best,
Chavdar
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Karuppa
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Share this question
or