- Jun 6, 2020
- 11,517
- 4,383
This tutorial shows how we can export data from a MS Access database to MS Excel workbook.
As a former professional Excel developer I highly recommend to use templates in MS Excel.
Although jPOI cannot handle real templates (*.xlt) in MS Excel there are some advantages
of using a standard workbook as a template:
* Less code to write
* Overcome shortcomings of jPOI
* Easier to maintenance
* More professional Excel reports are created when using templates.
However, when using formulas and calculation functions in the template files we must be aware
of that before saving a copy of the template we must force a recalculation of the whole
workbook. Otherwise the formulas and functions will not be updated. Of course, if it
something that I like to be added to the jPOI library it is the recalculation. As it is now,
we need to explicit write Java code to execute the recalculation (see the code below).
The first picture shows the template in use. In the E column a custom formula is
added...
As a former professional Excel developer I highly recommend to use templates in MS Excel.
Although jPOI cannot handle real templates (*.xlt) in MS Excel there are some advantages
of using a standard workbook as a template:
* Less code to write
* Overcome shortcomings of jPOI
* Easier to maintenance
* More professional Excel reports are created when using templates.
However, when using formulas and calculation functions in the template files we must be aware
of that before saving a copy of the template we must force a recalculation of the whole
workbook. Otherwise the formulas and functions will not be updated. Of course, if it
something that I like to be added to the jPOI library it is the recalculation. As it is now,
we need to explicit write Java code to execute the recalculation (see the code below).
The first picture shows the template in use. In the E column a custom formula is
added...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید