问题
I need to insert a report homepage on an existing RPT file. The existing RPT file works fine, it displays results from a stored procedure. It's ok.
The homepage must contain an image from the database. So first, I added a new SQL command (through the window "Database Expert") with a new SQL query in order to get the image logo. I drag & drop the image field in the Report Header section. It works in the designer, I can see the image which is retrieved from the database.
But when I generate the report, my SQL query which get the image is executed several times... I can see it in my SQL profiler... I think that my query is executed FOR EACH row which is returned by the initial stored procedure... I don't know why.
Version of Crystal Reports : 10.2
Any ideas ? Thanks a lot.
回答1:
If you just need to add a single image that is not bound to any data (i.e. image of product you are listing in your report), you can easily add a picture from the file system by following these simple steps:
1) Click "Insert" from the file menu
2) Select Picture
3) Browse to the picture file
4) Select the file and then click the place in the report where you want to put the image
5) After inserting the picture you can click on it and move/resize
回答2:
I finally found the following solution :
1 > Create a new SubReport. (Right click on the designer > Insert > SubReport). This new SubReport will be related to the table which contain the image data.
2 > Ensure that this sub report is in the Report Header section. Remove black borders if needed.
3 > In the SubReport, drag your image SQL field into the Details section. Don't forget to specify an equals-condition in order to retrieve the right image.
来源:https://stackoverflow.com/questions/19397893/crystal-reports-insert-an-image-in-the-report-header-section