Skip to main content
Nintex Community Menu Bar

Sql Image to view in K2 listview failed.

  • December 13, 2017
  • 3 replies
  • 61 views
  • Translate

Forum|alt.badge.img+8

I am trying to load and view in listview k2 records of files stored in sql database as image datatype.

Using smartobjects it always failed.

 

I tried all and it failed since yesterday, I am stuck to this problem.

 

sample image type stored in sql

 

0x504B030414000600080000002100A674045285010000AC070000130008025B436F6E74656E745F54797065735D2E786D6C20A2040228A000020000000000000000000000000000000000000000000

 

For your guidance, thanks.

Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+18
  • 555 replies
  • December 13, 2017

1.  Are you using a SmartBox SmartObject or a seperate database via the SQL Server service instance?


 


2.  Usually the datatype flow will be as below:


 


SQL nvarchar(max) <---> SmartObject Image type <---> ListView Image Attachment control/datatype


 


The SmartObject layer will write the image into the SQL nvarchar(max) field as:


 


<image><name>Image 001.png</name><content>iVBORw0KGgoAAAANSUhEUgAABXcAAAEWCAIAAACi0zPUAAD//0lE.....</content></image>


 


*where <content /> is the base64 encoded string

Translate

Forum|alt.badge.img+8
  • Author
  • Novice
  • 38 replies
  • December 14, 2017

Hi,

I am using a separate SQL database connecting via smartobject.

from image datatype in smartobject it becomes a memo. even If changed it to Image it failed.

 

Actually when I tried to search using smartobject tester it gives me an error.

 

"String or binary data would be truncated.

The statement has been terminated."

Translate

Forum|alt.badge.img+9
  • 142 replies
  • December 14, 2017

Hi Dabuskol,

 

"String or binary data would be truncated. The statement has been terminated" most probably means that the size of value you want to insert or store is larger than column size or variable size. 

 

Change your sql table storage type from Image  to nvarchar  or Text  data type.

 

Here you are storing 64bit format of image hence  while accessing  use html image tag (using data label  expression ) to show it  as image.

 

where ur Image tag should  have src attribute value starting with data&colon;image/[Image Type];base64,

 

 

<img src='data&colon;image/jpeg;base64,UserImage'> // UserImage is variable having base64 data of image

Let me know if this helps you

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings