Share and Enjoy !

Well, good afternoon or morning or evening to all of you, depending on where you’re at. I’m John Underwood and I’m going to be your tour guide today as we go through the SharePoint Document Generation webinar. I’ve had the good fortune of having some of you attend my webinars and classes in the past and if you’ve come back, I thank you very much.

For those of you that are new, just a little bit about me. I’m lucky enough to be working at ThreeWill. My job there is Technical Evangelist and, really, that involves two things. I get to do some engineering chores where I write code and then also get the privilege of doing a lot of presentations, be they webinars or videos or even face-to-face training classes. That’s something that I really enjoy doing.

If you need to contact me for any reason, you see a couple of touch points there. My email, [email protected] Also, if you like, you can follow me on Twitter @jbutweets. You may want to scribble that email address down really for two reasons. Number one, if we were to have any technical problems during the presentation, you could use that as an alternate way to reach me in a moment of desperation. Beyond that, you may have some questions, some follow-up, et cetera, after the webinar. Always welcome your questions. Always have to give the disclaimer that I can’t act as your off-site help desk, but generally if a customer follows up with a specific question about a topic I’ve taught, I always wind up learning something myself. If you have some questions on today’s material, I would welcome those emails in the future.

Now, some of you may have heard that we were giving away an Xbox today. My little bruised ego, I’m not going to think that you showed up just for that, but on the other hand, if it did motivate you, that’s a good thing. Just letting you know that we’ll give you the details of the giveaway and how that’s all going to happen at the end of the presentation. Obviously, we’d like for you to stay engaged until the very end so that we can share some useful information to you.

Who am I going to be speaking to today? First of all, I’m expecting that some of you are in the role of developer and you may be a developer that’s experienced with SharePoint or maybe you’re kind of new to it. Regardless, I’m going to show you some code today. We’re going to do some things in Visual Studio, but even more than that, I’m going to show you some concepts that will let you go back and help your SharePoint users get the most out of SharePoint.

The second audience that I hope to address today are those of you that just showed up and you’re just SharePoint users and you want to learn some cool new stuff. I think what you’re going to see today is really two things. Number one, some tips and techniques that you can actually go use this afternoon after the webinar is over, and then beyond that, just kind of a knowledge of what’s possible. Sometimes that’s really helpful even if you’re not the person that’s going to write this little application that does this wonderful thing. Just knowing what it possible will then allow you to go back and have a conversation with your developers about what you want to accomplish.

Then, finally, some of you are just kind of more in a leadership or a business decision-maker role and more than anything, through the code and the concepts and the tips and the techniques and the knowing what’s possible, my goal is to help you get the most out of your investment in SharePoint. I think SharePoint has some really compelling capabilities, but I think it’s also kind of a shame that a lot of enterprises under-utilize that and that’s part of what we’re hoping to do in this webinar series is not only raise some awareness about ThreeWill, but also some awareness about some of the cool things that you can do with SharePoint inside your company.

With that, what are we going to talk about today? Well, SharePoint is all about collaboration. That’s one of the principle reasons that it exists. We’re going to talk about SharePoint in light of another tool that we use for collaboration and that is email. Whether it’s right or wrong and whatever the reasons for it, I would make the argument that this is the way that most of us collaborate in business. We put an attachment on an email and we ship it off and the process begins. What I’m going to try to do today is convince you that that’s not the right answer in all circumstances and that if you have access to SharePoint, you have a much better mechanism at your disposal for doing that kind of collaboration.

Then from there, we’re going to build on that and talk about what we call around here “a single source of truth”. If we’re going to collaborate on something, then we all kind of have to agree upon what the truth is, what’s the actual data, and what state that data is in. If you’re not already aware of it, I think you’re going to see that SharePoint gives us a really, really easy way at arriving at that. Easy enough, in fact, that we don’t even necessarily need to involve a developer for this part. If we can get our SharePoint users to the point where they understand and can implement this part of the story, then the next part gets pretty interesting and that is the producing of documents.

What I’m going to do is talk you through a couple of application scenarios where we can take data that’s been stored in SharePoint and then use that to produce PDFs or spreadsheets or whatever it is we’re trying to create, and in doing so, automate a repeatable business process. That’s kind of a cornerstone of what I’m talking to you about today. These are not things that are kind of one-offs, but they’re things that have to happen over and over and over. If we have to do a report on our quarterly sales numbers, we have to do that every quarter. If we can make that process simple and easy to consume, that’s just going to make life better for both those that produce the data and those that consume the data.

That’s really the over-arching story of this entire webinar. Even though we may talk about technical details or end-user details. Ultimately, it is about a repeatable process where we can automate the generation of documents that we use in the running of our businesses.

Then, with that, let’s talk a little bit about the collaborating via email model. I’m not trying to hide my disdain for it here, at least in certain circumstances. The reason for that, if we go back through the history of email, originally it was a text medium. It was just a way to send a message to someone and get a response. Really, I can remember in my career I first started using email, the thing that I thought was so awesome about it was that it was in asynchronous form of communication where I could send off a message and when this person got time, they could respond. I didn’t have to interrupt them by calling them on the phone, nor did I have to sit and wait on the phone while they tried to formulate an answer. In some respect, it’s a very, very efficient way for human beings to communicate with each other.

As email evolved, it got some extensions. Most of you are familiar with this acronym of multipurpose internet mail extensions or MIME. Now, several really good things came out of that. The ability to have different character sets. The ability to have some more sophisticated capabilities in mail. Depending on its intended use, one possible unfortunate side effect is the advent of attachments.

I know you guys love attachments. You use them a lot and I use them a lot, too, but I say “unfortunate” in a couple of respects. Really the problem with attachments is that they don’t require a lot of forethought. They don’t require us to put anything in place in order to carry out the process. We can just at the drop of a hat say, “Oh, you need that document? Boom, I’m going to send you an attachment.”

In a general sense, there are three, maybe more, kind of issues with this that I want to talk about. I’m going to focus on the first one. The versioning or the accuracy of the data. That is really hard to do when you’re working with attachments. Give Microsoft credit. Over the years they’ve tried to put some capabilities into their office products where they can track changes and be aware of the fact that it’s being circulated by email, but in the end, the problem here is just this wasn’t meant to be a collaborative authoring tool.

Even if you can get past that, another problem with attachments, and I have to confess I do this all the time, I know a coworker sent me something and I know it’s attached to an email, but gosh, which folder did I put it in or did I accidentally delete it? This whole accountability of being able to locate a piece of important data quickly. If I don’t religiously get those things out of the email and into some well-known place, it’s very, very easy for me to lose track of them. At that point, I’m either at the mercy of the organizational system in my inbox or I’m at the mercy of the search facility in my inbox in order to locate something that’s really important.

Another one that’s a challenge with email attachments, and I’ve experienced this firsthand, you’ve got someone that’s kind of responsible for some important data, they have it in their inbox in a series of attachments, and they depart the company. Before we really get a chance to contemplate what it might mean, their email gets decommissioned. Their inbox gets blown away. This data that might really be important to us is kind of lost there.

My encouragement to you in a very general sense is before you start attaching business documents and shipping them off, think a little bit. Think about maybe there’s a better mechanism that we could use to accomplish that kind of collaboration. Now, the flip side of that, if we’re not really going to be changing the data, if I’m just sending a map of directions to my friends so they can come to my party, attachments are awesome for that. I think it’s just another case of let’s make sure we’re using the right tool for the right job.

Then let’s take a typical scenario and I can say typical not only because of I’ve experienced this, but because literally we’ve written applications for several of our customers that follow this exact pattern. We start out with a series of sales managers. We’ll say that we have a manager of each one of our regions and each one of these managers has got to contribute to a spreadsheet of quarterly numbers. Ultimately, the consumer of this spreadsheet will be people that are high in the company, executives. It’s really important that the information be correct and up-to-date.

How we usually start this, well, one of the managers will step up and say, “Okay, I’ll start the spreadsheet.” He or she goes in and puts in their numbers and then they do an email and they send it to all of the other users at once. Then they all take a solemn oath that they’re going to make sure that they keep track of who’s making what changes so that we can keep everything up-to-date. The reality is that rarely happens. The original author forgot they made a change and they went back in and did it and now two other people don’t know about it and so in a more specific sense, we have multiple copies, multiple changes, but no single, authoritative copy.

It’s funny. I’ve seen people go to just great lengths to make this work. They’ll start attaching version numbers to the end of the documents or they’ll start attaching their initials and a version number. Again, that’s just all treating the symptom instead of treating the actual problem here. Then put yourself in the role of the VP of Sales. This person has now got to try to figure out which one of those spreadsheets has the most correct data and then they’ve got to use that and forward it to the executive team. If we’re willing to do a small amount of work up front, what we can do is make it so that this information can be more reliably entered, more reliably modified, and then more reliably reported to those that are interested in it.

Let’s look at the problem a little bit differently. We said that the goal here was to produce a spreadsheet that had quarterly sales numbers that were accurate and usable, but part of the problem is that we started with the end. Let’s don’t start with the spreadsheet. Instead, let’s start at a higher level. We have a scenario where we’re trying to author or create some content and we have many contributors to that. Whenever you think about problems in business and how you’re going to solve them with technology, that’s something you always want to consider. Who are my authors and how many of them am I going to have? In this case, if we have regions, we’re going to have five authors. If we have thirty regions, we’re going to have thirty authors. We need a mechanism that works as well for two as it does for twenty-two. Something that will scale in the human sense.

Another way of looking at this problem is not only do we have many data contributors, but we have a relatively-small number of reviewers or approvers. In fact, in this case we have exactly one. The Vice President of Sales. Not only do we need to have a mechanism that will allow many people to contribute, we also have a mechanism that will allow those who are responsible for doing so to be able to review, approve, and reject content without a lot of botheration.

