Excel Workbooks are incredibly versatile tools for both analysis and visualization of data. In fact, Excel formulas are now Turing Complete, giving business users the ability to create powerful applications without the need for conventional programming. As such, we often come across customers who have built visualizations or business flow automation apps on top of CloudExtend Excel products. A frequently asked question from these customers is how they can embed these customized workbooks into their NetSuite Dashboard.

Steps to embed Excel in NetSuite

NetSuite allows you to embed custom content on the Dashboard using Custom Portlets. Here, we will guide you through the steps of embedding an Excel workbook from your Sharepoint or OneDrive for Business account in a NetSuite Portlet.

  1. Create the portlet script file

  2. Upload the script file

  3. Configure the Portlet deployment

  4. Get the embed link for your workbook

  5. Add the Portlet to your dashboard

Step 1: Create the Portlet script file

Copy the following SuiteScript code and save it to a file with the .js file extension.

/**

* @NApiVersion 2.x

* @NScriptType Portlet

* @NModuleScope SameAccount

*/

define(['N/runtime'],

/**

* @param {portlet} portlet

*/

function(runtime) {

/**

* Renders CloudExtend Analytics Portlet.

*

* @param {Object} params

* @param {Portlet} params.portlet - The portlet object

* used for rendering

* @param {number} params.column - Specifies whether portlet

* is placed in left (1), center (2) or right (3)

* column of the dashboard

* @param {string} params.entity - (For custom portlets only)

* references the customer ID for the selected customer

* @Since 2015.2

*/

function renderView(params) {

params.portlet.title = 'CloudExtend Analytics Portlet';

var url = runtime.getCurrentScript()

.getParameter({ name: "custscripturl" });

var height = runtime.getCurrentScript()

.getParameter({ name: "custscriptheight" });

var content = '<iframe width="100%" height="' +

(height || 500) +

'" frameborder="0" scrolling="no" src="' +

url +

'"></iframe>';

params.portlet.html = content;

}



return {

render: renderView

};

});

Step 2: Upload the script file

  • In NetSuite, go to Scripting > Scripts > New

  • Hover over the text box labeled “SCRIPT FILE” and click on the + button that appears to the right of it. Use the file picker that pops up, to select the file from your computer and click Save to upload it. The popup will close automatically, once the file is uploaded. Click on the “Create Script Record” button to proceed.

Step 3: Configure the Portlet Deployment

  • On the screen that follows, provide a name and an ID for the Portlet. Set the PORTLET TYPE to “Inline HTML”.

  • Under the Parameters sub-tab, add two parameters for url and height as in the screenshot below:

  • Under the Deployments sub-tab, enter a Title for the Portlet deployment and click Save.

  • Once the Script record is saved, click on the link to the Deployment under the Deployments sub-tab.

  • Click on the Edit button and select the roles you want this portlet to be available for, under the Audience sub-tab.

  • Under the Parameters sub-tab, you’ll have the option to set the Height of the Portlet as well as the URL of the Workbook.

Step 4: Get the Embed link for your Workbook

At this point, you need the embeddable URL of the Workbook in your Sharepoint or OneDrive for Business. You can get this by following the instructions in the following link from Microsoft's website.

Embed your Excel workbook on your web page or blog from SharePoint or OneDrive for Business - Office Support (microsoft.com)

❗️One important point not to overlook is that you should append the URL generated with the additional parameters &action=embedview&&wdbipreview=True

  • action=embedview presents the workbook as an embedded workbook

  • wdbipreview enables features such as Power View visualizations, PivotTables, and Data Model-based slicers to work in the embedded workbook

Paste the URL into the URL text box and click on Save.

Step 5: Add the Portlet to the Dashboard

Now, navigate to the NetSuite Dashboard and click on the Personalize link at the top right. Then click on the Custom Portlet button (you can learn more about creating a Portlet here on NetSuite's support site).

NetSuite will create a placeholder for the Portlet at the top of the dashboard. Click on the menu icon of the placeholder and select Set Up.

Select your Portlet deployment from the Custom Content popup and click Save.

🎉

Congratulations! Now you have a fully functional Workbook app on your NetSuite Dashboard.

Did this answer your question?