Options

export images to excel

kanikakanika Member Posts: 247
Hello experts!!! NAV 2009 SP1

I am exporting data to excel from the item table,
I need to also export the product image but only exports a '*'
Is it possible to export the image to excel with some function?

My code is:

ExcelBuf.AddColumn(Item.Picture,FALSE,'',FALSE,FALSE,FALSE,'');

I know that is a blob item.picture but I do not use that function if outStream ... or export blob....., and the help of NAV neither see clearly

Thanks in advance.

Comments

  • Options
    MBrodie1979MBrodie1979 Member Posts: 21
    Hello.

    I tried to get working with this code maybe you can get it to work:

    Item.GET(1000);
    Item.CALCFIELDS(Item.Picture);
    Item.Picture.CREATEOUTSTREAM(OutS);
    OutS.WRITE(BStr);

    ExcelB.INIT;
    ExcelB.VALIDATE("Row No.",2);
    ExcelB.VALIDATE("Column No.",2);
    ExcelB."Cell Value as Text" := BStr;
    ExcelB.Formula := '';
    ExcelB.Bold := FALSE;
    ExcelB.Underline := FALSE;
    ExcelB.NumberFormat := '';
    ExcelB."Cell Type" := ExcelB."Cell Type"::Text;
    ExcelB.INSERT;

    Variables:

    Name DataType Subtype Length
    OutS OutStream
    BStr Text 1024

    If you are using RTC client build a report and add the picture and then use the saveasexcel function to save the report as an Excel file.
  • Options
    kanikakanika Member Posts: 247
    ohhh thanks MBrodie1979

    that code was for the Chilean location, which now have some parked, but I will for a future

    thousand thanks.
Sign In or Register to comment.