Another thing that’s really important here, if we’re going to make this work, we’ve got to have one location for the data and there has to be a mechanism for managing the changes in that data. This is also a really important one. We want to do this in such a way that those who would consume the data can’t see it until it is approved. That way we don’t get illegitimate numbers out in the wild and then we have to play this game of, “Oh my goodness, who all has this and how do I chase them down and tell them how to fix the numbers?”

Only then, once we’ve gone through the process of authoring, approving, and making the data fit to be used, do we worry about the producing of the documents. Then what you’re going to see in the little demonstrations that I’m going to do for you is that in a very basic sense, we can use SharePoint itself to produce a document or we can write some applications that would give us a great deal of power and flexibility on how we produce those documents.

Then let’s contemplate for a moment how we’re going to use SharePoint to drive us toward this single source of truth so that we can all agree upon the data that we’re acting on. Well, in my scenario what we’re going to do is, instead of entering those numbers directly into a spreadsheet, instead we’re going to enter them into a SharePoint. As you’re going to see in the demonstration in just a moment, this is a really, really simple SharePoint list that any user can go in and create on their own. I think that’s one of the most cool things about SharePoint and it’s something that you really need to be tapped in if you’re an end-user and that is you can get this process rolling into a usable state without having to rely upon a developer. Then once you do get it to a usable state, we can bring the developers in and even automate it further.

The user’s going to create the list and then once the list is created, now we have an easy path for all of those that are submitting the data. Quite literally, we can circulate a URL and say, “From now on, when you need to submit quarterly numbers, this is the place you go.” Not only could we give them the URL of the SharePoint site, we can even give them the URL to the specific list. It really doesn’t get much easier than that in terms of them knowing where to go in order to submit the data.

As you’re going to see in the demonstration, SharePoint has some built-in approval capabilities that you may or may not be aware of. They really take two levels. At a very, very industrial-strength level we have this notion of publishing and publishing sites, but at the list and library level, we also have this concept of approval. It’s really a breeze to set up. It just says, “I’m going to make it so that list items are only visible to the public at large or to the consuming public once we’ve approved them.” By default, when the data is submitted, it’s in a state where it’s not going to be seen by anyone other than the contributor and those that are authorized to approve it.

Let me go in and just show you a little bit about how this is going to work. Now, a couple of disclaimers as I go through my demonstrations here. Disclaimer number one is that a lot of what I’m going to be showing you today, I’m actually running on a local VM on my system. Because I’m running it on a laptop, sometimes it might not be the fastest. I wouldn’t draw any negative conclusions about SharePoint on that. It’s just the limitations of running in a VM.

Another thing that I want to point out is as I go through my various demos, I’m actually running some of them against my local SharePoint instance and some of them against Microsoft 365. I think the important point there is just whatever you’re going to learn today, it would actually apply equally to both of those environments. Whether you’re cloud-based or not, it’s not really going to matter.

Maybe a third quick point to make about my demos. These are all very-much focused on SharePoint 2013, however, many of the concepts and much of the code that I’m going to demonstrate could also be applied to a 2010 environment. Some of the application bits that I’m going to do would not be quite as cool or quite as integrated in a SharePoint 2010 environment, but the basic concepts would still exist.

I’m going to start with a very simple demo where I go into the contents for my site and I add a custom list. I’ll start the process by doing Add an App and then choose Custom List as my template. Then, for those of you who haven’t done this before, really all I have to do is give it a name and start customizing it. I’ll just call this, “Sales Numbers List,” and create it. Once I’ve created that list, I can navigate to it. I can click on the List tab and then go to List Settings. Now, obviously the presumption here is that as an end-user, you’re authorized to do this. If you’re not, then that’s something that you wouldn’t want to talk to your administrator about. You don’t have to be a site owner or an administrator to be able to change the capabilities of a list.

There’s two things that I would potentially do here in order to implement this. The first thing I would do is go down and create some columns. Obviously, I would want to go in, as example, and create a column for my gross sales with currency and my net sales and the year and the quarter and all those other things that I want to be able to track. Then once I’ve created the necessary columns, the other thing that I’ve got to do is set up my approval mechanism. Again, this just couldn’t be easier because literally I’m going to go into the Versioning Settings and right here, I’m going to turn on Require Content Approval for Submitted Items. That’s literally all that’s involved in getting this thing up and going.

Now, kind of like they do on the cooking shows here, I’ve shown you the basics of how I would do this. Let me know go over to a site where I’ve actually got it set up and I can show you this list in action. This particular one is named, “Quarterly Numbers,” and you can see that all of my sales managers have done a really, really good job of getting in their numbers for the third quarter. Now we find ourselves approaching the end of the fourth quarter and I’m going to put myself in the role of a sales manager and I’m going to go in and add some data. I’ll just simply go up and add a new list item and then notice the warning that the user gets here. It basically says, “This is a list that’s using the approval mechanism, so when you submit your data, it’s only going to be seen by you and those that are eligible to do approvals.” I’ll talk about that a little more in just a moment, those that are eligible to do approvals.

