The grid component (continued)


One week later and the grid is getting finished. At least to some extent. It got quite good actually, simple to use but a bit awkward to configure. At least until i figure out a better way to do it.

As i mentioned in the last post i was considering adding functions to it, at the time i only had the picklist. Now there are a few calculation functions as well. All functions are assigned on columns and not on single cells. The newly added functions make the grid very suitable for creating invoices. This is the case that the following images will demonstrate.

Lets start by removing all rows. This will put the grid in an auto-growing mode. As soon as something is typed in the row another row will be added at the bottom.



I had to create a new type of document for this demonstration, fortunately that is very easy. I created a form with 3 inputs: article id, description and price, then i used the data import wizard to import a number of articles using that newly created form. Now we have 9 different types of books to play with. I also had to define a new picklist so we could link the books to our grid. Now we can start selling books.





In this example the columns Description and Price are populated by the picklist via a callback. Those columns are locked so i can't manually type anything in them. Then we have a number of calculation functions: Price use addition, count use multiplication, Discount deduct percentage and VAT adds percentage. The two total columns are calculating the other columns: Total + vat is calculating columns 3-5 and Total is calculating columns 6-7.
Finally we have something that i currently call vertical calculation. It adds all the amounts in a column to a total amount and report it back to the callback so we can handle the output. For this demonstration i chose to put the amounts in 2 text boxes.



Future additions to the grid will be data formatting and a print mode. If the grid does not fit on one printed page then we need to generate additional pages - with headers, footers and maybe even page summaries.
This will be a real challenge, and i have some ideas about solving it.

Kommentarer

Populära inlägg i den här bloggen

The form component

The cache component

The data grid component