简体   繁体   English

如何上传Power View卡图像

[英]How to upload Power View Card Images

Power View in Excel 2013 Pro-Plus: Excel 2013 Pro-Plus中的Power View:

Trying to create cards in power view containing employee names along with a small photo. 尝试在超级视图中创建包含员工姓名和小照片的名片。 My entire model is made of Linked Tables in Excel. 我的整个模型由Excel中的链接表组成。 Does anyone know how to upload the image files into PowerPivot? 有人知道如何将图像文件上传到PowerPivot吗?

Not interested in URLs but rather in the "binary data embedded in the workbook" option. 对URL不感兴趣,而对“工作簿中嵌入的二进制数据”选项感兴趣。 The images are locally on my hard drive as well as the Workbook. 这些图像位于我的硬盘驱动器和工作簿中。

I am assuming the images will remain relatively static. 我假设图像将保持相对静态。 The best way is to get them into SQL, in my opinion, again I am assuming your linked tables come from SQL. 在我看来,最好的方法是使它们进入SQL,我再次假设您的链接表来自SQL。

I use something like this to pickup profile pictures and insert them into a SQL table, then use that table in PowerPivot. 我使用类似的方法拾取配置文件图片并将其插入到SQL表中,然后在PowerPivot中使用该表。

    CREATE TABLE [dbo].[TblImage](
        [Image_Data] [image] NULL,
         [Image_FileName] Varchar(128),
         [User] Varchar(128))
    INSERT INTO TblImage( Image_FileName, [User], Image_Data)
    SELECT 'Feb2012.jpg', 'My Friend',
    * FROM OPENROWSET(BULK N'C:\Backup\f1_SThumb.jpg', SINGLE_BLOB) as tempImg

    INSERT INTO TblImage( Image_FileName, [User], Image_Data)
    SELECT 'Feb2012.jpg', 'My Friend 2',
    * FROM OPENROWSET(BULK N'C:\Backup\f2_MThumb.jpg', SINGLE_BLOB) as tempImg

If you can find a way to import the images in Excel as binary with VBA, please let me know, I have not yet found a reliable way to do so. 如果您能找到一种使用VBA将Excel中的图像作为二进制导入的方法,请告诉我,我还没有找到一种可靠的方法。

From MS a nice guide to working with images in PowerView 从MS到在PowerView中处理图像的不错指南

Or Dan English's Using Database Images in Tabular BI Semantic Models with Power View 或Dan English 在具有Power View的表格BI语义模型中使用数据库图像

But if you want to go through the effort or embedding the data, SQL is by far the easier route to take. 但是,如果您要花费大量精力或嵌入数据,则SQL是迄今为止最容易采用的方法。 I will gladly admit that I have tried and failed on various occasions with Excel and VBA, but opted for the SQL route instead. 我会很高兴地承认,我在Excel和VBA的各种场合下都曾尝试过并失败了,但是我选择了SQL路由。

如果您使用PowerQuery并创建到包含图像文件的文件夹的连接,则是一种方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM