【Publisher】Try sharing an internally shared Excel document using a browser

# Introduction #
We normally have many type of official document template in an organisation, and they are often typical document files stored in shared folders through the organisation.

We usually copied templates created in Excel stored on a network drive to each person's terminal, then edited and used them.
This results in many copies of the template being duplicated within the company.

Someone may end up using an old template that they previously copied to their device, even though the original version stored on the network drive has been updated.

I will explain how easy we can transform the template created in Excel into online version for sharing, and we edit it within the browser and save as PDF files.

# Preparing template in Excel #
I have prepared the two sheets like this.
The 1st page.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/f45da544-507b-c968-5c6d-1d9495497d53.png)

The 2nd page.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/20b8cee8-90e8-1960-075d-424b735d2b94.png)

I would like to allow users to edit only those cells in light-blue, so I unlocked those cells and set the Sheet Protect option on.

Unlock Cells
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/dcdca762-1022-fa22-1514-ddc5e6d207dc.png)

Protect Sheets
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/ee62103e-fd63-e26c-9f33-dc76c9d53deb.png)


# Publishing template to network #
We use an option of Sharperlight Addin called **Publish Workbook**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/c09b7aad-6030-b46b-281d-db211c1e54f3.png)

It will open a new Published Query dialog.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/e6c1b22f-9ad9-e696-90ff-53280f204e93.png)


### General Tab ###
We can give it **Group**, **Code**, ``Title``, ``Report Title``, ``Description`` etc.
**Group** and **Code** make a unique key code for this published query so we cannot change these values after this goes live.
If they need to be changed, we need to let user know the new key code.

Once it is published, the access point is like this and **Group** and **Code** are used here.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/7f079d3f-88ca-2b8a-4325-8f43aad7135d.png)


### Spreadsheet Tab ###
This is the main part for transforming the Excel template into online template. 

We can see the template is already imported. Whenever the template need to be modified, we can import the updated template from here.
We also need to make sure some options for PDF output. We can adjust this option by actually saving it as a PDF and reviewing it later.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/3186bb4a-78bb-5034-9e57-0d1ea8d4c1bf.png)


That's it, save the definition by clicking ``Apply`` button at the bottom of the dialog.

# Editing template in browser #
Please start Sharperlight service on the local pc where we are working on now.
Click ``View`` button to show the template with the default browser on the local pc.
Now we can see the template in the browser.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/3235312d-a6a2-d87c-0ca1-bd574009c866.png)

Make sure the other cells rather than in light-blue don't allow us to edit.
We can now edit the light-blue cells to our desired content.

# Saving as PDF #
Please right-click on the document area to show a popup menu like this.
Then we can now choose **Download PDF** to save it to the file system.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/459efab4-393e-51d3-e7ae-a7752cc98a11.png)

We can review the output in PDF viewer and can adjust by editing the original Excel template and reimporting or just adjusting some options with the published query definition. 
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/3b816334-07f8-8d47-8d55-52996ad4281b.png)

Once we confirm it works fine, we can deploy the published query to the Production Sharperlight Application server in the local area network within the organisation so that the employees can use the online template. 

# Conclusion #
We can now keep only one original Excel template in a common place, and only allow admin users to update it and import into the published query definition.

The end users now can use the online template for creating their appropriate quotation via web browser and save as PDF files for the use.