I’ll go ahead and put in my fourth quarter numbers here and we’ll choose a particular number value for each one of these. Again, I don’t pretend these are accurate numbers. I’m just trying to put in something for demonstration purposes. Now, notice if you will, when I save this, it immediately goes into a pending state. I can see it as an author and then anyone else that has approval permissions would be able to see it.

Now, if I switch roles real quickly, now I’m in the VP of Sales role and I’ve got to go in and make a decision about whether this thing is legit or not. I’ve done a little research and what I’ve discovered is that this number is actually incorrect based on some other things that I’ve seen. I’ll select the item, I’ll go to the Items tab on the ribbon, and then I’ll choose “Approve and Reject”. What I can do is set it to a rejected state and then put in some details about what’s wrong with this and what needs to be fixed. It’s a very simple process. Those that are contributors can easily see whether their data has been approved or not. In fact, they can even set up an alert on this list to let them know when data has changed that they care about. Later on, if they do realize their mistake and they come in and fix it, it’s a pretty simple matter. All they’ve got to do is go in and edit the item and recognize that they put one too many zeros on that and save it. Now it’s gone back to a pending state and someone could go in and approve it.

Those of you out there that are more on the end-user scale of things, that’s a ton of functionality and, again, it’s maybe ten minutes’ worth of work to set it up. If you’re not already familiar with those capabilities of using a list that way, I want to strongly encourage you to dig a little deeper on that and give it a try. I think what you’ll see is that you can go a long way toward accomplishing what it is that you’re trying to accomplish.

Now, the last thing I wanted to show you is how we get permissions for these. I know that some of you would be the ones that would set up permissions. Others of you, you’re not going to be doing this, but you just need to know a little about it so that you can ask the right questions. If I go to my Site Settings page and then I select Site Permissions, what I want to show you is just real simply how you might set this up. What I can do is I can set up a group for people that should be allowed to approve the content. I can name that whatever I wanted to name and I could put in whatever individuals I wanted to put in.

The key part, though, is right down here. Notice the various permission levels. Obviously, we don’t want to give them full control, but in order for someone to be approver, they have to have at least design-level permissions. Obviously, my VP of Sales, he or she is going to be in the role of approving this content. They would need to have this effective permission in order to do that. Most likely, those that are contributing data are just going to have contribute capabilities. Those that might be responsible for configuring lists would need edit capabilities. All of it’s there and it’s out of the box, you just got to know how to stack things up correctly in order to take advantage of it.

Now that we’ve reached a point where we can pretty easily capture that data and feel pretty confident that it’s going to be accurately disseminated, let’s now talk a little bit about how we can get at the data. If you’re lucky enough to have a developer at your disposal, we’re going to talk in a few minutes about some of the amazing things that you could do with that. Even if you don’t have a developer at hand, once you get the list looking the way that you want it to look, it’s a pretty simple thing to get it into Excel. Literally, I’m going to go over into Quarterly Numbers and I’m going to go to the List tab, and then I’m going to choose Export to Excel.

The cool thing about this approach is that it’s not actually downloading the data, rather it’s downloading a query that pulls that data from SharePoint. The idea here is I can now slice and dice this data and accomplish whatever I want. What I would tell you is that in the real world, this is an approach that’s really cool and probably okay for someone that’s a bit of a SharePoint jockey, but for someone that’s more maybe in an executive role and they just want to push a button and have the stuff at their disposal, this probably draws them a little farther into the SharePoint experience than they want to go. For that audience, that’s the case at which we’d probably need to think about writing some applications. Let’s go have a look at that.

How is it that we’re going to produce our documents? Well, in a very general sense, what we’re going to do is write an application that uses SharePoint as its source of data. No doubt many of you have either written or worked on applications where someone wrote a “front end” that knows how to read out a SQL server or some line of business application. We’re essentially doing the same thing. In this case, instead of reading the data and putting it on screen in a data entry form, these are apps that are going to read the SharePoint data and produce some kind of document from it.

I’m going to show you two approaches that you can use to accomplish this in SharePoint 2013. The first of those is a SharePoint 2013 app. The advantage to this one is really kind of multi-fold. Number one, it integrates directly with the SharePoint site. The same destination that someone might go to to enter data, they can go to that same destination and with a couple of mouse clicks extract the data that they need.

Another thing that’s nice about the SharePoint 2013 app approach is that because it has some knowledge of SharePoint, not only do we have the ability to programmatically read data out of the SharePoint list to produce the document, but then we can turn around and take the produced document and store it in the document library. The person responsible can generate that document, but then any other party that’s interested in it can know that if they go to that library, they’re going to see an approved and released version of that document.

