LoginSignup
1
0

【Excel Addin】Creating a Report in Excel

Posted at

Introduction

I am writing a post about how to create Excel report with Sharperlight Excel Add-in here.

Creating a Report in Excel

Open Excel and select 1. cell C5, then click on the 2. Table icon in the Sharperlight ribbon to launch the Query Builder.
image.png

Specifying Filters

This corresponds to the FROM and WHERE clauses in SQL statements. In this case, we will use the Dynamics 365 Business Central as the data source, specifically focusing on the Product. Let's proceed with the Company set to <DEFAULT>.
image.png
Specify Cust. Ledger Entry for the Table.
image.png
Upon selecting this table, two mandatory filters, namely Customer No. and Posting Date, will automatically appear. For both of these filters, we will keep the filter values as <ALL> for this instance.
image.png
On the lower-left side, a tree structure will display the selected table's columns and JOIN information.
image.png

From here, you can select the columns you want to use for output and the columns you want to use as filters. Let's proceed by dragging and dropping the Document No., Due Date, and Open columns into the filter area.
image.png
Here are the specified values for each:
image.png

Specifying Output Items

This corresponds to the SELECT clause in SQL statements. Double-click or drag and drop the columns you want to display as query results from the selection tree view to the output area. For this instance, we will output these three columns. Additionally, the Amount column has been sorted in descending order.
image.png

Preview and Confirm

Let's validate the query by pressing the Preview button.
image.png
Everything worked correctly, so let's use the OK button to expand the data onto Excel. The Sharperlight table formula is defined in Cell C5, and a table has been created starting from the cell just below it.
image.png

Improvement with Cell References for Filters

Let's make this report a bit more user-friendly. In Cell A3 and Cell A4, enter the following values. Also, in Cell B3, enter <DEFAULT>.
image.png

Double-click on Cell C5 to invoke the query definition.
First, 1. Select the value field for the Company filter in the query builder. Then, 2. double-click on Cell B3.
image.png
The formula referencing Cell B3 will be set as the value field for the Company filter in the query builder.

Similarly, 1. select the value field on the right side of the Due Date filter in the query builder. Then, 2. double-click on Cell B4.
image.png
The formula referencing Cell B4 will be set as the value field for the right side of the Due Date filter in the query builder.
image.png
Set Cell B4 with the date value 30/06/2022.
image.png

The query modification is now complete. Reflect the changes by clicking the OK button in the query builder.
image.png
Now, the values entered in Cell B3 and Cell B4 will be reflected in the Sharperlight table formula (query) filters. Try double-clicking on Cell B4. This should open a date selection dialog.
image.png
If you select a different date, the query will be recalculated immediately.
image.png

I will change the background color of filter cells and organize the report. I will use Excel's standard themes.
image.png
image.png

Conclusion

What do you think? It seems like creating a report is easy.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0