How do I get the contents of the Documentation attribute into a report?
So far Ive got oModel.Attribute(Constants.AT_DOCUMENTATION, 1033).getExternalDocument() but that isnt giving me the contents?
OR Any way to output an image other than have it stored in common files?
Cheers, Brooke
Tricarico Romain on
Hi,
I think you can create a picture with the command :
var pict = Context.createPicture ( byte[] imageData, String imageFormat );
You can get the byte[] from the documentation attribute with the code :
var bytes = yourExternaldocument.getDocument();
initialize the appropriate value for the second argument depending the file extension :
var imageformat = null;
var mime = yourExternalDocument.getFileExtension();
if(mime.equals("png")){
imageformat = Constants.IMAGE_FORMAT_PNG;
}etc....
then
var image = Context.createPicture ( bytes, imageformat);
then with your output object use the OutGraphic function exemple :
outputObj.OutGraphic(image, -1, 44, 9 )
BR,