The other approach, and this one is completely new as well, something called an Office 2013 app. I have to confess, even though these have been out for a little while, it’s only now that I’ve gotten an opportunity to start working with these. I have to admit I’m actually pretty excited about some of the things that you can do here. The idea with this is instead of having some kind of app that integrates with the SharePoint site directly, instead I’m going to write an app that actually integrates with the desktop version of Excel or PowerPoint or whatever app I’m writing it for. The really cool part of this, as you’ll see in my demonstration, is that the consumer doesn’t have to visit SharePoint. They don’t have any concept that SharePoint is even coming to the party. All they know is that they can launch their Office app and make a few mouse clicks and wind up with the data that they want. I think you’re going to like what we can do with those.

I know some of you have been to prior webinars or maybe you just read up on your own enough that you already know about this, but on the chance that a few of you kind of don’t know the SharePoint 2013 app story, let me just take one slide here and talk about that briefly. First of all, when we say “app,” we kind of joke around the office of App with a capital “A” versus app with a lower case “a”. This is an app with a capital “A”. It’s a particular kind of programming model that’s new for SharePoint 2013. Apps are created by developers. This is not a power user thing, but rather a developer thing that is created on behalf of users. When we write SharePoint 2013 apps, we’re writing code that runs out-of-process or, perhaps betters said, runs outside of SharePoint. There’s a lot of reasons why that’s a really good thing, not the least of which is it kind of insulates our SharePoint server from being slowed down or brought to its knees by bad code.

From a developer perspective, when I say “out-of-process,” what does that mean? Well, it really means your code is going to be running in one of a couple of places. It’s either going to be JavaScript that’s running in the browser or it may be code that’s running on another server. Depending on the kind of server it is, it might likely be .NET codes such as C#. It’s also possible that you could have a non-Microsoft server that’s integrated into this process. Either way, you could just think about this model as being, “I’m going to write my code and then that code is going to remotely call into SharePoint and get whatever data it needs.”

How do you users get these apps? There’s really two models. First of all, you would have something within your enterprise called the App Catalog. Essentially, the App Catalog is like a giant library where all authorized users can find apps and install them to their sites. There’s also a global SharePoint Store. Most companies probably wouldn’t open up to their users for fear of what they might download, but the cool thing about the store is that as a user, I can actually visit there, find an app that I like, and then make a request for it in my company’s app catalog. At that point, an administrator would see that request, see that I want that app, they could go review it, and if it makes sense, they could actually purchase it and put it in the app catalog.

There’s a lot of exciting things going on there. For users, your developers are going to be able to build you some really cool things that are very easy for you to consume. For developers, what you just got is a much better mechanism on rolling out and updating your apps and having a central place where people can actually discover those apps.

For the specifics of the app that I’ve written for you that I’m going to demonstrate here in just a moment, we’ll start with the list that I showed you just a moment ago. I’ve got a SharePoint list and it contains sales numbers for a variety of quarters and years. Then from there, I’m going to write what we would call a cloud-hosted app. That is to say, I’m going to have some server code that runs in another server. It’s going to call in the SharePoint and then it’s going to read the sales numbers from that list for a particular year and for a particular quarter. Then those of you that are developers, what I’m using here is the C# client-side object model. I’m just making a remote call into SharePoint.

Now once I’ve pulled down the data that I need from SharePoint, the next step is to produce the PDF in this case. I’m going to do that via a third-party PDF library. Once I’ve actually produced that document, I’m going to turn right around and have my application write it to a document library and in that same SharePoint site. Then from there, the users will have two approaches to getting at that data. For the user that runs my application, they’ll actually be presented with a hyperlink that will easily let them read that document. In addition to that, anybody on the team that has access to that particular document library can navigate directly to it and see all of the contents within.

All right. Let me take a moment now and show you how this works. Now, those of you that are developers, you’re probably very excited to see that I’m in Visual Studio now. Those of you who aren’t developers, don’t let your eyes glaze over. I’m not going to stay in here very long. I’m just using this as a point to kind of help our developer friends understand what I’m doing here.

For the sake of our demonstration, I want to just focus on this page right here, default.aspx. This is going to run in my remote web and it has a very simple UI that’s just going to allow the user to pick a year, pick a quarter, and then generate the information that they’re interested in. Now, if we go and look at the code behind that is associated with this, even if you haven’t done any SharePoint 2013 programming just yet, if you’ve done some client-side object model in SharePoint 2010, it’s essentially the same here. The ultimate goal is for me to create a client context object. This is what will allow me to call into SharePoint and request the data that I’m interested in.

