Creating an enhanced datagrid from a spreadsheet

In one of the previous recipes we created a datagrid, by defining all columns by hand. In that recipe we called datagrids a 'weapon' for the 'Excel-killer', as websheets are called.

Well if normal datagrids are weapons, then this recipe will show you a thermo-nuclear device.

We will create another datagrid, but this time we will base it on an existing Excel sheet and therefore adding many more possibilities.

How to do it...

The company that we used as an example in the datagrid recipe has decided to add two new products to their portfolio. This means that they have to do a bit more administration. Salespeople will be able to sell more types of products and this has to be recorded. Also the company wants to base the bonuses for the salespeople on the profit they make and not just on the amount of sales. In short: selling a more expensive product means a higher bonus.

To start with this administration, the company has created an Excel sheet. In this sheet each employee has a row with his or her sales per product and the bonus that is generated by those sales. Product 1 gives a bonus of 10, product 2 a bonus of 20 and product 3 a bonus of 25.

How to do it...

On the bottom is a row with totals for each column.

To allow employees of the administration department to see and adjust these figures from a web environment, it is decided to put this sheet into a websheet.

  1. Click the New Datagrid button on the right menu.
  2. Select Copy and Paste in the wizard and click Next.
  3. Name it Extended Sales Overview and paste the spreadsheet data directly into the available field. Be sure to only select the five data columns from the Excel sheet and not the computed columns and fields as shown in the screenshot. Keep the checkbox checked.
    How to do it...
  4. Now click Upload and the datagrid is created.

To put this new datagrid into the existing Sales Overview page, perform the following steps:

  1. Click Edit on the existing Sales Overview datagrid section.
  2. Select the delete button and click OK on the following pop-up to confirm the deletion.
  3. Return to the Sales Overview page.
  4. Now create a new Datagrid section, but this time, select the Extended Sales Overview datagrid.

There's more...

To add the Bonus column and Total fields to the datagrid, there is still some work to do.

  1. Click the Edit link on the Extended Sales Overview section.
  2. Click on the Data Grid Name.

    Now we are back at the Interactive Report for the datagrid. First, we are adding the Total fields under each of the product columns.

  3. Select the Action button, then Format, and then Aggregate.
    There's more...
  4. Under Aggregation, leave the default New Aggregation.
  5. In Function, select Sum.
  6. In Column, select Product 1 and click on Apply.
  7. Repeat these steps for Product 2 and Product 3.
  8. When all three columns are done, select Actions | Save Report.
  9. Choose As Default Report Settings in the Save field.
  10. Select Primary and click Apply.

The settings are now set for all users that can view this datagrid.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.233.205