mibuso.com

Microsoft Business Solutions online community
It is currently Tue May 21, 2013 5:46 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Export Picture to Excel with Auto-scale
PostPosted: Wed May 16, 2012 2:08 pm 
Offline

Joined: Wed May 16, 2012 12:55 pm
Posts: 18
Country: Russia (ru)
Hi,

I try to use something like this:
xlSheet.Shapes.AddPicture(FilePathAndName, 1, 1, 20, 20, 100, 100);

but problem with 2 last parameters, because my pictures have different size.
Which method may i use to export pictures without declare width and height?
(original size)


Top
 Profile E-mail  
 
 Post subject: Re: Export Picture to Excel with Auto-scale
PostPosted: Wed May 16, 2012 5:40 pm 
Offline

Joined: Wed May 16, 2012 12:55 pm
Posts: 18
Country: Russia (ru)
Or how can I get image size (in the BLOB field)?

to put it in function:
xlSheet.Shapes.AddPicture(FilePathAndName, 1, 1, 20, 20, WIDTH, HEIGHT)


Top
 Profile E-mail  
 
 Post subject: Re: Export Picture to Excel with Auto-scale
PostPosted: Thu May 17, 2012 8:56 am 
Offline

Joined: Fri Jul 30, 2010 8:17 am
Posts: 227
Country: India (in)
Can u plz explain how u flowed the image in a Report's excel, from the start


Top
 Profile E-mail  
 
 Post subject: Re: Export Picture to Excel with Auto-scale
PostPosted: Thu May 17, 2012 9:25 am 
Offline

Joined: Wed May 16, 2012 12:55 pm
Posts: 18
Country: Russia (ru)
That simple:

Code: Select all
ItemPicture.CALCFIELDS(Picture);
IF ItemPicture.Picture.HASVALUE THEN BEGIN
  FilePath := ENVIRON('TEMP') + '\IMG.bmp';
  ItemPicture.Picture.EXPORT(FilePath);
  XlsBuf.ExportPicture(FilePath, 1, 1, 0, 493, 370, 250);
END;


Where XlsBuf is Record of (Excel Buffer).
In Excel Buffer I create Function "ExportPicture":

Code: Select all
XlWrkSht.Shapes.AddPicture(FilePathAndName, Param2, Param3, Param4, Param5, Param6, Param7);

Where XlWrkSht is Excel Automation.

----------------------------------------
This method requred to determine this parameters (Param6 - WIDTH, Param7 - Height), but my pictures have very different sizes and I need auto-scale


Top
 Profile E-mail  
 
 Post subject: Re: Export Picture to Excel with Auto-scale
PostPosted: Mon May 21, 2012 1:02 pm 
Offline

Joined: Fri Jul 30, 2010 8:17 am
Posts: 227
Country: India (in)
I Keeper RU,
I have a customized report in the series 50000,
the report prints a image in classic.
The export to excel functionality is completed.
How could i get the same image that is printing for classic, in the excel sheet


Top
 Profile E-mail  
 
 Post subject: Re: Export Picture to Excel with Auto-scale
PostPosted: Mon May 21, 2012 1:07 pm 
Offline

Joined: Wed May 16, 2012 12:55 pm
Posts: 18
Country: Russia (ru)
Lamba wrote:
I Keeper RU,
I have a customized report in the series 50000,
the report prints a image in classic.
The export to excel functionality is completed.
How could i get the same image that is printing for classic, in the excel sheet


I have described above, all the necessary code.

In "Excel Buffer" (table) I create Function "ExportPicture" (with 7 parameters):
XlWrkSht.Shapes.AddPicture(FilePathAndName, Param2, Param3, Param4, Param5, Param6, Param7);

In the report I call this function:
XlsBuf.ExportPicture(FilePath, 1, 1, 0, 493, 370, 250);


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Savatage and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: