title: How to customize a Crystal Reports report in runtime
body: <p>I'm working with VS2010 C# and I need to create a report that the user can modify. I've inserted parameter fields and they work fine for text but the problem comes when I add an image to the report. The main idea is that the user can modify the image using a <strong>openFileDialog</strong>. I've inserted an <strong>OLE</strong> object, and loaded a placeholder image. I have a <em>path</em> parameter field that I update with the <strong>openFileDialog</strong> and use it as a formula to change the path of the placeholder image.<br>
  I'm not sure if this works, because since I've added the image to the report I cannot print it (I'm using the <strong>printToPrinter</strong> method) and it gives me a <strong>ParameterFieldCurrentValueException</strong>.  </p>
  
  <p>Upon further research I've found a possible workaround. In this case I would create the <strong>OLE</strong> object and then add it to the report with the following piece of code:</p>
  
  <pre><code>private void PictureData_Click(object sender, EventArgs e)
      {
          CrystalDecisions.ReportAppServer.ReportDefModel.PictureObject boPictureObject;
          CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
  
          rpt.Load("D:\\CPP Net\\RASXIR2Printer\\oleobject.rpt");
          rptClientDoc = rpt.ReportClientDocument;
  
          String MyfilePath = "C:\\temp\\sample1.jpg";
  
          //Determine which section to add the picture field to - in this case the report header section
          boSection = rptClientDoc.ReportDefController.ReportDefinition.ReportHeaderArea.Sections[0];
  
          //Add it to the report
          boPictureObject = rptClientDoc.ReportDefController.ReportObjectController.ImportPicture(MyfilePath, boSection, 1, 1);
  
      }
  </code></pre>
  
  <p>The problem here is that the <strong>ReportClientDocument</strong> class used does not seem to exist in the version I'm working with. Also I have the feeling that even if I manage to make this code work it will still fail to print it.</p>
  
  <p>Any ideas?</p>