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:
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.
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.
Assign the second column as the storage column of the first column.
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:
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.
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.
Assign the second column as the storage column of the first column.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.