How to get data from Sharepoint excel datasource to Power BI desktop? - sharepoint

I want to load an excel which is in Share point to Power Bi Desktop.
I have tried loading the sheet by using the data source SharePoint List but failed as its throwing an error. Please help me by suggesting any other way.
Thank you.

I would use Get Data / Web. It will automatically recognize that the target is an Excel file and generate the M functions to interpret it.
The trick can be getting the true link to the SharePoint file - something you can just paste into a browser's address bar so it will download the file directly.
For SharePoint Online, I use Get a Link / Restricted Link, then delete any trailing query parameters after the file name, typically ?d=blabla
That should also work for SharePoint 2016. From memory it was easier in the earlier versions.

I suggest choosing Sharepoint Folder from the Get Data menu.
Then you need to enter the site's (or subsite) root url (not the direct link to the excel file)
For example, you would connect to.
https://yourcompany.sharepoint.com/training/
Instead of the full address.
https://yourcompany.sharepoint.com/:x:/r/training/_layouts/19/Doc.aspx?sourcedoc=%2asdfasdfasdfasdf%7D&action=default&uid=%7asdfasdfasdf-4662-A7A5-asdfasdf%7D&ListItemId=2&ListId=%7asdfasdfasdfa3443445&env=prod
Then press Edit to reveal all of the documents stored at that root. By clicking the binary link, the query editor will reveal the contents of the file. Then select the tab you're interested in loading by selecting the Table under the data column.

Steps to get the data from sharepoint to Power BI:
Select the File available to share pont
Click on three dots
Go to Open-> Open in app
In app, click on File -> Info -> Copy Path
Open Power BI, New Source-> Web
Add URL, delete (data with and after ?)

Related

Where is the Power Pivot data feed URL stored in an Excel file's internal XML?

