Skip to main content

insert sas token in devexpress


Forum|alt.badge.img+1

found above topic because i have the same issue.

Is there any option to passthrough sas-token through a parameter in the task?

Security wise it's not an option to store the token in a table or hardcoded in the report

Best answer by Mark Jongeling

Hi Theo,

Without the SAS token, it could only work if the URL is freely accessible by anyone. But you could opt for the Base64 solution I mentioned earlier.

Prior to generating the report, you can use the Read file process action to obtain the image data in varbinary format. Once you have that data, you can encode it to a Base64 string stored in a variable of datatype varchar. Then link that variable, that holds the Base64, to a Report parameter with the same datatype. Mirror the existence of that report parameter in your DevExpress report. Use the Report parameter like mentioned here: Emails and (devexpress) reports with "embedded" images | Thinkwise Community

That eliminates the need for a SAS token as the authentication is done through Indicium itself.

Example how to encode the varbinary file data in Base64:

declare @binarydata varbinary(max) = 0x5468696e6b77697365 -- example binary data ('Thinkwise' as ascii bytes)

-- Encode to base64
select cast('' as xml).value('xs:base64Binary(sql:variable("@binarydata"))', 'VARCHAR(max)')

Read file: output file data into @binarydata → Using the above code to fill a new varchar variable → Link that variable to a Report parameter.

That Report parameter can then be bound/mirrored in the DevExpress report. Place a PictureBox in the report, use the parameter as the image source like "?base64string” where base64string is the parameter name in my case. When you preview your report, the image should be visible.

My image in DevExpress

Hope this helps!

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

8 replies

Nathan
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 8 replies
  • July 25, 2025

Good day ​@Theo Leijen 
 

If you are asking if there is an option specifically purposed for the passing the sas-token as  a parameter, specifically, then the answer is no.

If you are asking if you can pass the sas-token as a parameter to the report, then the answer is yes, but I am not completely convinced that this is what you mean.

In your post you mention not storing the tokens for security reasons; there are encryption options that you could explore to make the storing of sensitive information more secure.

Have you managed to come up with a solution since the time of posting your question? If not, can you share some specifics around what you are trying to achieve


Forum|alt.badge.img+1
  • Author
  • Sidekick
  • 12 replies
  • July 28, 2025

Nathan,

 

We didnt come to a solution.

i want to add a image from azure blob storage on a devexpress report like the topic above and the ideal solution should be that thinkwise should support this like they do when showing the image in universal

 

 


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

Hi Theo,

In the topic you mentioned, Rony was able to add the image to his report using the desired method. I can try and help with that if you please. Using a report parameter, I can help you set up the SAS token pass-through to the report so the image can be downloaded.

So we can go that route and allow it to work for you, or we can try a different methods below:

Base64 image

You can always pass thorugh the image entirely via a report parameter. This allows you to not have to worry about any authentication, URLs and such in the report itself. Easiest way is using Base64. Described it here a couple years ago: Emails and (devexpress) reports with "embedded" images | Thinkwise Community

Using Public API

If you wanted to use the Indicium API to add an image, it this seems to be impossible using Basic authentication: XtraReport: PictureBox ImageUrl with basic http authentication does not work | DevExpress Support

So that leaves us with simply only a URL to work with, thus if any authentication is needed, the URL needs to contain the authentication. Luckily there is the Public API you could make use of. With the Public API, you are able to expose a role to be accessed by anyone that knows the API endpoint. So, if the image is not sensitive information, you can call the Indicium endpoint with public/ in the URL to obtain the image from a particular column, like this:

Image in DevExpress utilizing Public API

Let me know what is the preferred way to continue. I would opt for the Base64 option if the image can be obtained prior to generating the report.


Forum|alt.badge.img+1
  • Author
  • Sidekick
  • 12 replies
  • July 28, 2025

mark,

 

i have a url to azure blob storage, how can i add this in the picture box without using the sas token?


Mark Jongeling
Administrator
Forum|alt.badge.img+23
  • Administrator
  • 3998 replies
  • Answer
  • July 28, 2025

Hi Theo,

Without the SAS token, it could only work if the URL is freely accessible by anyone. But you could opt for the Base64 solution I mentioned earlier.

Prior to generating the report, you can use the Read file process action to obtain the image data in varbinary format. Once you have that data, you can encode it to a Base64 string stored in a variable of datatype varchar. Then link that variable, that holds the Base64, to a Report parameter with the same datatype. Mirror the existence of that report parameter in your DevExpress report. Use the Report parameter like mentioned here: Emails and (devexpress) reports with "embedded" images | Thinkwise Community

That eliminates the need for a SAS token as the authentication is done through Indicium itself.

Example how to encode the varbinary file data in Base64:

declare @binarydata varbinary(max) = 0x5468696e6b77697365 -- example binary data ('Thinkwise' as ascii bytes)

-- Encode to base64
select cast('' as xml).value('xs:base64Binary(sql:variable("@binarydata"))', 'VARCHAR(max)')

Read file: output file data into @binarydata → Using the above code to fill a new varchar variable → Link that variable to a Report parameter.

That Report parameter can then be bound/mirrored in the DevExpress report. Place a PictureBox in the report, use the parameter as the image source like "?base64string” where base64string is the parameter name in my case. When you preview your report, the image should be visible.

My image in DevExpress

Hope this helps!


Forum|alt.badge.img+1
  • Author
  • Sidekick
  • 12 replies
  • July 28, 2025

Mark,

ok so if i understand this correct, we first fetch the blob in thinkwise with the readfile (proces flow?), convert it to base64 and link it to parameter in the report

 

 

 


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

Yes, that exactly! 


Jeroen van den Belt
Administrator
Forum|alt.badge.img+9

Hi ​@Theo Leijen,

Were you able to solve your problem thanks to one of the replies provided? In that case you can mark that reply as Best answer. If you require further assistance, please let us know.


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