Skip to main content
Solved

How can I use a expression field with a query to a column with binary data for the preview component?


Dennis van Leeuwen
Hero
Forum|alt.badge.img+12

How can I use a expression field with a query to a column with binary data for the preview component? I've add an expression field with the following select query:

select CONVERT(VARBINARY(5000),file_upload)
from project_order_document
where project_document_id = 213 

The column contains the binary data of a .pdf file but the previewer shows the text "No filepath is given”.

The domain has datatype VARBINARY_MAX without user interface control. If I try to change it into "File link” it changed automatically to "File upload". 

 

Best answer by Vincent Doppenberg

Hello Dennis,

You're halfway there. You’ll need another column to which you have to assign a database storage configuration. This column can simply use a varchar or nvarchar data type and should be assigned a File upload control. The expression column which you've already created needs to be assigned to the new column as the storage column.

 

So, to summarize:

  1. Create a column with a domain that has a database storage location and a file/image upload control. This domain can simply be (n)varchar.
  2. Create an expression column with a varbinary(max) domain and select the varbinary value in the expression. The control of this domain doesn't matter.
  3. Assign the second column as the storage column of the first column.

Hope this helps.

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

2 replies

Forum|alt.badge.img+4

Hello Dennis,

You're halfway there. You’ll need another column to which you have to assign a database storage configuration. This column can simply use a varchar or nvarchar data type and should be assigned a File upload control. The expression column which you've already created needs to be assigned to the new column as the storage column.

 

So, to summarize:

  1. Create a column with a domain that has a database storage location and a file/image upload control. This domain can simply be (n)varchar.
  2. Create an expression column with a varbinary(max) domain and select the varbinary value in the expression. The control of this domain doesn't matter.
  3. Assign the second column as the storage column of the first column.

Hope this helps.


Mark Jongeling
Administrator
Forum|alt.badge.img+23

Sub forum changed to Questions & Conversations.

The ThinkStore sub forum and its categories are meant for code samples :wink:


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