none
Office 365 Excel App and server side code. RRS feed

  • Question

  • Hi,

    I was reading 'Overview of apps for Office' -

    It mentions under 'What can an app for Office do'?-

    Run server-side code or logic, if the page is implemented using a server-side scripting language such as ASP or PHP.

    I already built by first app using NAPA, could not find any option to add server side code. Non of the samples include any server side code either. Is the above valid for Office 365 Excel app? If so, how is it done?

    Regards,

    Aseem
    Monday, February 4, 2013 9:18 PM

Answers

  • In the manifest of the app you can specify the url where your app is hosted. Never really tried it with Napa tools, but if you can edit the manifest itself, you can simply just change the url.

    If not then i think this for now can not be done in Napa, but you can workaround it, by adding an iframe to your app in Napa tools and use src as url to your actaul hosted app.

    If you can get your hands on Visual Studio 2012 Ultimate (Premium or Professional) then install Office Tools ( http://msdn.microsoft.com/en-us/office/apps/fp123627 or Napa can do it for you if you click to open in VS) then you can just create a new project based on a template or even edit the project created with Napa.


    Anze Javornik

    Monday, February 4, 2013 10:27 PM
  • Hi Aseem,

     

    You can always make AJAX calls from your HTML page to some other page, which can implement server-side logic.  E.g., you could connect to a PHP service -- provided that service knows how to respond in JSONP format.  The reason you need JSONP is that otherwise you will run into cross-domain security issues (which is standard Web behavior).  But you can do this, even from within Napa, so long that you're handling your PHP code elsewhere.

     

    If you want to deploy ASP.NET pages WITH the app, you will need to open your Napa project in Visual Studio -- and there you can just add ASP WebForms pages, or any other web artifact you need.  Note that this also works great if you need to get around the cross-domain issue, or are trying to aggregate data:  you can use the ASP.NET page to either act as a true page, or just as a web service that can essentially convert non-JSONP data (like an XML feed) into something that your AJAX calls can consume.

     

    Hope this helps,

     

    - Michael


    Michael Zlatkovsky | Program Manager, Visual Studio Tools for Office & Apps for Office

    Tuesday, February 12, 2013 8:02 PM

All replies

  • In the manifest of the app you can specify the url where your app is hosted. Never really tried it with Napa tools, but if you can edit the manifest itself, you can simply just change the url.

    If not then i think this for now can not be done in Napa, but you can workaround it, by adding an iframe to your app in Napa tools and use src as url to your actaul hosted app.

    If you can get your hands on Visual Studio 2012 Ultimate (Premium or Professional) then install Office Tools ( http://msdn.microsoft.com/en-us/office/apps/fp123627 or Napa can do it for you if you click to open in VS) then you can just create a new project based on a template or even edit the project created with Napa.


    Anze Javornik

    Monday, February 4, 2013 10:27 PM
  • Hi Aseem,

     

    You can always make AJAX calls from your HTML page to some other page, which can implement server-side logic.  E.g., you could connect to a PHP service -- provided that service knows how to respond in JSONP format.  The reason you need JSONP is that otherwise you will run into cross-domain security issues (which is standard Web behavior).  But you can do this, even from within Napa, so long that you're handling your PHP code elsewhere.

     

    If you want to deploy ASP.NET pages WITH the app, you will need to open your Napa project in Visual Studio -- and there you can just add ASP WebForms pages, or any other web artifact you need.  Note that this also works great if you need to get around the cross-domain issue, or are trying to aggregate data:  you can use the ASP.NET page to either act as a true page, or just as a web service that can essentially convert non-JSONP data (like an XML feed) into something that your AJAX calls can consume.

     

    Hope this helps,

     

    - Michael


    Michael Zlatkovsky | Program Manager, Visual Studio Tools for Office & Apps for Office

    Tuesday, February 12, 2013 8:02 PM