Can i save my changes back to server
However I want to know more about it:If i make a changes to an excel workbook using Excel Services.Can i Save the changes back to original workbook on server?
However I want to know more about it:If i make a changes to an excel workbook using Excel Services.Can i Save the changes back to original workbook on server?
No, you can't.
However, what you can do is from the toolbar 'open in excel', and then save back to the original workbook from within excel client.
If you're using Excel Server API, then you can call the soap method GetWorkbook, and use webdav to store it back into sharepoint.
byte[] excelByteArray = excelService.GetWorkbook(sessionId, WebPartLibrary1.ES.WorkbookType.FullWorkbook,out stati);
SPSite siteCollection = SPControl.GetContextSite(Context);
SPWeb srcSite = siteCollection.AllWebs[0];//"Test Site"
srcSite.AllowUnsafeUpdates = true;
SPFile srcFile = srcSite.GetFile("excel%20lib/clisttoexceltest4.xlsx");
string fileName = srcFile.Name;
srcFile.SaveBinary(excelByteArray);
If this code is placed after the code in which you make your changes,the file gets updated with the changes.
Hope this helps!
can you tell me how to instantiate the System.Web.HttpContext?
And the "excel%20lib" is constant?
thanks
Its a static property. I used a custom webpart that was deployed on the site I had the excel sheet published on and so it got the current context.
The getfile url is the exact url of your published excel document.That was just the excel I was accessing.Copy and paste the url of the excel fil you have published.
Hi Anirudh,
I have similar kind of requirement, where in I am having an a excelsheet published to Excel Services which is also having Data connections to get the data and display in Pivottable and Pivot chart. My DataSource has been updated with latest data after I published the Excelsheet. I am trying to Refresh the report using Excel web services programatically and then upload the report again to Sharepoint Trusted locatio. Following is the line of code Just before getting the workbook and uploading to sharepoint.
excelService.Refresh(sessionId, "");
Do you have any idea on resolvigh this.
Thanks,
Sasya