Forum Discussion

tarunkamboj's avatar
tarunkamboj
Icon for Microsoft rankMicrosoft
Jun 26, 2023

Want to connect excel with odc.

Problem statement: User click on any report. We will capture excel and odc base64 string from report entity. We need to connect excel with odc and download it on user's system.

 

Tried and failed: 1. I failed to do this through JS webresource but JS webresource don't allow to use external libraries in PowerApps. 2. I tried to do this through plugin. I used Microsoft.Office.Interop.Excel nuget package for this. But later find out that it requires office instance on local. Therefore, this approach only works for desktop apps not for web apps.

 

Please suggest approach to connect excel with odc in server side in C#. Any help will be appreciated.

4 Replies

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor
    need to connect excel with odc

    I am not sure what you mean odc?

    Read Excel workbook on Server side can use NPOI or open XML sdk.

    If read .xlsx with standard structure table e.g. headers in first line and detail data from second line,Ado is an alternative way.
    • tarunkamboj's avatar
      tarunkamboj
      Icon for Microsoft rankMicrosoft

      peiyezhu 

      Thanks for your response.

      ODC here is Office data connection.

      We have excel which contains pivot table. These tables will be connected to PBI dataset using ODC connection.

       

      Issue is: We are storing excel file as base64 in our table. We generate ODC file which know the info of dataset. We want to connect Excel to ODC at server side and send it to client side. So that excel with the connection got downloaded to the user's local machine. And when user open excel, data in the pivot table got populated using the connection.

       

      We did POC of excel data got populated when we have the connection.

       

      We need some way to connect excel to odc.

      • peiyezhu's avatar
        peiyezhu
        Bronze Contributor
        : We are storing excel file as base64 in our table.

        ?
        base64 in our table. ?
        workbook is a zip file in binary rather than base64 as far as I know.

        And if you have download the Excel workbook from a web/Http server,you can run pivottable of Excel in local driver certainly.
        So I really do not know what is your problem in detail.

        If you want to generate analysis report on remote server rather than on client side,just using C# program which has no relation with ODC.
        When want to connect remote sqlServer or MySQL directly,you can use ODBC driver instead to import data to Excel analysis.

Resources