Copy an embedded image from one report to another

Hello!

I am writing a wizard in MFC which automatically creates reports from a database. One required feature of this wizard is that it should be possible to give the path of a template report from which I copy the Report/Page Header/Footer to the newly created report. This works quite fine, with one exception: I cannot copy embedded images. When queried for their type, they say "OleObject", so I thought, I get the IPictureDisp object by calling "GetFormattedPicture", save the image to a temporary file and insert a new OleObject into the new report by giving the file location in the method call "AddPictureObject" of the respective section.
The problem is that I get an "E_ACCESSDENIED" error when I call the GetFormattedPicture method. The help says that the property "Can be read or written only when top-level Report object is formatting active."
Does anyone have a hint how to solve this problem


Answer this question

Copy an embedded image from one report to another

  • Matt Milner - Pluralsight

    Sorry, I don't quite understand what this means. Do you have a code example for this
  • Robert Bruckner

    Hello,

    The formatting active part means that you need to be processing the report and then you would use the Section Format() event to get the object.

    Keith - Business Objects

  • Copy an embedded image from one report to another