• Image columns in dataverse


    Paginated Power BI / SSRS reports and Dataverse image columns

     
     

    With the image columns in Dataverse, we can easily add fields to store images directly in the tables like this:

    image

    This is great, since this makes all those images/documents much easier to identify than if they are stored in Sharepoint.

    In terms of storage, those images are stored in the file storage which is cheaper than Dataverse itself, and which makes it a viable option in many cases. However, I guess somewhat because of that, working with images is not that straightforward sometimes.

    For example, what I wanted to build a Power BI Paginated report (the same approach should work with SSRS) and incorporate those images into the report? It’s actually doable, though, it seems, it’s not as simple as just adding an Image control to the report canvas and pointing it to the image attribute. Here is an example, though:

    image

    Dataverse datasource exposes a few image-related columns:

    image

    However, when I tried sing ita_image attribute directly with the image control, it did not work:

    image

    The result of this is not exactly what we would probably expect:

    image

    There is another attribute there, which is image url. That’s an actual url you can download the image from; however, it only works for an authenticated user. If I use it to specify image component url:

    image

    The result is no different from what we saw before:

    image

    That makes sense, since the report is trying to open that url outside of the authenticated Datasource connection, and it’s not working.

    So, how do we make it work?

    I guess there are at least a couple of options:

    • We could use a Flow or a plugin to upload images to a web site, and, then, we could reference those images in the report through the external url parameter of the image control. That involves a bit of setting up and we are giving up some of the security, so it might not be that fast or even acceptable
    • Another solution might be to use something else to sort of fake the url. Below, I’ll do it with a Power Automate flow. But it could have been an Azure Function, a Logic App, or, possibly, something else (I wonder if those images could have been exposed through a Power Apps portal? It’s something to try…)

    Here is the flow:

    image

    On the report side, there is an image control that’s configured to use external url. That url is, really, a trigger url for the flow above extended with a custom “documentId” parameter:

    image

    On the flow side, there is a Compose action which will extract documentId from the query:

    image

    And, then, here is how the remaining flow steps look like:

    image

    I guess you could say this is not necessarily very efficient – there is a report that’s utilizing a flow to grab some data, not to mention involved API calls and Flow usage… This might not scale well if you need thousands of images per report, but, for a small one (and if you need to prototype quickly), this works just fine.

    For a more robust and scalable solution, and unless there is, actually, a way to somehow display that image directly in the report (without having to use “external url”), a better option might be to use a Flow/plugin to upload those images somewhere else first, and, then, display them in the report from that new external location.

  • 相关阅读:
    2017-5-15 winform项目总结(知识点补充)
    2017-5-7 time控件 三级联动(省,市,区)
    2017-5-4 进程 线程 用户控件
    2017-5-3 打印控件 MDI 窗体容器 Activated事件
    2017-5-2 对话框控件 MessageBox.Show()用法补充 打开新窗体的3中模式
    窗体移动 窗体阴影API
    2017-4-28 ListView控件学习
    【2017-03-28】JS基础、DOM操作
    【2017-03-24】样式表样式
    【2017-03-24】CSS样式表
  • 原文地址:https://www.cnblogs.com/lingdanglfw/p/14720232.html
Copyright © 2020-2023  润新知