SharePoint Add-ins and SharePoint Framework - sharepoint

I'm trying to understand the difference between the SP add-ins and SP Framework.
I need to refactor a Django app on SP online. The web app does the following:
Takes input from the user into a form (mostly y/n) questions
based on the responses generates a pdf document which is returned to the user plus a .docx document which is stored on SP (the end user has no access to the .docx)
Potentially sends an email to notify other stakeholders
Now, if I have to implement it on SP, I understand that the full logic will be in the client, while at the moment for example part of the logic runs in Python.
The form itself should not be an issue. I was wondering how to generate the pdf and the docx. Is that possible using SP workflows? Or should I use Power Automate? I mean, how to properly populate a HTML/word template and then convert it to Pdf if we have no access to server side code? Thanks

You can create a SharePoint Application using spfx framework https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview and the client side code can call server side APIs. You could use any backend to take the Form submission and return a generated PDF file.

Please find below my thoughts:
-UI and backend base logic(capturing form data) you can do with SpFx.
PDF Generation: There are few client side js scripts(e.g., jspdf)
available to generate a pdf. This can be done from SpFx. We did generated this one of the project but it was console app using csom.(but we used js files for pdf generation)
Word file generation: Power Automate can be handy here, which uses a
premium connector to convert. You might need to rely on onedrive for that.
Or
Azure Function: you can write Azure Function for the conversion
logic(pdf/docx)
API: as astanley86 said, you can create the API (takes care of conversion) and call it from spfx
SpFx is the modern development approach which is recommended by MS. SP Add-in has few cons which you can easily find from knowledge base.

Related

Is it allowed to generate temporary files?

I have not yet submitted any Office add-in.
For the add-in I am developing, a JavaScript function will generate a temporary .txt file, which will be treated by another JavaScript function. Does anyone know if the server of Office Add-ins permits of generating temporary files like that?
Is there any example in https://github.com/OfficeDev that uses temporary file?
If it is not allowed, which would be the data type to represent large unstructured information (like text) to be passed among JavaScript functions?
Since all web-based Office add-ins use JavaScript, you have no interaction with the local PC nor the web server where the add-in's pages are hosted. If you need to do file manipulation you could for example call REST endpoints (via Ajax from your JavaScript) on your web server which could use server-side code (such as the ASP.NET Web API, NodeJS, etc.) to do the file work and return results to your JS code.

SharePoint 2013 Dynamic Data on all pages

If I have a requirement of displaying the a content on all the pages inside a header, Whats the best way to do that in an SharePoint 2013?
I am working on a master page that will be using the design manager and there is possibility of using the same master page in the SharePoint online too. The reason why I want to know what is the best way, when I use this same master page in SharePoint online I would like avoid redoing that entire coding for getting a dynamic data from the web service.
Several ways that I have been planning is below
- User control method
- Web part method, but requires server side coding which I doubt can used in online version
This is a complete dynamic data that will be retrieved by a web service and no internal SharePoint data be used.
Thanks for reading
Deepak
If its possible to consume web-service using jQuery/Ajax call you can go with that
Or else if you want to use c#, might need to go with provider hosted app feature (sharepoint 2013)
You can create a Visual Web Part for SharePoint 2013 Online.
Your web part will be contained in a Sandbox Solution which you will develop locally. Once development is complete you will upload the Solution Package created by Visual Studio to SharePoint Online.
https://sharepoint.stackexchange.com/questions/80164/create-visual-webpart-for-sharepoint-online
http://sharepoint-community.net/profiles/blogs/sharepoint-online-2013-web-part-deployment

Using SAS to write to external Sharepoint library

I need a routine for loading files (.html) onto a sharepoint library using SAS. The site is outside the firewall (am unable to use the 'map network drive' method).
The sharepoint library is configured with 'No versioning' etc, and my username / password has administrator privileges..
I believe there are easier ways (tools) to do it than SAS, so I'd just let SAS call some other process - e.g. if your SAS is on Windows, it could call (even generate) a Powershell script.
This http://poshcode.org/2122 seems to be a way.
I've done something similar with SAS calling curl to upload files to SAS webDAV server.
If you'd like a pure SAS way - it should be doable using new PROC HTTP as a web service call.
Refer to
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a003286672.htm for SAS side and probably this http://msdn.microsoft.com/en-us/library/ff798339.aspx
for Sharepoint side.
Anyway, PROC HTTP seems interesting for some easier things.
I don't think you can use plain old SAS to do this. If you have the SAS Enterprise BI Server product, there is a component called "SAS Web Parts for Microsoft SharePoint", but that is really an interface between Sharpoint and the BI server (so you can display dashboards or run stored processes).
The "easiest" thing to do is create your html files and then use FTP to copy then to the SharePoint server. Of course, this requires an FTP server on the other end and you would want to engage the help of the Sharepoint administrator. I've done something similar myself. I don't know SharePoint myself but there is a way to set it up so that all content that shows up in a directory is automatically recognised.
There may be other solutions and I'd love to see them as well.
Sharepoint has this wonderful web interface. Basically what you do is open your web browser, works best in IE8+ and navigate to your site URL and open your document library. If you select Items in the Ribbon you can upload a document using their interface. :)
SharePoint already exposes several options, using legacy web service and the new rest services.
http://msdn.microsoft.com/en-us/library/ff798339.aspx

Does SharePoint Support VBA?

I have read very little content regarding Sharepoint (SP), and most of my reading has been sales pitch oriented overview material. I utilitze VBA with Office apps - especially Access - on a regular basis, and I am wondering if there is any translatable way to retain the custom functionality of writing my own VBA within Sharepoint, especially with MS Access.
I have read that Access databases can be run on SP, with tbales to list and forms to InfoPath, but I am assuming they are primarily talking about Access database apps that were built with wizards, which consist mainly of bound objects without explicitly-defined code.
Most of my app are primarily code driven with VBA because of my automation requirements, which I rely on to perform my tasks. Am I going to be able to accomplish the same thing within SP, and could anyone please provide any references on the subject, specifically?
You can use Access to distribute your front end to users, regardless of how much VBA it has, but an app with VBA code in it will not convert to run in the browser as a Web Database within Sharepoint 2010's Access Services. For that to work, you have to use the new, more powerful macros and limit yourself to the features supported by web objects. For an existing app, this means rebuilding every object from scratch.
Do you need to run your Access app in a web browser? If not, then you're barking up the wrong tree here.
AFAIK Sharepoint does not support VBA.
If you publish an Access database to SharePoint as a web database it cannot use VBA, however you can create a hybrid with the tables in SharePoint and the frontend in Access, that way you can have as much VBA etc as you want and still have the advantages of your data being stored in the SharePoint SQL server. You can store the frontend on SharePoint and have users download it through SharePoint .
The alternative is to keep a traditional Access database on the SharePoint share and access it via webDAV rather than the SharePoint web interface. You could map the SharePoint library as a local drive to make it easy.
Note that drive mapping is considered a legacy technology and will no longer be supported by Windows 11 due to the demise of IE11.

Programmatically access a SharePoint document library?

How would I programmatically access a SharePoint document library from another machine? I want to recursively scan all the folders and generate a list of files with a certain custom property.
You'll need to use the List Data Retrieval web service. Example code using the service can be found on the Query method page.
Vinny is correct. I just wanted to elaborate a little on the next version of SharePoint, SharePoint 2010. There are several client based models for access that essentially wrap the web service calls. There is a managed .NET dll for Windorm/WPF applications, a library for use within websites that is JavaScript based and a Silverlight based implementation.
This MSDN article has links to more information on all three.

Resources