Hi Nahid,

Please, try this scenario:

Print the customerĀ“s photo:

Create an container field in CustTable to record the image to a customer and
display it using a *Bitmap* ReportControl.

To upload this image to an container field in your table, look at this code
(Suppose you create a button to load the image to add):

void clicked()
{
  FileNameFilter filter = ['Image files', '*.bmp;*.jpg;*.jpeg;*.gif;*.png'];
  BinData img = new BinData();

  str extension, path, nameOfFile, imageFilePathName;

  imageFilePathName = WinApi::getOpenFileName(element.hWnd(),
filter,'','','','');

  if(imageFilePathName && WinApi::fileExists(imageFilePathName)
  {
    [path, nameOfFile, extension] = fileNameSplit(imageFilePathName);

    if(extension == '.bmp' ||
      extension == '.jpg'   ||
      extension == '.jpeg' ||
      extension == '.gif'    ||
      extension == '.png'  || )
    {
      img.loadFile(imageFilePathName);
      custTable.Photo = img.getData();
      custTable.update();
      custTable.refresh();
      info('Upload successfull !');
    }
    else
    {
      throw error('Error while loading image');
    }

  }
}

I hope helps you! [?]

Regards

On Wed, Oct 7, 2009 at 5:27 AM, nahidansar <nahidan...@yahoo.co.in> wrote:

>
>
>
> Hi All,
>
> Requirement : I have to display images in report...
>
> problem :
> 1) I have implemented the solution mentioned below...everything works fine
> on server machine ....but when printing the report from client machine it
> does not show images...
>
> 2) the images in the client machine are not geting copied to the temp
> folder....how do i resolve it plz help..
>
> Solution I have implemented :
>
> step 1: Add images to Resources node in AOT
> step 2: write display method display get this resource
> step 3: add bitmap control and set datamethod property to he above display
> method name(step2) to get the image.
>
> display-method code follows here:
> ....................................
>
> public display FilePath ShowMyResource()
> {
> #AOT
> ResourceNode resourceNode;
> FilePath filePathLogo;
> ;
>
> resourceNode = SysResource::getResourceNode('NameOfTheResource');
>
> if (resourceNode)
> {
> resourceNode.AOTload();
> filePathLogo = SysResource::saveToTempFile(resourceNode);
> }
>
> return filePathLogo;
> }
>
> add a bitmap control and set the property datamethod to the name of the
> display-method from (1), in this case "ShowMyResource"
>
> Thanks and regards
>
> Nahid
>
>  
>



-- 
Santos, Edvandro
System Analyst
--
fale...@edvandro.com
http://www.edvandro.com
--
http://www.axfordummies.com

<<330.gif>>

Reply via email to