Spread SharePoint Web Part

Posted by: rkellow on 8 September 2017, 8:52 am EST

  • Posted 8 September 2017, 8:52 am EST

    Hello,



    I’m trying to get the Spread for Web to work in a SharePoint Web Part.  I’ve seen a couple other posts here saying that it should work but I haven’t seen anyone that has succesfully done it.  Has anyone actually gotten it to work?  If so, could you share what you had to do to make it work?  I’ve created a really simple web part (it just displays some text) to make sure there was nothing else wrong with the code and built and deployed it.  That worked fine.  I then added a reference to the Spread for Web to the project.  I rebuilt and deployed and it still worked.  Next I just declared the Spread variable and rebuilt the project.  When I try to deploy it now it fails in SharePoint and I get the following error message “The “FarPointWebPart” Web Part appears to be causing a problem.”.  I’m thinking that there are three DLLs that are with the Spread, do these need to be added to the Manifest.xml file along with the web part DLL for this work?  I tried adding them but perhaps I didn’t do it correctly since it still didn’t work.



    Any help or ideas would be greatly appreciated.



    Thanks in advance,

    Rob

  • Posted 8 September 2017, 8:52 am EST

    Rob,



    You have to do following 3 things to make the Spread for Web to work in a SharePoint Web Part.



    1. set the TrustLevel in sharepoint web.config to Full

    2. mark the spread dlls safe in web.config (FarPoint.CalcEngine.dll, FarPoint.Excel.dll and FarPoint.Web.Spread.dll)

    3. exclude fp_client folder from SharePoint server



    You might want to read following docs for more info on web parts.

     

    http://www.microsoft.com/belux/nl/msdn/community/columns/tisseghem/webparts1.mspx 

    http://www.microsoft.com/belux/nl/msdn/community/columns/tisseghem/webparts2.mspx

  • Posted 8 September 2017, 8:52 am EST

    What exactly do you mean “exclude fp_client folder from SharePoint server”?

    Delete it?

     

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    No. There was a setting in older version of SharePoint for folders to excelude. You had to set this up as a folder to exclude. In the latest version of SharePoint, you do not need to do this.

  • Posted 8 September 2017, 8:52 am EST

    Ok. So if I have the TrustLevel in sharepoint web.config set to Full and have marked the 3 spread dlls (FarPoint.CalcEngine.dll, FarPoint.Excel.dll and FarPoint.Web.Spread.dll) safe in the web.config, shouldn't the web spread work in my web part?

    We are running SharePoint Server 2003.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    Yes. It should. What problems are you seeing? What release of Spread for Web Forms are you using?

  • Posted 8 September 2017, 8:52 am EST

    We are using spread for web forms 3.0.

    When I add the spread control to the design page the command bar shows up as X's.

    When I run the app and the page loads all of the data is there but the spread is one giant grid it has no scroll bars and the headers are not stationary.

     

     

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    It sounds like you have not set up the fp_client virtual directory on your server. You need to add this on the server that is running your application.

  • Posted 8 September 2017, 8:52 am EST

    As far as I can tell after reading the redistribution section in your Read Me file the fp_client virtual directory is set up.

    I have attached a screenshot of  IIS manager and the properties window for the fp_client directory. Don't know if the pic will help but maybe I'm missing something obvious.

    Any suggestions as to what I should do would be greatly appreciated.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    The virtual directory looks to be set up correctly on the default web site. However, your SharePoint application would need to be running on the same default web site, which I do not think it is. You need to set up the fp_client virtual directory on the same web site your SharePoint server application is running.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    I would suggest reading the two articles linked to in the above post. Specifically the SharePoint Request Handling section in the second article wherwe it talks about how to do this.

  • Posted 8 September 2017, 8:52 am EST

    My application runs in the “VitalFactorsPortalWP” folder which is in the Default Web Site directory as seen in the attached pic.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    Everything looks like it is set up correctly. Make sure the process running your web application has rights to this virtual directory. I will look into this more on Tuesday to see if there is anything that may be missing.

  • Posted 8 September 2017, 8:52 am EST

    I re-installed spread to see if that would fix the problem but it did not. Again I made sure everything was set up the same as before and made sure rights to the virtual directory were there.

    As before when I add the control to my app the command bar buttons show up as X's but now when I run the app the web part is visable for a split second then an error page displays (see attached pic)

    Any ideas?

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    I realize you are using the older version of SharePoint. You will need to exclude the fp_client folder from the SharePoint server.

  • Posted 8 September 2017, 8:52 am EST

    How do I do that?

  • Posted 8 September 2017, 8:52 am EST

    I seem to be back to square 1...

    I found documentation on how to exclude the fp_client folder from the SharePoint server, so that is done. I have set the TrustLevel in sharepoint web.config to Full. And I have mark the spread dlls safe in web.config (FarPoint.CalcEngine.dll, FarPoint.Excel.dll and FarPoint.Web.Spread.dll)

    Now when I run the app the web part page is not re-directed to an error page so I can see the web part but it still has X's in the command bar and the headers don't move with the data.

    What am I missing??

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    What directory is your WebPart with the Spread running? Is this on the Default Web Site or some other server? It sounds like the fp_client virtual directory is not on the correct web site.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    In an earlier post, you mentioned you were not able to see the icons in the Spread at design time either. How are you able to see the Spread control at design time? Creating a WebPart is just creating a Control class. There is no design time GUI involved.

  • Posted 8 September 2017, 8:52 am EST

    My WebPart with the Spread is running on the Default Web Site.

    The fp_client virtual directory is also on the Default Web Site.

  • Posted 8 September 2017, 8:52 am EST

    I am using an .ascx (ASP.NET Custom Control) which gives me the design time GUI to drag and drop controls and then customize. See attached pic.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    How did you create this ASP.NET custom control project. Could you zip it up to send to us to debug the issue you are seeing?

  • Posted 8 September 2017, 8:52 am EST

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    I took your project and copied it into my \Inetpub\wwwroot (Default Web Site) directory. I then had to set up the IIS for this new directory. But, when I opened the project and viewed VitalFactors2UI.ascx (design), all the icons showed with no problems. I am missing pieces to be able to compile the project and run it as a WebPart to test the runtime. If you can create a small sample with just the Spread control and send us that, I can take a look at the runtime on SharePoint.

  • Posted 8 September 2017, 8:52 am EST

    I don’t understand exactly are you asking for? Are you not going to run it as a web part?

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    I was not able to run this as a web part since it is using controls that I do not have. I was asking if you can create another UserControl with just a Spread control to see if you have the same issue. If it does, then you can send us that to test as a web part to see if we can reproduce the issue you are seeing with the fp_client files not being loaded with the web part.

  • Posted 8 September 2017, 8:52 am EST

    I hope this is what you are looking for.

    2007/05/TestPortalWP.zip

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    This is what I am looking for. We built this control and tested it in SharePoint and had no problems displaying the icons in the CommandBar. There has to be a problem in how the fp_client folder is set up on your computer. Try putting the fp_client folder in the same directory as your web control to see if this works. You should not have to do this as long as there is a fp_client virtual directory on the same web site as the WebPart (design time) and the Sharepoint application (runtime).

  • Posted 8 September 2017, 8:52 am EST

    I put the fp_client folder in the same directory as the control but I still have the same problem.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    Canyou try using your WebControl in a web application instead of SharePoint to see if the issue is with the web control or SharePoint?

  • Posted 8 September 2017, 8:52 am EST

    I've already done that. The problem is with SharePoint.

  • Posted 8 September 2017, 8:52 am EST

    Hello,

    Because of this we know the fp_client folder is set up correctly for the UserControl. You stated that the WebPart (user control) and SharePoint application are both running off the root of the Default WebSite. Is this correct? If it is, then the only thing that could be causing the problem, that we have seen, is not excluding the folders correctly in SharePoint. If they are not both running from the root of the Default WebSite, try copying the fp_client folder files into the directory the SharePoint application is running.

  • Posted 8 September 2017, 8:52 am EST

    Yes the WebPart (user control) and SharePoint application are both running off the root of the Default WebSite and I have gone through the procedure to exclude fp_client in SharePoint (see attached pic).

    My info for excluding web sites from Sharepoint came from this .ppt (slide 13) http://www.clevelanddotnet.info/presentations/SharePoint2003.ppt 

    I have also tried copying the fp_client folder files into the directory the SharePoint application is running.

  • Posted 8 September 2017, 8:52 am EST

    The spread is working in the web part. Everything you were telling me to do was correct but I didn't do them in the right order. Out of frustration I decided to once again removed the spread from my project and uninstalled the spread control from the server because I wanted a clean start.

    I reinstalled the spread on the server and BEFORE adding the spread control to my project I did all 3 steps needed for the control to work.

    1. I added the 3 dll's to the GAC. (FarPoint.CalcEngine, FarPoint.Excel and FarPoint.Web.Spread)

    2. Made sure the TrustLevel in the web.config is set to "Full".

    3. Excluded the path to the fp_client vdir from Sharepoint.

    My mistake was adding the control to my project before doing all 3 steps.

    Thanks for your help.

  • Posted 13 October 2020, 9:39 pm EST

    SharePoint Web Parts are segmental components that shape the basic building block of a page on SharePoint sites. Web parts can help customize intranet content, layout and a set of adjustable scripts in certain pages via the web interface.

    Move or remove a web part

    If you’re page is not already in edit mode, click Edit at the top right of the page.

    Select the web part you want to move or remove, and you’ll see a small toolbar on the left of the web part. To move the web part, click the Move web part button.

    I hope this helps.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels