【Publisher】Creating a menu report

In this article, I will show how to create a menu report.
## Creating a menu report ##
Open [Sharperlight](https://www.sharperlight.com/) application menu.
Select **Publisher**.
Choose **Other** -> **Create Menu Report** from the right-click menu.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/982dcc24-8f6a-2e67-646a-15bf3d0397c1.png)
WIth the default option, click `OK` to proceed.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/b4388ae5-5f66-7bd1-7ccd-4365f3d29448.png)
The list of published reports will open so choose reports which you want to add to the menu.
Click `OK` to go next.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/3f1b4c9a-d6af-2152-b9c5-5ab40be5509d.png)
You would be able to see what you selected with a grid. Click `OK`.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/e480fe82-c908-5df7-bee2-1a683854fd11.png)
The dialog will let you input some information for the menu. Leave it as it is and click `OK`.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/613cc469-e8d1-11ca-0839-a85a97bbaa86.png)
You would see this when the menu report is created successfully.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/ec159227-7a6e-03a4-2415-4939f8c86734.png)
The menu is also a type of published report like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/260bd5d3-0b52-63e1-2067-ac4be15632ad.png)
## Managing the menu report ##
Let's open the menu report you just created and see the details and edit it.
The **Code**, **Group** and **Title** have the default values like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d77d0c6e-e48f-a07e-bc0a-316ea4defe37.png)
You would be able to edit them like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/1032698c-f40e-db7c-e271-bd805a7b409e.png)
Then let's have a look the query definition for this menu report as the menu is created by the query.
Click `Edit Query` button to open **Query Builder**.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/208014e3-fa22-d8dd-ba7f-caf704e97cfa.png)
The query definition looks like this and this part is the definition for generating the menu structure.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/90592e6f-0028-8638-8cf6-fa409a23a37a.png)
Click this button to open the editor for it
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d24e076a-7c63-5cd4-ac72-756268718085.png)
It is a `comma delimited list`.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/e2abdc75-56e7-660d-b704-f3bba1e8d5ed.png)
If you click `Grid Edit` button you would be able to see the definition in grid.
As you can see, those five columns are at least required.
The value for each column on the header row has a special format, **Column Name::Data Type**.
We need to keep this as they are. 
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/e8b93ce5-7105-d4b3-e982-c6bc66001af9.png)
Click `Cancel` for now. Also click `Cancel` for the query builder as well.
Then click `OK` for the menu report to save it because you editted the **Code**, **Group** and **Title**.

## Opening the menu report ##
Start Sharperlight service.
Select the report in the Publisher dialog, choose **View Report** from the right-click menu.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/15a63136-dc26-81d4-ba1c-b09ad256a87d.png)
You would see two tab menus like this.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/ec8953a9-754d-c04b-7f01-d7de6b1e22c9.png)
They are come from these definitions in the query.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/da2d9576-5989-32ba-1bd0-93e3e7980d5c.png)
When the cursor is placed on "Reports" tab, the sub menu items would be displayed.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/c1c7f1a8-f25e-f7d5-374d-6a310bb5ad21.png)
These sub menus are generated with these definitions in the query.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/d2a9a67c-6d5f-3c75-1016-4f30336ffb21.png)
Let's click the sub menu "SAP Sales Invoice", the report would be displayed under the menu bar.
This is the default settings when the defined URL is like this.
```
/Report/?query=SAP.SalesInvoices
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/08283bc0-7331-6979-b5ee-6dac67d15cf8.png)
When you would like to open the report with a new tab/window, you can add **the option (&openInNewWin=blank)** to the URL.
```
/Report/?query=SAP.SalesInvoices&openInNewWin=blank
```
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/24709544-6d6f-e2fb-77e5-4f7bb687f6f2.png)
## Setting the default content ##
With the example above, under the menu bar shows nothing and you can display any report under the menu bar as default by specifing the report unique code here.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/6f9abe83-6a52-3bd4-d9ee-7f2e8af7ddc0.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/a2607b02-6b97-4011-4597-191b8417b348.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/b2d71132-6170-07ab-43da-aaa7d149e37e.png)

## Header of the menu ##
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/29f09040-062e-f568-03a3-64a5c11a97d5.png)
The header is defined in the **Header** option on the ``Options`` tab and they are written with the standard HTML code like this. You would write your own custom header here.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/1b2cb6be-488f-5e45-20b7-ee1716fded19.png)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/4c1af006-08e0-84d6-0aab-e72b6599cea2.png)