In this case, the data that I’m interested in, I’m going to extract that via a CAML query. Even if you have no idea what a CAML query is, basically we’re saying, “I want a particular year and I want a particular quarter.” Those are going to come from whatever the user happened to choose on the screen. Once I’ve asked for my data and received it back, then I’m just going to write a simple loop and in that loop I’m going to take that data and render it into a PDF. I’m going to take that PDF and write it to a memory stream. Then finally, I’m going to upload that file. Literally, I’m going to use the client-side object model to take a document that’s buffered in memory and upload it.

There should be two reactions to that. If you’re a developer, that’s pretty cool. I like the fact that I can do that. Then if you’re an end-user and you’re a little bewildered, let me kind of set your mind at ease. The reason you care about this as an end-user is that you didn’t have to think about where you stored the app. You didn’t have to worry about if you stored it in the right place or the right location on your hard drive. The app was responsible for putting it in the correct place and your job was just to ask for what you want and then get it. It doesn’t get much better than that.

All right, with that, let me go ahead and run this. Again, obviously those of you in the user role, you would not be running it from Visual Studio. This app would already be installed on your SharePoint site and you’d be able to navigate to it. Now, if I attempt to generate data for which I don’t really have any data, it’s just going to give me a little message saying that we don’t have any numbers for that particular time unit. Instead, let’s go get the third quarter of 2013 and I’ll click on “Generate”. Notice our users get two things here. They get a little indication that the PDF has been generated and then they also have this click-to-open link. As I click on that, you can see that I literally generated a PDF that just gave them a formatted list of the available numbers.

Really important here. Don’t get hung up on the format of the document. I wasn’t trying to make an artistic statement here so much as I was just trying to show you that you can programmatically create these things and upload them to SharePoint fairly easily. Obviously, we have a particular look and feel that we wanted to achieve and we can certainly do that on behalf of our users.

Now the other thing to think about is if I returned to the site on which this app is running, at any future point, if I want to see this document, I can literally go into the document’s library and there’s the PDF that I just generated. Couple of things that I think are kind of cool about this, not only did I generate the document and it knows that it was me that generated it, there’s another little cool part here and that is, notice that last column, “App Modified By”. Those of you that are developers, you probably want to make a mental or written note of this. When you start writing apps, SharePoint not only has the concept of the user’s identity, but also the app’s identity. There are some really, really clever things that you can do with that. That’s a capability that I think is pretty exciting and holds out some interesting ways to do things on behalf of the user.

All right, so there’s the process. Going forward, how would our users consume this? They’d consume it in one of two ways. They would either go to their SharePoint site, go to the Site Contents area, and click on the app in question, or we could even simply provide them with a link. They use the link and it takes them directly to the app.

I’m going to keep plugging ahead here. Just an FYI, I noticed maybe one or two of you have posted some questions out there. That’s awesome. Please continue to do that. I’m going to save those until the very end just so that I make sure that I get through all of my material. Please don’t think I’m ignoring you. I’m just holding those until the end.

All right, so the SharePoint app is cool enough, but let’s face it. There are some people out there, right or wrong, that are just a little biased against SharePoint. Maybe they had a bad experience. Maybe they just don’t like the way it looks. Doesn’t matter. The point is we can implement this same model that we just saw, a very convenient way for a consumer to get at the data that they want without them ever having to visit SharePoint.

That’s really what the Office 2013 apps model is going to be about here. Conceptually, it’s similar to SharePoint. You’re writing an app. It’s going to enhance this product or customize this product that Microsoft is providing to you. The difference here is instead of integrating through the web browser onto a SharePoint site, it’s actually going to integrate directly with Word or Excel or PowerPoint or whatever you target this to.

When you write these apps, what you’re really doing is you’re writing a web page. Developers, everything you already know about server code and HTML and JavaScript, those would all still apply. The difference here is that the web page that you’re authoring is actually going to be visible or hosted inside of Excel or inside of Word. As you’ll see in the code that I’m going to demonstrate for you in just a moment, you’ll actually have a JavaScript library that will allow your page to interact with the hosting application. I can put together logic that would allow me to inject data into a spreadsheet. I could put together logic that would let me read data out of a Word document and then do some kind of action based on that.

What is the integration point here? Well, because we’re using standard-based web tools here, we can take these pages that we’re going to add to Word or Excel and we can integrate them with a variety of back-end data sources, most notably for this webinar, SharePoint. The idea here is that the user’s going to be completely sheltered from SharePoint. They’re not even going to know it’s a part of the party, but we’ll be able to go out to SharePoint on their behalf, pull down whatever data they need, and present it in an easy-to-use format.

Now there are essentially three different kinds of applications that you can write for Office 2013. The first of those is called a task pane app. That’s the kind of app that I’m going to be building for you. As you can see, the app renders in a Window to the right of your main document and then, as I mentioned a moment ago, this app is going to have both the capabilities of putting things into the document as well as reading things out of the document and taking some kind of answer on them. Then this back-end data source, you can see in this little simulated example, someone’s actually written a task pane app that will take text, call Bing, and translate it. Pretty much any back-end service that’s a breachable service by a REST call or a web service call, we’re going to be able to do those kinds of integrations from within Office.

