Embed image in excel

Certified Senior Developer

Hi,

we have requirement where we need to embed image in excel.
We tried to use Embed Image into Excel smart service in 19.4 and getting below error:

Exception: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 43

following JSON string is passed as a input to smart service

{
"width":1000,
"padding":3,
"imageAnchors":{
"col1":2,
"row1":2,
"col2":3,
"row2":3
},
"imageDocument":{
"imageDocumentID":311790,
"sizePercentage":80
}
}

Has any one used Embed Image into Excel smart service or any other smart service to achieve this ?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi Mike,

    We initially tried to use Embed Image into Excel smart service in process model as well checked in expression rule using embedImagesInExcel() function but , still getting same error.

    embedimagesinexcel(
      excelDocument : cons!document,
      excelSaveFolder : cons!folder,
      excelName : "excel1",
      sheetName :"Sheet1",
      anchorsAndImagesJson :rule!APP_FormJsonTextInput()
    )
    
    --------------------------------------------------------------------
    APP_FormJsonTextInput
    
    a!toJson(
     {
        "width": 1000,
        "padding": 3,
        imageAnchors: {
          "col1": 2,
          "row1": 2,
          "col2": 3,
          "row2": 3
        },
        "imageDocument": {
          "imageDocumentID": 311790,
          "sizePercentage": 80
        }
      }
    )

Reply
  • 0
    Certified Senior Developer

    Hi Mike,

    We initially tried to use Embed Image into Excel smart service in process model as well checked in expression rule using embedImagesInExcel() function but , still getting same error.

    embedimagesinexcel(
      excelDocument : cons!document,
      excelSaveFolder : cons!folder,
      excelName : "excel1",
      sheetName :"Sheet1",
      anchorsAndImagesJson :rule!APP_FormJsonTextInput()
    )
    
    --------------------------------------------------------------------
    APP_FormJsonTextInput
    
    a!toJson(
     {
        "width": 1000,
        "padding": 3,
        imageAnchors: {
          "col1": 2,
          "row1": 2,
          "col2": 3,
          "row2": 3
        },
        "imageDocument": {
          "imageDocumentID": 311790,
          "sizePercentage": 80
        }
      }
    )

Children