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

Zoom and ItemDataBound Problems

3 Answers 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Leon
Top achievements
Rank 1
Leon asked on 16 May 2008, 03:30 AM
I have the following code

aTable  as datatable = {getting some info}
Areport as new contactreport
Areport.datasource=aTable
Aviewer.report=Areport


There are two problems i found
1.I have showZoomSelect as true but no option for zooming
2.in the report itself, during detail_ItemDataBound, I have 

PictureBox17.Visible = False

the preview doesn't go there for the 1st row

but the printout (PDF) is fine

any suggestions?

3 Answers, 1 is accepted

Sort by
0
Milen | Product Manager @DX
Telerik team
answered on 16 May 2008, 01:31 PM
Hi Leon,

Zooming in the web viewer is implemented using the built-in browser support for zooming. Unfortunately only Internet Explorer has such capabilities. If the browser does not support zooming, the zoom control in the report viewer is hidden to avoid confusion of the end user.

About the second issue you are facing:
When you are using events to modify items in the report, be careful to use the processing items. Please review the article Understanding Events for detailed explanation on how the events work and how to use them. Also you will find very useful the help article Report Life Cycle.

In your case the event handler should look like this:

        private void detail_ItemDataBound(object sender, System.EventArgs e)
        {
            Telerik.Reporting.Processing.DetailSection detail = (Telerik.Reporting.Processing.DetailSection)sender;
            Telerik.Reporting.Processing.PictureBox picturebox = (Telerik.Reporting.Processing.PictureBox)detail.Items["pictureBox2"];
            picturebox.Visible = false;
        }


Let us know if you need further assistance.

Regards,
Milen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Benson
Top achievements
Rank 1
answered on 03 Apr 2013, 11:21 PM
Hi Milen,

I have the similar issue as Leon. It seems the ItemDataBound doesn't fired on the first place. When I click refresh icon on report window then every thing works as expected.
I tried your sample code below but I got error compiling
('Telerik.Reporting.Processing.DetailSession' doesn't containt a definition for Items...)
Is this because I used the older version of Telerik report?

Telerik.Reporting.Processing.DetailSection detail = (Telerik.Reporting.Processing.DetailSection)sender;
Telerik.Reporting.Processing.PictureBox picturebox = (Telerik.Reporting.Processing.PictureBox)detail.Items["pictureBox2"];
picturebox.Visible = false;
0
Stef
Telerik team
answered on 08 Apr 2013, 02:20 PM
Hello Benson,

The post is relevant to a version from 2008. Currently to access the processing child elements of the Detail section within event, you can use the ElementTreeHelper class as follows:
private void detail_ItemDataBound(object sender, EventArgs e)
       {
           Telerik.Reporting.Processing.DetailSection detail = (Telerik.Reporting.Processing.DetailSection)sender;
           Telerik.Reporting.Processing.PictureBox picturebox = (Telerik.Reporting.Processing.PictureBox)ElementTreeHelper.GetChildByName(detail, "pictureBox1");
           picturebox.Visible = true;
       }
For more details, check Access items from report, calling application and Table.

In addition, if your application is Win Forms, you need to call ReportViewerInstance.RefreshReport() after setting its ReportSource property as explained in this help article How to: Add report viewer to a Windows Forms' Form.

If you have further question, let us know more details about your scenario.

Regards,
Stef
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Leon
Top achievements
Rank 1
Answers by
Milen | Product Manager @DX
Telerik team
Benson
Top achievements
Rank 1
Stef
Telerik team
Share this question
or