How to access controls on a report at runtime ?

4 posts, 0 answers
  1. Le
    Le avatar
    4 posts
    Member since:
    Nov 2008

    Posted 16 Sep 2009 Link to this post

    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)
  2. Chris Gillies
    Chris Gillies avatar
    384 posts
    Member since:
    May 2006

    Posted 17 Sep 2009 Link to this post

    Le, I guess this article is what you're asking for: How do I access items from report and calling application
  3. DevCraft banner
  4. Glenn Boothe
    Glenn Boothe avatar
    21 posts
    Member since:
    Jul 2008

    Posted 17 Sep 2009 Link to this post


  5. Le
    Le avatar
    4 posts
    Member since:
    Nov 2008

    Posted 17 Sep 2009 Link to this post

    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:

    1   
    2         private Telerik.Reporting.ReportItem FindItemsOnReport(string name, Telerik.Reporting.ReportItemBase.ItemCollection items) 
    3         { 
    4             Telerik.Reporting.ReportItem item = null
    5             //Trong mỗi Sections (headers, footers, detail,.... 
    6             for (int i = 0; i < items.Count;i++ ) 
    7             { 
    8                 //Tìm trong các điều khiển trong section ở trên 
    9                 for (int j = 0; j < items[i].Items.Count; j++ ) 
    10                 { 
    11                     if (items[i].Items[j].Name.Equals(name)) 
    12                     { 
    13 //                      MessageBox.Show(name); 
    14                         item = (Telerik.Reporting.ReportItem)items[i].Items[j]; 
    15                         break
    16                     } 
    17                 } 
    18             } 
    19  
    20             return item; 
    21  
    22         } 

    Hope this help for everyone that have the question like me !!!
Back to Top