Skip to Content
0
Former Member
Mar 24, 2011 at 04:33 PM

Load dynamically image from path

393 Views

Hi,

I want load image from path with CR4E. I have a report with a field that contain the path of image and a empty PictureObject.

I wanna put the image from the path in the picture image.

That work when i have a section that is unique :

I can obtain the path with this code

IField field = clientDoc.getDataDefinition().getResultFields()

.findField(fieldObject.getDataSourceName(), FieldDisplayNameType.formulaName, java.util.Locale.getDefault());

RowsetMetaData rowSetMetaData = new RowsetMetaData();

rowSetMetaData.setDataFields(clientDoc.getDataDefinition().getResultFields());

RowsetCursor resultCursor = clientDoc.getRowsetController().createCursor(null, rowSetMetaData);

Value values = clientDoc.getRowsetController().browseFieldValues(field, -1);

And i can view the image with this code

clientDoc.getReportDefController().getReportObjectController().remove(picture);

PictureObject boPictureObject = clientDoc.getReportDefController().getReportObjectController().importPicture(path, theSection, picture.getLeft(), picture.getTop());

boPictureObject.setWidth(picture.getWidth());

boPictureObject.setWidth(picture.getHeight());

But when the section is not unique, it is always the same image in all section.

How then I to make? A resolution has t-il there ? (with crystal report 8 there was ISectionEvent for this)

Thanks for your help!

Edited by: hermannpencole on Mar 24, 2011 5:35 PM