Hi all,
I've insert an image for a record as an external notes (using docuRef, where docuType = File).
Now, I've to display the image (saved as .bmp) into a report.
Into the report I've added a display method (that returns Bitmap) like:
-------------------------------------------------
DocuRef docuRef;
FileName fileName;
Image image;
container imageCont;
Bitmap ret;
;
select docuRef where
docuRef.RefTableId == tableId &&
docuRef.RefRecId == recId &&
docuRef.TypeId == 'FILE';
fileName = docuRef.completeFilename();
if (Image::canLoad(fileName))
{
image = new Image();
image.loadFile(fileName);
imageCont = conIns(imageCont, 1, image.getData());
ret = conpeek(imageCont, 1);
return ret;
} //---- end-if image
---------------------------------------------------
The select statement find out the filePath, the image load the fileName, the container returns a value into ret.... but nothing is displayed in my report!!!
Can someone help me to understand why? Have someone any suggestion?
Thanks to all
Emanuela
*This post is locked for comments
Hi Mohamed
thank you very much for your answer.
I solved my problem using image as a table field, instead that as a note. But next time I'll try your suggestion.
Best regards,
Emanuela Govoni
Hello,
Are you running your report manualy or in batch? Image processing is disabled my Microsoft in batch mode for security. Images can only be printed if reports are printed manualy.
Use this code :
display server public DocuValueFile your_method_name() {
DocuRef docuref;
DocuValue docuValue;
;
select firstonly tableid from docuRef
where docuRef.RefCompanyId == dataAreaId &&
docuRef.RefTableId == tableId &&
docuRef.RefRecId == recId &&
docuRef.TypeId == 'FILE'
join file from docuValue
where docuValue.RecId == docuRef.ValueRecId;
return docuValue.File;
}
and drag it to the design, it works.
Best regards,
Mohamed Amine
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,151 Super User 2024 Season 2
Martin Dráb 229,963 Most Valuable Professional
nmaenpaa 101,156