subbuvv

Hi,

My portal home page has a web part which displays the personal documents list from users personal documents maintained in his personal site (i.e mysite). I use the share point object model to get the personal documents list as html (default view) for the currently logged in user and render in webpart.

If i upload an excel file in personal documents it opens in excel web access from my personal site but fails to open from my webpart in portal home page. The reason is url that is redirected on clicking the link (in the dropdown menu) View in Web browser is relative to the current portal website.

Portal Site: http://<webserver>/

Personal site: http://<webserver>/personal/subbu/

Excel viewer URL in my personal site: http://<webserver>/personal/subbu/_layouts/xlviewer.aspx listguid={D3FF9E89-8217-464B-AC18-F7DD260D34CD}&itemid=3&DefaultItemOpen=1

URL when opened from portal site: http://<webserver>/_layouts/xlviewer.aspx listguid={D3FF9E89-8217-464B-AC18-F7DD260D34CD}&itemid=3&DefaultItemOpen=1

How do i update the url to redirect the View In Web browser to my personal site itself.

Any help is appreciated.

Regards

Subramanian.V.V.



Re: SharePoint - Excel Services Excel services link url

Ira Levin

Are both sites associated with the same ssp

If yes, then you might want to enable excel services to access workbook cross domains.

By default, cross-domain workbook and data connection access is not allowed. To allow workbooks in trusted file locations (and data connections in trusted data connection libraries) to be accessed across domains by web parts, pages, or Web services, run the Stsadm.exe command-line utility, as shown in the following example, where SSP name is the name of your Excel Services Shared Services Provider:

stsadm.exe -o Set-EcsSecurity -Ssp <SSP name> -AllowCrossDomainAccess true|false

http://technet2.microsoft.com/Office/en-us/library/a49883a7-de84-4a66-8fa0-7c7d125f237b1033.mspx mfr=true





Re: SharePoint - Excel Services Excel services link url

subbuvv

Hi,

I ran the command but still i am getting the error

Excel Services was unable to load the workbook that you requested.


My configuration is as follows

I have one SSP which has an web application and under that i have site collection mentioned below

<webserver>/ - Root site collection

<webserver>/mysites - My site collection.

Home page in <webserver>/Pages/default.aspx - has a webpart which get the personal documents library list from <webserver>/personal/<username>. <Username> refers to the currently logged in user. Excel file opens sucessfully from personal site but when it is opened from webpart from the main portal page (<webserver>/pages/default.aspx) it fails.

Regards

Subramanian.V.V.





Re: SharePoint - Excel Services Excel services link url

Ira Levin

Can you paste Verbose level trace for the openworkbook request.

If you upload a workbook to the main portal site, are you able to open it from the main portal

Are both site collections hosted in the same WSS WebApplication if not, then please make sure both are associated with the same SSP.





Re: SharePoint - Excel Services Excel services link url

subbuvv

Hi,

If i upload to the main portal it opens with no issues. The issue is i am trying to open the excel in main portal but the excel file is in my my personal site.

Yes both the site collections are in the same wss web application and they are in the same SSP.

Trace log

ExcelService.PostProcessRequest: web method: OpenWorkbook, got exception Microsoft.Office.Excel.Server.CalculationServer.FileOpenException: Excel Services was unable to load the workbook that you requested. ---> System.ArgumentException: Value does not fall within the expected range. at Microsoft.SharePoint.SPWeb.GetFile(String strUrl) at Microsoft.Office.Excel.Server.CalculationServer.SharePointFileLoader.GetSPFile(SPUserToken userToken) --- End of inner exception stack trace --- at Microsoft.Office.Excel.Server.CalculationServer.SharePointFileLoader.GetSPFile(SPUserToken userToken) at Microsoft.Office.Excel.Server.CalculationServer.SharePointFileLoader.CheckForPermissions(SPUserToken userToken) at Microsoft.Office.Excel.Server.CalculationServer.SharePointFileLoade... 00000002-80e3-9a70-0000-000050f7b00b

I appreciate your help.

Regards

Subramanian.V.V.





Re: SharePoint - Excel Services Excel services link url

Ira Levin

Sorry, but I only now realize that you're trying to open the workbook using the list guid id. I blieve that doesn't work because the list guid from the main site collection isn't discoverable on the other.

You should use the absolute path of the workbook, as such:

http://sitecollection1/_layouts/xlviewer.aspx id=http://sitecollection2/documents/document.extension&DefaultItemOpen=1





Re: SharePoint - Excel Services Excel services link url

subbuvv

Hi,

Thanks. It works.

But this is what i am doing. I wrote a webpart which uses the share point object model to get the personal document list (as html) of the currently logged in user from user mysite and render in the main portal.

My code looks in webpart looks like as below

string username = SPContext.Current.Web.CurrentUser.LoginName;

username = username.Substring(username.IndexOf(@"\") + 1);

SPSite mysite = new SPSite("http://webserver/personal/" + username);

if (mysite != null)

{

writer.Write(mysite.RootWeb.Lists["Personal Documents"].DefaultView.RenderAsHtml());

}

How can i change the url or hyperlink of the menu option "View in Web Browser" before getting the html

I appreciate your help.

Regards

Subramanian.V.V.





Re: SharePoint - Excel Services Excel services link url

Luis Bitencourt-Emilio - MSFT

You canjust use the xlviewer path, concatenated with the workbook path.

So something like "http://server/_layouts/xlviewer.aspx" + " isd"= + workbook path.

You can use the Sharepoint API to get the workbook path from the list.