none
Open a report located in Sharepoint from a .NET APP RRS feed

  • Question

  • We have reports created with report builder (.rdl) in a SharePoint 2013 Library. We need to access to that reports from an .NET application but without made login in the SharePoint. We are using  forms authentication in the SharePoint 2013 access.

    We need some instructions about how to proceed with this issue.

    Thanks

    Thursday, October 1, 2015 5:29 PM

Answers

All replies

  • Hi,

    Since you have enabled form based authentication, you can't access SharePoint resources without authentication. If you think you need anonymous access to these reports, have you tried enabling anonymous access?

    Also when you say 'access the report' - how you are accessing? downloading the report file? viewing the report in iframe?


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Friday, October 2, 2015 5:13 AM
  • Hi, 

      He wants to open a report stored in a  SharePoint 2013 Library from a webform in .NET , with automatic authentication (preventing credential prompts)

    Thanks

    Friday, October 2, 2015 6:12 AM
  • Hi,

    I think you are using webform 'ReportViewer' control to display the report. Since you are using form based authentication I think you need somehow auto-login the user to SharePoint site. I can think of the following approach:

    • Create a layout page in SharePoint - the page will auto-login user. Please add extra checking in the page so that unwanted application can't use this page.
    • From your asp.net application invoke the sharepoint layout page, which will auto-login the user. So when user will login to your asp.net application, you will also auto-login the user to sharepoint site.
    • Now any request to sharepoint server is supposed to work.

    I'm not sure how you have implemented/configured forms based authentication on sharepoint side, but you may need to develop a custom membership provide. You can check the following links to understand what needs to be done in auto-login page:

    So the solution to the problem is mostly on Sharepoint side.


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Friday, October 2, 2015 6:44 AM
  • Hi, thanks for the answer.

    The solution you suggested is really interesting but unfortunately we need to do it by the Client side so we can’t use your proposal.

    We wonder to do it by using CSOM, Webservice SOAP, etc.  Would be possible to find a solution for this issue in this way?

    Thanks in advance.

    Best regards. 

    Tuesday, October 6, 2015 10:34 AM
  • Hi marcroman,

    Per my understanding, there are reports located in a SharePoint library, you want to access these reports in other application.

    In SharePoint 2013, there is no method in client side API(CSOM, REST API or web service) can grad data from a .rdl file.

    As a workaround, you can download the .rdl files to the machine of your application using Client Object Model, handle the authentication in the code behind, render them in your application.

    For the authentication when using Client Object Model, the two links below would be helpful:

    https://samlman.wordpress.com/2015/02/28/using-the-client-object-model-with-a-forms-based-auth-site-in-sharepoint-2010/

    http://social.technet.microsoft.com/wiki/contents/articles/5961.sharepoint-2010-using-the-client-object-model-with-a-form-based-auth-site-different-way.aspx  

    Thanks,

    Patrick Liang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.


    Wednesday, October 14, 2015 10:41 AM
    Moderator
  • Would it be possible to share the session cookie of a .NET application to SharePoint so you can use the same credentials to sign in?

    Thanks

    Thursday, October 15, 2015 7:04 AM
  • Hi,

    We have decided to follow your suggestion: to build a Custom autologin page.

    We have not the possibility to install the Visual Studio on the SharePoint 2013 Server.

    All code is compiled in Visual Studio 2013 remotely by using references to the required SharePoint 2013 DLLs and digitally signed so it can be deployed into the Global Assembly Cache on the SharePoint 2013 Server.

    Inside our SignInForm.aspx we have the line:

    <%@ Page Language="C#" Inherits="MyCustomSignInModule.SignInForm, MyCustomSignInModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f2ae721af94bf9e9" MasterPageFile="~/_layouts/15/errorv15.master"%>

    So we have an aspx file, SignInForm.aspx and another DLL file, MyCustomSignInModule.dll.

    In the server, we have added the MyCustomSignInModule.dll to the GAC by using the Sharepoint PowerShell console:

    Set-location "c:\temp"

    [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

    $publish = New-Object System.EnterpriseServices.Internal.Publish

    $publish.GacInstall("c:\temp\MyCustomSignInModule.dll")

    iisreset

    And it have been created successfully:

    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\MyCustomSignInModule\v4.0_1.0.0.0__55f64e3e5da328be\MyCustomSignInModule.dll

    But when we run the form, it doesn't work.

    We don’t know how to manage this trouble, it seems that the MyCustomSignInModule.dll is never called. 

     

    We have found some errors in the LOG file like:

    -          Cannot find site lookup info for request Uri http://webhost75:60/.          407c399d-063c-805f-e2e2-775b66aaad21

    -         

    -          PublishingHttpModule.PostAuthorizeRequestHandler(): Unexpected exception while analyzing URL: System.IO.FileNotFoundException: The Web application at http://webhost75:60/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.     at Microsoft.SharePoint.SPSite.LookupSiteInfo(SPFarm farm, Boolean contextSite, Boolean swapSchemeForPathBasedSites, Uri& requestUri, Boolean& lookupRequiredContext, Guid& applicationId, Guid& contentDatabaseId, Guid& siteId, Guid& siteSubscriptionId, SPUrlZone& zone, String& serverRelativeUrl, Boolean& hostHeaderIsSiteName, Boolean& appWebRequest, String& appHostHeaderRedirectDomain, String& appSiteDomainPrefix...              407c399d-063c-805f-e2e2-775b66aaad21

    -          Application error when access /_forms/SignInForm.aspx, Error=The server block is not well formed.   at System.Web.UI.TemplateParser.ProcessError(String message)

    Could you please help us to solve the problem?

    Thanks in advance

    Tuesday, October 20, 2015 7:31 PM
  • Hi,

    SharePoint has it's own way of deploying things. Just copying files in folder will not help probably. Please use SharePoint project template in Visual Studio, prepare a WSP package and then deploy the package in SharePoint server using PowerShell.

    You don't need to (and shouldn't) install Visual Studio in SharePoint prod server. However you need a dev server for SharePoint development - with Visual Studio and SharePoint installed.


    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

    Wednesday, October 21, 2015 1:32 AM