A second approach is one where we right what’s called a content app. In this case, instead of being in a separate pane, this is actually an application that embeds directly in the document itself. In this example, we’ve actually embedded this app that someone has authored that will read data about states and sales and then actually give us a graphical map that shows where those sales are taking place. Maybe another way for you to think about these if you’re a developer, anytime you’ve got a user that’s trying to write a formula that’s really, really complicated in Excel or they’re trying to create a chart that has some highly-customized capabilities, it could be that you could author a content app on their behalf that would do all of those things and for them, it’s literally a couple of clicks to put it in place and use it.

Then, ironically enough, I kind of ragged on mail and attachments earlier in the presentation, but there are some cases where we’d want to be able to do some clever things with email integration. That’s what a mail app is about. A classic example here. As a user, I could highlight addresses and then I could have a mail-out that would actually go out and do a Bing look-up and show the user the map for that. Anything that you’re doing that is legitimately built around the email process, we can do some very clever things with the mail app.

Once again, for those of you that do better with pictures as opposed to words, we’re starting in the same place here. We’re starting with a SharePoint list that contains the sales numbers that you saw at the beginning of my presentation. Now in this case, instead of the user navigating to a particular place, they’re going to launch Excel. Then their Excel instance will be configured in such a way that they actually have access to this task pane app that I’ve written on their behalf. For them, it’s as simple as picking the right options, clicking a button, the task pane app then will go out and read the SharePoint data on their behalf, pull it out, and then populate it into a spreadsheet or whatever kind of office document that we’d like to put it in.

Let me give you a couple of demonstrations here. I’m going to show you how you can use this process to generate an Excel spreadsheet. I’m also going to show you how you can generate PowerPoint data. I can tell you again, literally, we have written apps on behalf of customers that do both of these things. The story here is just now that we’ve got these Office 2013 apps, the process gets really, really simple and really, really easy.

All right, so I’m going to go back in now and I’m going to open up the first of my two demo apps. Then, for the people in the room that are more on the developer track, you’ll notice that when you create an office app, structurally it looks very similar to a cloud-hosted SharePoint app. That’s a pretty decent analogy. To put that in another way, most of the code that you’re going to be writing is going to be down in this app web and then really the top part is just declaratively describing some information about your app. Among the things that it would tell you, what products can it work with. The fact that this says “workbook” here, that tells me that this is for Excel and that it’s not for PowerPoint. They don’t have to be mutually exclusive. You could actually write an app that would integrate with Word and Excel and PowerPoint all at the same time.

Then the other part of this, the actual logic here for creating the data and pushing it into the document. Again, I don’t want to belabor this too much because I know I have a mixed audience here. Those of you that looked at the code earlier, here’s what you need to take away. I’m using the exact same client-side object model code to fetch the data. Same query and everything. The only difference here is that once I’ve got the data, I’m going to format it in adjacent array format and then send that back as a string. Then I’ll actually have some JavaScript code that can take that, decompose it into an array, and then insert it into the document.

How is it that things get into the document? For those of you that are going to be writing this kind of code, this is probably the most important sentence of all in this demo and that is everything that allows my app to interact with Office is encapsulated in this office.js script. Literally it’s providing me with an object model that will allow me to read and write data from JavaScript down into the document or vice versa.

In this example, I’ve set my data back in a container named “Payload”. I’m going to take that, parse it into an array, and then notice what I’m doing in this example. Because it’s Excel, Excel has this concept of a matrix. To put that in simple terms, you can create a two-dimensional array, put data in it, hand that over to Excel, and Excel knows automatically how to format that data correctly. The method that I’m using here is called “Set Selected Data ASYNC”. Those of you that write a lot of code, you know that when you see that word “ASYNC,” you can optionally provide a callback that would let you do a success or a failure message. For this example, I’m leaving off the callback and I’m just putting the data in directly.

All right. Let’s give this a try here. I’m going to run it now. Again, those of you that are in the user role, you’re not going to run this from Visual Studio. You would just have Excel already configured to have availability to this app. Notice what I get here. When I run it, I’m running Excel. Then the markup you saw just a moment ago has now actually rendered in this window. If I try to get data for a year-end quarter that doesn’t have any associated data, I get the same message that I got before. On the other hand, if I go in and pick some valid settings here, notice that it retrieves the data and immediately puts it into the spreadsheet.

Now if I’m in the role here of the Sales Vice President, watch what I’m going to do. I’m going to go right here and select some data and I’m going to insert a recommended chart and maybe change a title or two and I’m done. Save my work and publish this information to whoever needs to get it. Then when I’ve got to do this again next quarter, I fire up Excel, I create a new spreadsheet, I click the mouse the same three times like I did before, and I’m done. To me, the exciting part of this is just that we’re getting the collaborative capabilities of SharePoint to manage the data, but for those who want to consume it, we consume it very close to the source. They don’t have to know that much about where it came from and how it got constructed.

