access image in datatemplate of report.itemtemplate

Sep 14, 2011 at 10:45 AM

Hi .

i want print an image of a report 

 

<reporting:Report.ItemTemplate>

<DataTemplate>

<Image x:Name="img" Loaded="img_Loaded" ></Image>

</DataTemplate>

</reporting:Report.ItemTemplate>

 i set source of the image via this:

     private void rpt_img_Loaded(object sender, RoutedEventArgs e)

       {

           Image img = (Image)sender;

           img.Source = _bitmapImg;

       }

 but this event does not fire ,

is my solution correct?  what about another solution ? 

  

Coordinator
Jan 6, 2012 at 4:27 PM

If you want to load an image *into* the report, the image Loaded event isn't the right place. I'd recommend doing it in a general data-loading method before you print.

Pete