That's what I was looking for! Thanks a lot wolfgang!!
Take care everyone!
Steeve...
-----Message d'origine-----
De : wgr22091962 [mailto:[EMAIL PROTECTED] Envoyé : 18 septembre, 2003 03:00
À : [EMAIL PROTECTED]
Objet : RE : [development-axapta] Re: Display image resource
hi all,
I think that the element-typ "Resource" is a very good way to avoid using filenames with an absolut path.
I've found a solution for me which can handle this situation:
(1) create a display-method which should have code like this:
public display FilePath ShowMyResource()
{
#AOT
ResourceNode resourceNode;
FilePath filePathLogo;
;
resourceNode = SysResource::getResourceNode('NameOfTheResource');
if (resourceNode)
{
resourceNode.AOTload();
filePathLogo = SysResource::saveToTempFile(resourceNode);
}return filePathLogo; }
(2) add a bitmap control and set the property datamethod to the name of the display-method from (1), in this case "ShowMyResource"
that's all (and works fine)...
have a nice day wolfgang
--- In [EMAIL PROTECTED], "henriktonnesen" <[EMAIL PROTECTED]> wrote:
Anyway, this display method does the trick - bitmaps are just containers...ImageName
display Bitmap bitmap() { Bitmap bitmap; Bindata binData = new BinData();
if (binData.loadFile('c:\\1.bmp')) { bitmap = binData.getData(); } return bitmap; }
--- In [EMAIL PROTECTED], "Steeve Gilbert" <[EMAIL PROTECTED]> wrote:
> Still I get stuck with a path for the image. I've found a solution that let me get rid of the path. The image is a logo global to the company but it's not the main logo. So I add the image as a document attached to a record in CompanyInfo table. From that, I just need to access the DocuRef and DocuValue table to get the image and everything is fine!
> > Thanks anyway!
> > Steeve...
> > -----Message d'origine-----
> De : henriktonnesen [mailto:[EMAIL PROTECTED] > Envoyé : 17 septembre, 2003 13:56
> À : [EMAIL PROTECTED]
> Objet : [development-axapta] Re: Display image resource
> > You could add the bitmap control by code, some
> bc = reportsection.addbitmapcontrol();
> bc.ImageName(heregoesyourvariablepathtothebitmap);
> > It might be possible to use a display method but i dont remember > how - i'll check it tomorrow and let you know!
> > Henrik Tonnesen
> > --- In [EMAIL PROTECTED], "Steeve Gilbert" > <[EMAIL PROTECTED]> wrote:
> > Hi everyone!
> > > > I've never thought that displaying an image in a report would be > so
> > tough. I simply want to display an image in my report. Here's > the step
> > I've done so far:
> > > > I've added a bitmap control. I can't use the property
> because
> > that requires a static path to the file and that's not possible. > So
> > I've created a new Resource (Resource in the AOT) and imported the
> > bitmap into that resource. The problem is that I can't find a way > to
> > load this resource into my report. I've check for the property
> > ImageResource but that requires a resource number and I can't find > the
> > number for my newly created resource (and any other resource under
> > Resources for that matter). If you have anything on this or > anyway to
> > load an image in a report without being bugged with static path to > a
> > file, let me know.
> > > > Bye!
> > > > Steeve...
> > > > > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Yahoo! Groups Sponsor ADVERTISEMENT
click here
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