The model for how we would do this on PowerPoint is almost identical. The one little bit of code that’s going to be different here is that PowerPoint really doesn’t understand the concept of anything other than text data. You’ll remember a moment ago when I wrote my data, I had a coercion type of matrix. In this case, I’m just writing string data. Literally what I’m doing here is just writing a loop that will construct the data and then I’m going to inject that into a PowerPoint document.

Let’s suppose that you’re the VP of Sales and you have to produce a PowerPoint every quarter where you report on how your divisions are doing and then one of the slides has to have your numbers. Well, you’re in PowerPoint. You’re authoring the different parts of the PowerPoint and then once you get to the point in time where you want to add that particular slide, you just simply come over here and click “New Slide,” and then you click in the body of the slide. You choose the year that you’re interested in and the quarter and you click “Get Data”. Notice what it did. It actually read that data from SharePoint, formatted it in a way that is appropriate for my PowerPoint, and so now all I have to do is put on a title and then continue the process. Again, I think that is a really compelling story on how you can generate these things very easily.

All right, let’s hit a few wrap-up points here. We’re getting near the top of the hour. Kind of recapping what we talked about. First of all, if you know you’re going to be collaborating on something where there’s going to be more than one author, don’t use email. Spin the ten or fifteen minutes that it would take to set up a SharePoint list or a library and keep the data there. You’re just going to be way ahead of the curve even if you don’t have the luxury of writing applications. That single source of truth. Really in this one, I focused on lists because the data was more appropriate for a list. If you truly have to author a spreadsheet and that’s the only way you know to do it is just to author the spreadsheet, you still ought to be keeping it in a library as well. Then you can use the check-in and check-out mechanism just to make sure that you’re not trampling each other’s changes. These are going to be much better alternatives than trying to track it by email.

Another thing, take advantage of that SharePoint approval mechanism. Literally one click and you’ve got yourself in a circumstance where people can’t see the data until it’s been legitimized by some reviewing party. Then from there, for those of you that are developers, I hope I kind of whetted your appetite a little bit there in terms of writing SharePoint apps and Office apps as a way to generate these documents. Then, if you’re more on the user side of the house, while you’re not going to be authoring these applications, you now kind of know what’s possible and this is something that you can take back to your developers and kind of blaze a trail on getting these things done. Obviously, part of the point of these webinars is just the fact that ThreeWill does this. We’ve done this for several our customers and we’ve got a really good track record in making it so that people can get these documents produced repeatably and reliably without having to exert a lot of effort.

I hope enough of you stayed awake to this part of the presentation to kind of hear a little bit about our giveaway. Again, in order for you to be eligible for the giveaway, not only did you have to attend the webinar, but you’ve got to properly complete the end-of-webinar survey. You’ll get prompted for that when you exit the webinar. If for some reason you miss that or you lose that link, you can email me and I can send you an alternate link. I encourage you to go ahead and do it. Notice it says, “properly complete.” There is actually a question in there where you have to say, yes, you’d like to be registered for the drawing. The reason that we’re doing that is that we occasionally have customers that work for companies where they’re not allowed to receive gifts over a certain amount. If you’re at a company where you’re not allowed to do that, you may want to forego the contest, but for the rest of you, that’s how you’re going to opt-in.

A couple of details. We’ll perform the drawing tomorrow, so that will give you the rest of today and the evening to get the survey filled out. It shouldn’t take long at all. It’s a very brief survey. We’ll announce it in a couple of ways. We’ll announce it on our Twitter feed. That’s @threewill. We’ll also announce it on our Facebook page, facebook.com/threewill. Then just as a follow-up, we’ll also notify the winner via email. Then pretty much like any contest, the decision of ThreeWill concerning the giveaway is final.

With that, I’m at the end of my prepared material. For some of you, you’ve got a busy day ahead of you and you’re going to launch onto other things and that’s great. For those of you that can stick around a second, I’m going to see if I’ve got any questions. You can post those questions right now if you haven’t posted them already. If I have any, I’ll read those out loud.

I didn’t get a question so much as a comment. A couple of you thought that the Office 2013 app integration was pretty cool. I completely agree. I think that there are some enormous opportunities there for you to integrate data and make it very easy for your users to consume and let them be largely naïve about where that data is coming from. They just get what they need and they don’t have to do a lot of clicks.

Again, I’m going to stay on the line here for a couple of more minutes. If you’ve got your questions, please add those to the question manager and I’ll respond to those out loud. Otherwise, I really appreciate your time. I know that any time you invest an hour of your work life, you’re hoping to get something out of it. I hope that you’ve seen some things here that would apply to your organization. If you’ve got any questions or any interest whatsoever in letting us help you out with that, feel free to drop me an email. Again, [email protected] and I’ll be sure and connect you to the right place. Thanks again for attending.

Share and Enjoy !

Related Content: