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

How to access controls on a report at runtime ?

3 Answers 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Le
Top achievements
Rank 1
Le asked on 17 Sep 2009, 04:11 AM
hi,

In the progress of designing my report, i put some controls (PictureBox, Shape, TextBox...) then i have a question is how can i access to these controls at run-time ? Such as, i want to type some texts on Textbox control, change image on PictureBox, change the title of report...

Sorry for a question again that is not relative to Telerik reporting. I known that ComponentOne's report supports a feature is i can type text on textbox on Print Preview so the Telerik Reporting support this feature ?

Thanks

(Sorry for my bad english)

3 Answers, 1 is accepted

Sort by
0
Chris Gillies
Top achievements
Rank 1
answered on 17 Sep 2009, 08:33 AM
Le, I guess this article is what you're asking for: How do I access items from report and calling application
0
Glenn Boothe
Top achievements
Rank 1
answered on 17 Sep 2009, 05:21 PM

0
Le
Top achievements
Rank 1
answered on 18 Sep 2009, 02:06 AM
Chris Gillies: Sorry to say that i couldn't access the link you posted but i have now found my own a way to solve the issue:

  
        private Telerik.Reporting.ReportItem FindItemsOnReport(string name, Telerik.Reporting.ReportItemBase.ItemCollection items) 
        { 
            Telerik.Reporting.ReportItem item = null
            //Trong mỗi Sections (headers, footers, detail,.... 
            for (int i = 0; i < items.Count;i++ ) 
            { 
                //Tìm trong các điều khiển trong section ở trên 
                for (int j = 0; j < items[i].Items.Count; j++ ) 
                { 
                    if (items[i].Items[j].Name.Equals(name)) 
                    { 
//                      MessageBox.Show(name); 
                        item = (Telerik.Reporting.ReportItem)items[i].Items[j]; 
                        break
                    } 
                } 
            } 
 
            return item; 
 
        } 

Hope this help for everyone that have the question like me !!!
Tags
General Discussions
Asked by
Le
Top achievements
Rank 1
Answers by
Chris Gillies
Top achievements
Rank 1
Glenn Boothe
Top achievements
Rank 1
Le
Top achievements
Rank 1
Share this question
or