none
Display a image in crystal reports dynamically

    Question

  • I am passing a string parameter from my Visual Studio 2010 Windows Forms application to my Crystal Report, Version Crystal Reports for .NET Framework 4.0.  I put an image from the "Crystal Reports" menu, Crystal Reports-Insert-Picture. This puts a picture in say "C:\imagepath\one.jpg" I then right click on the image and go to "Format Object", go to the "Picture" tab and click the graphic location tab and put the parameter in that I'm passing to the report. I also added the parameter in the report as text to see if it is correct, it is. The picture does not change but stays the same as first input. I also added the path manually in graphic location, "C:\imagepath\two.jpg" and it still stay the same as the original picture input. Why is the picture object not changing the picture?

    Thanks in advance.

    Friday, April 05, 2013 8:53 PM

Answers

  • The problem was I had a form where I displayed the images that the user could select the pictures for the report displayed in picture boxes. I then passed the path of the images to the form with the crystal report viewer. The crystal report viewer could not load the images because the images were being used. I had to release the images before calling the viewer with the command,

    pictureBox1.Image.Dispose();

    for each image. Now the report runs correctly.

    • Marked as answer by David32 Monday, April 08, 2013 1:07 AM
    Monday, April 08, 2013 1:07 AM

All replies

  • hi,

    Go through this link this is help full for you...........

    http://gallery.technet.microsoft.com/c-and-crystal-report-f724b74b


    Tarun singh Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights

    Saturday, April 06, 2013 6:01 AM
  • I had already setup my report to display images like your example, except for the following. I displaying the report in crystal report viewer. Does that make a difference? Also when I click the Main report preview it does displays the image from the new path, but as previously stated when the program is run the  program doesn't change the image. I hope this gives you enough information to help me solve my problem.
    Saturday, April 06, 2013 10:53 PM
  • The problem was I had a form where I displayed the images that the user could select the pictures for the report displayed in picture boxes. I then passed the path of the images to the form with the crystal report viewer. The crystal report viewer could not load the images because the images were being used. I had to release the images before calling the viewer with the command,

    pictureBox1.Image.Dispose();

    for each image. Now the report runs correctly.

    • Marked as answer by David32 Monday, April 08, 2013 1:07 AM
    Monday, April 08, 2013 1:07 AM