cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the size of the image inserted to report by ImportPicture()

Former Member
0 Kudos

Following is the code I referenced.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_....do

I want to know how to change the displayed size of the image on report.

Following code cannot change the size.

m_boPictureObject = boReportClientDocument.ReportDefController.ReportObjectController.ImportPicture("d:
test.jpg", m_boSection, 1, 1);

m_boPictureObject.Height = m_boPictureObject.OriginalHeight * 2;

m_boPictureObject.Width = m_boPictureObject.OriginalWidth * 2;

Note: The version of CR is CR2008 , my program is Windows Application.

Accepted Solutions (1)

Accepted Solutions (1)

daniel_paulsen
Active Contributor
0 Kudos

you will need two pictureObjects, your original and you will need to create a new one (you can clone the original)

Change the dimensions of the new (or cloned) picture object and replace the original with the new one using the Modify method.

ie:

m_boPictureObject = boReportClientDocument.ReportDefController.ReportObjectController.ImportPicture("d:\test.jpg", m_boSection, 1, 1);

PictureObject bigPic = m_boPictureObject.Clone(true);

bigPic.Height = m_boPictureObject.OriginalHeight * 2;

bigPic.Width = m_boPictureObject.OriginalWidth * 2;

boReportClientDocument.ReportDefController.ReportObjectController.Modify(m_boPictureObject,bigPic);

Dan

Former Member
0 Kudos

Thank you very much.

Your answer solved the problem.

Answers (0)