A bit of backstory - the real problem I am trying to solve is how to package a PowerPivot / PowerView report that uses a SharePoint list as a data source, and have it be deployable to multiple SharePoint sites, and have it always look for the data source list on the same site where the report is deployed. (See my other question about this.)
Using a site relative URL would be ideal, but when playing around with setting up data sources for Power Pivot, it seems that it doesn't like relative URLs, it only accepts absolute URLs.
That's fine though, I have no problem writing some code that uses OpenXML to go in and change the URL of the data source to reflect the current site URL during the deployment process. Except I can't seem to find where that URL is inside the Excel file.
I have a file where I set up the data source by:
Clicking on the Power Pivot tab
Clicking on the "Manage" button in the ribbon
Clicking on "Get External Data" -> "From Data Service" -> "From OData Data Feed"
Entering the following URL as the data feed URL:
http://mySharePointServer/sites/mySite/_vti_bin/ListData.svc/NameOfMyList
This seems to work, it reads data from the list, and more importantly, when I upload the file into a SharePoint document library, and open it from there, it retains the connection and I'm able to refresh the data.
(By contrast, if I set up the data source by going to the Data tab, and clicking "New Query" -> "From Other Sources" -> "From SharePoint List", it works as long as the file is local. After I upload the file to SharePoint it loses the connection and won't refresh the data.)
But if I take a copy of the file, rename the extension to .zip, extract the innner XML files to a folder, open that folder with VS Code and search for that connection URL, I can't seem to find it anywhere. If I search just for the list name, I find a data connection in the connections.xml file that has a name of "DataFeed mySharePointServer MyListName", but that doesn't have the full URL.
Where is that stored, and how can I change it programatically?

APEX: Read uploaded excel file with as_read_xlsx

As far as I understand, APEX 5.1 does not support Excel files to be loaded into tables.
I found this package that seems to make it possible to SELECT from Excel files, but it does not show how to use it with, for example, files loaded via the "File Browse" Item.
Now, I am very new to this environment, so please explain it from the beginning.
What I did is I upload the package script to the SQL workshop and executed it, without errors. But now?
APEX 5.1 doesn't support it out of the box, but you can use the EXCEL2COLLECTION plugin (available here).
It is very straightforward, just create a file browse page item with an upload button which calls an onsubmit process (e.g. CreateCollection) of type Excel2Collection[Plug In] - specify the file browse item, a collection name and the CSV separator, then you can do as you please with the data (e.g. you may want to run some validations on the data then insert it into a table where you can access it as normal).

Exporting data to existing Excel file

I have a system with an Excel spreadsheet template file which is used for invoicing. I would like the user to be able to click a button on an Xpage, which will then open the spreadsheet and enter the latest invoicing data in Excel. I don't mind if Excel is either the application on their machine or on the server, but my preference would be the application locally on their machine.
I've looked into Xagents, as I feel this is probably the answer. I know they can be used to create Excel but I have not been able to locate any mention of opening an Excel file, and entering data into specific cells.
Is this possible?
EDIT: you can use Apache POI for editing and creating Microsoft Office documents. This is a java project which gives you a handle to office documents and this can be used using java.
A good starting point can be the blog of Christian Guedemann from webgate:
http://guedebyte.wordpress.com/2012/09/17/documents-and-spreadsheets-with-xpages-building-the-kernel-part-ii/
(end of edit)
The only way I KNOW and tried to write data from Notes to Excel is exporting the data to an HTML page and setting the Content Type accordingly (e. g. as described here (there are a lot more resources available for taht):
http://www.dominoguru.com/pages/developer2010_xpagexlsexport.html
I am not sure if this is of help but it seems that this project can help you:
http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=ZK%20Spreadsheet%20for%20XPages
As far as I can see this project can load Excel files from XPages - and then it should also be possible to edit the files.
Besides that the only solution I can think of is a Notes Agent that is called from the XPage. This agent can then run in background and do all the excel stuff. After running, the XPage can show a link to the Excel file. Actually this is the solution I would consider to implement - but maybe others step in with better answers here.
You don't want to introduce a dependency on Excel in your application -- wouldn't work with an iPad front-end. Rather have a look at the ZK Spreadsheet, it will fulfill your needs.
However if you have to have Excel, then you need a roundtrip solution: load the Excel from an URL (probably generated by an XAgent (?) and save it back. The saving back part is the tricky one. Normal HTTP doesn't allow that. What you need there is a webDAV capable server. Watch out for a project on OpenNTF soon (just clearing IBM legal) that provides webDAV.
However the ZK Spreadsheet looks much better for your needs.
I have a sample database at the following URL --> http://www.nnsu.com/nnsusite.nsf/%24%24OpenDominoDocument.xsp?documentId=B65507CB2DE15B3286257986005F061D&action=openDocument
Download the APCC.nsf. This will allow you to create/read a new EXCEL spreadsheet and then stream the resulting file to the requesting browser. There is not need to have EXCEL or office installed on the Server.
THe examples create a new workbook, but you can also store a "template" on the server or in a notes document and use it as a starting point and then save it to a document or stream it to the requesting browser.
With Apache POI you can read/write to a spreadsheet using data from the notes document the process is initiated from.

Find the name and size of the uploaded document using Fiddler?

Will I be able to identify the name and size of a document that I am trying to upload into a SharePoint 2007 document library using Fiddler2 tool?
Follow these steps:
With Fiddler running, select the relevant entry for upload.aspx.
Switch to 'Inspectors / Headers'
Have a look at 'Entity / Content-Length'
I just did a test and it roughly corresponds with the length of the file. I am not sure if it is a 100% match or if headers etc are counted towards this length as well.
Open the document library in Explorer View
copy & Paste the document
Fiddler->Inspectors->Entirty->content-length
Fiddlet-> Textview -> will be able to see the Name ofthe file.

SharePoint Designer 2007 - link to a Document Library on a site from another site?

I am trying to create a link to an existing Shared Documents folder on another site. Both sites are on the same server.
Here are the steps I take to create a link to an existing Document Library:
I create a document library web page in Share Point 2007.
I open the document library (AllItems.ASPX) in Share Point Designer.
I delete the existing web part for the list.
In the Data Source Library, I click on "connect to another library" and create a connection to the other site.
I select the document library, click show data, select my rows and click Insert Multiple Item View.
I then configure the look for each field (hyperlinks, etc).
I edit the Filter for this view to show only the files that are for this location.
I click on Data View Properties and select "Enable sorting and filtering on columns (basic table layout only).
Basically I am trying to have a central location for all files for a site and sub sites. I want the sub sites to see the documents for their own location, be able to search through the files, etc.
The problems I am having are:
I am unable to open the links in a new window, even when I set the hyperlink to do so. I would prefer the file be opened in its native application (ie. A Word doc open in Word).
I am unable to show the file icon in the same way it shows up in the original document library.
When I go to the header and click ANY field, I can sort the field ascending or descending but I always get a message stating "This column type cannot be filtered".
Is there an easier way to do this? Or can someone tell me what I am doing wrong? I am new to using Share Point. Thanks for the help!
Some help for problem 1 (unable to open the links in a new window)...
I'm not sure if this will work using the Data View Web Part you have configured. However there is a technique for the List View Web Part. If you add a boolean field called OpenInNewWindow to your document library then documents that have this set to Yes will open in a new window. Try this out - it may work.
If you need to open PDF files in a new window, beware that there is an ActiveX control that will get in the way. Read this question for more information.

Resources