dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #08003
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2379: Tally Sheet Generator - Improved GUI and codestyle.
------------------------------------------------------------
revno: 2379
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-10-15 17:47:44 +0700
message:
Tally Sheet Generator - Improved GUI and codestyle.
Improved the generator PDF servives.
modified:
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/tallysheet/DefaultTallySheetPdfService.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PDFUtils.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/tallySheet.js
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/selectTallySheetForm.vm
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTallySheetForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java 2010-09-01 07:30:48 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/pdf/impl/ItextPdfService.java 2010-10-15 10:47:44 +0000
@@ -127,8 +127,9 @@
public void writeAllDataElements( OutputStream outputStream, I18n i18n )
{
+ initFont();
Document document = PDFUtils.openDocument( outputStream );
- initFont();
+
for ( DataElement element : dataElementService.getAllDataElements() )
{
PdfPTable table = getPdfPTable( true, 0.40f, 0.60f );
@@ -150,13 +151,14 @@
table.addCell( getTextCell( element.getDescription(), TEXT ) );
table.addCell( getItalicCell( i18n.getString( "active" ), 1, ITALIC ) );
- table.addCell( getTextCell( getBoolean().get( element.isActive() ), TEXT ) );
+ table.addCell( getTextCell( i18n.getString( getBoolean().get( element.isActive() ) ), TEXT ) );
table.addCell( getItalicCell( i18n.getString( "type" ), 1, ITALIC ) );
- table.addCell( getTextCell( getType().get( element.getType() ), TEXT ) );
+ table.addCell( getTextCell( i18n.getString( getType().get( element.getType() ) ), TEXT ) );
table.addCell( getItalicCell( i18n.getString( "aggregation_operator" ), 1, ITALIC ) );
- table.addCell( getTextCell( getAggregationOperator().get( element.getAggregationOperator() ) ) );
+ table.addCell( getTextCell( i18n
+ .getString( getAggregationOperator().get( element.getAggregationOperator() ) ) ) );
table.addCell( getCell( 2, 30 ) );
@@ -168,8 +170,9 @@
public void writeAllIndicators( OutputStream outputStream, I18n i18n )
{
+ initFont();
Document document = PDFUtils.openDocument( outputStream );
- initFont();
+
for ( Indicator indicator : indicatorService.getAllIndicators() )
{
PdfPTable table = getPdfPTable( true, 0.40f, 0.60f );
@@ -191,7 +194,7 @@
table.addCell( getTextCell( indicator.getDescription(), TEXT ) );
table.addCell( getItalicCell( i18n.getString( "annualized" ), 1, ITALIC ) );
- table.addCell( getTextCell( getBoolean().get( indicator.getAnnualized() ), TEXT ) );
+ table.addCell( getTextCell( i18n.getString( getBoolean().get( indicator.getAnnualized() ) ), TEXT ) );
table.addCell( getItalicCell( i18n.getString( "indicator_type" ), 1, ITALIC ) );
table.addCell( getTextCell( indicator.getIndicatorType().getName(), TEXT ) );
@@ -225,8 +228,9 @@
public void writeAllOrganisationUnits( OutputStream outputStream, I18n i18n )
{
+ initFont();
Document document = PDFUtils.openDocument( outputStream );
- initFont();
+
for ( OrganisationUnit unit : organisationUnitService.getAllOrganisationUnits() )
{
PdfPTable table = getPdfPTable( true, 0.40f, 0.60f );
@@ -248,7 +252,7 @@
table.addCell( getTextCell( unit.getClosedDate() != null ? unit.getClosedDate().toString() : "" ) );
table.addCell( getItalicCell( i18n.getString( "active" ), 1, ITALIC ) );
- table.addCell( getTextCell( getBoolean().get( unit.isActive() ), TEXT ) );
+ table.addCell( getTextCell( i18n.getString( getBoolean().get( unit.isActive() ) ), TEXT ) );
table.addCell( getItalicCell( i18n.getString( "comment" ), 1, ITALIC ) );
table.addCell( getTextCell( unit.getComment(), TEXT ) );
@@ -264,8 +268,9 @@
public void writeDataSetCompletenessResult( Collection<DataSetCompletenessResult> results, OutputStream out,
I18n i18n, OrganisationUnit unit, DataSet dataSet )
{
+ initFont();
Document document = openDocument( out );
- initFont();
+
PdfPTable table = getPdfPTable( true, 0.501f, 0.10f, 0.10f, 0.10f, 0.10f, 0.10f );
table.setHeaderRows( 1 );
@@ -311,8 +316,9 @@
public void writeValidationResult( List<ValidationResult> results, OutputStream out, I18n i18n, I18nFormat format )
{
+ initFont();
Document document = openDocument( out );
- initFont();
+
PdfPTable table = getPdfPTable( true, 0.19f, 0.13f, 0.21f, 0.07f, 0.12f, 0.07f, 0.21f );
table.setHeaderRows( 0 );
@@ -369,26 +375,26 @@
private Map<Boolean, String> getBoolean()
{
Map<Boolean, String> map = new HashMap<Boolean, String>();
- map.put( true, "Yes" );
- map.put( false, "No" );
+ map.put( true, "yes" );
+ map.put( false, "no" );
return map;
}
private Map<String, String> getType()
{
Map<String, String> map = new HashMap<String, String>();
- map.put( DataElement.VALUE_TYPE_STRING, "Text" );
- map.put( DataElement.VALUE_TYPE_INT, "Number" );
- map.put( DataElement.VALUE_TYPE_BOOL, "Yes/No" );
+ map.put( DataElement.VALUE_TYPE_STRING, "text" );
+ map.put( DataElement.VALUE_TYPE_INT, "number" );
+ map.put( DataElement.VALUE_TYPE_BOOL, "yes_no" );
return map;
}
private Map<String, String> getAggregationOperator()
{
Map<String, String> map = new HashMap<String, String>();
- map.put( DataElement.AGGREGATION_OPERATOR_SUM, "Sum" );
- map.put( DataElement.AGGREGATION_OPERATOR_AVERAGE, "Average" );
- map.put( DataElement.AGGREGATION_OPERATOR_COUNT, "Count" );
+ map.put( DataElement.AGGREGATION_OPERATOR_SUM, "sum" );
+ map.put( DataElement.AGGREGATION_OPERATOR_AVERAGE, "average" );
+ map.put( DataElement.AGGREGATION_OPERATOR_COUNT, "count" );
return map;
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/tallysheet/DefaultTallySheetPdfService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/tallysheet/DefaultTallySheetPdfService.java 2010-06-03 08:06:09 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/tallysheet/DefaultTallySheetPdfService.java 2010-10-15 10:47:44 +0000
@@ -27,6 +27,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import static org.hisp.dhis.system.util.PDFUtils.getTrueTypeFontByDimension;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
@@ -34,10 +36,6 @@
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.system.util.PDFUtils;
-import org.hisp.dhis.tallysheet.TallySheet;
-import org.hisp.dhis.tallysheet.TallySheetPdfService;
-import org.hisp.dhis.tallysheet.TallySheetTuple;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
@@ -58,6 +56,12 @@
public class DefaultTallySheetPdfService
implements TallySheetPdfService
{
+ private static BaseFont bf;
+
+ private static Font headerFont;
+
+ private static Font tableFont;
+
// -------------------------------------------------------------------------
// Logic
// -------------------------------------------------------------------------
@@ -84,6 +88,7 @@
writeMetadata( document, tallySheet.getTallySheetName(), i18n );
document.open();
+ initFont();
writeHeader( document, tallySheet.getTallySheetName(), facilityName, i18n );
writeLines( document, tallySheet.getTallySheetTuples(), a3Format, tallySheet.getRowWidth() );
document.close();
@@ -115,18 +120,15 @@
private void writeHeader( Document document, String header, String facilityName, I18n i18n )
throws DocumentException
{
- BaseFont bf = PDFUtils.getTrueTypeFontByDimension( BaseFont.IDENTITY_H );
- Font font = new Font( bf, 12, Font.HELVETICA );
-
- document.add( new Paragraph( header, font ) );
+ document.add( new Paragraph( header, headerFont ) );
if ( i18n != null )
{
- document.add( new Paragraph( i18n.getString( "facility" ) + ": " + facilityName, font ) );
- document.add( new Paragraph( i18n.getString( "month" ) + ": ", font ) );
- document.add( new Paragraph( i18n.getString( "year" ) + ": ", font ) );
+ document.add( new Paragraph( i18n.getString( "facility" ) + ": " + facilityName, headerFont ) );
+ document.add( new Paragraph( i18n.getString( "month" ) + ": ", headerFont ) );
+ document.add( new Paragraph( i18n.getString( "year" ) + ": ", headerFont ) );
- Paragraph totalParagraph = new Paragraph( i18n.getString( "total" ) + ": ", font );
+ Paragraph totalParagraph = new Paragraph( i18n.getString( "total" ) + ": ", headerFont );
totalParagraph.setAlignment( "right" );
totalParagraph.setIndentationRight( 10 );
totalParagraph.setSpacingAfter( 2 );
@@ -137,12 +139,9 @@
private void writeLines( Document document, List<TallySheetTuple> tallySheetTuples, boolean a3Format, int rowWidth )
throws DocumentException
{
- BaseFont bf = PDFUtils.getTrueTypeFontByDimension( BaseFont.IDENTITY_H );
- Font tableFont = new Font( bf, 8, Font.HELVETICA );
-
double a4Multiplier = (PageSize.A3.getWidth() / PageSize.A4.getWidth()) * 1.1;
float[] widths = { 0.2f, 0.55f, 0.05f };
-
+
if ( !a3Format )
{
widths[0] = (float) (widths[0] * a4Multiplier);
@@ -154,7 +153,7 @@
table.setWidthPercentage( 100 );
DataElement dataElement;
-
+
for ( TallySheetTuple tallySheetTuple : tallySheetTuples )
{
dataElement = tallySheetTuple.getDataElement();
@@ -227,4 +226,12 @@
boxCell.setBorderWidthTop( (float) 0.5 );
return boxCell;
}
+
+ private void initFont()
+ {
+ bf = getTrueTypeFontByDimension( BaseFont.IDENTITY_H );
+
+ headerFont = new Font( bf, 12, Font.NORMAL );
+ tableFont = new Font( bf, 8, Font.NORMAL );
+ }
}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PDFUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PDFUtils.java 2010-07-03 19:36:21 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/PDFUtils.java 2010-10-15 10:47:44 +0000
@@ -567,7 +567,7 @@
}
catch ( Exception e )
{
- throw new RuntimeException( "Error ocurred in create a new instance of BaseFont by the given dimension" );
+ throw new RuntimeException( "Error occurred in creating a BaseFont instance by the given dimension" );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java 2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java 2010-10-15 10:47:44 +0000
@@ -42,7 +42,8 @@
import com.opensymphony.xwork2.ActionContext;
/**
- * @author Haavard Tegelsrud, Oddmund Stroemme, Joergen Froeysadal, Ruben Wangberg
+ * @author Haavard Tegelsrud, Oddmund Stroemme, Joergen Froeysadal, Ruben
+ * Wangberg
* @version $Id$
*/
public class GenerateTallySheetAction
@@ -65,7 +66,7 @@
{
this.checked = checked;
}
-
+
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
@@ -95,42 +96,53 @@
this.tallySheetPdfService = tallySheetPdfService;
}
+ // -------------------------------------------------------------------------
+ // I18n
+ // -------------------------------------------------------------------------
+
private I18n i18n;
public void setI18n( I18n i18n )
{
this.i18n = i18n;
}
-
+
// -------------------------------------------------------------------------
- // Action implementation
+ // Variables
// -------------------------------------------------------------------------
private TallySheet tallySheet;
private List<TallySheetTuple> tallySheetTuples;
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
public String execute()
throws Exception
{
tallySheet = (TallySheet) ActionContext.getContext().getSession().get( TallySheet.KEY_TALLY_SHEET );
-
- tallySheetTuples = tallySheet.getTallySheetTuples();
- for ( int i = 0; i < checked.length; i++ )
+ if ( tallySheet != null )
{
- TallySheetTuple tallySheetTuple = tallySheetTuples.get( i );
- tallySheetTuple.setChecked( checked[i] );
- tallySheetTuple.setNumberOfRows( rows[i] );
+ tallySheetTuples = tallySheet.getTallySheetTuples();
+
+ for ( int i = 0; i < checked.length; i++ )
+ {
+ TallySheetTuple tallySheetTuple = tallySheetTuples.get( i );
+ tallySheetTuple.setChecked( checked[i] );
+ tallySheetTuple.setNumberOfRows( rows[i] );
+ }
+
+ Date today = new java.util.Date();
+ DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+ String timestamp = dateFormat.format( today );
+
+ fileName = timestamp + "_" + tallySheet.getTallySheetName() + ".pdf";
+ inputStream = tallySheetPdfService.createTallySheetPdf( tallySheet, i18n );
}
- Date today = new java.util.Date();
- DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
- String timestamp = dateFormat.format( today );
-
- fileName = timestamp + "_" + tallySheet.getTallySheetName() + ".pdf";
- inputStream = tallySheetPdfService.createTallySheetPdf( tallySheet, i18n );
-
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/tallySheet.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/tallySheet.js 2009-08-21 16:44:05 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/tallySheet.js 2010-10-15 10:47:44 +0000
@@ -3,9 +3,10 @@
//----------------------------------------------------------------------------
function continueToStepTwo() {
+
if (validateData()) {
- setMessage(i18n_processing + "...");
- document.getElementById("tallySheetForm").submit();
+ setHeaderWaitMessage(i18n_processing + "...");
+ byId("tallySheetForm").submit();
}
}
@@ -14,22 +15,26 @@
// ----------------------------------------------------------------------------
function setChecked(id) {
- var value = document.getElementById("checkbox" + id).checked;
- document.getElementById("checked" + id).value = value;
+
+ var value = byId("checkbox" + id).checked;
+ byId("checked" + id).value = value;
+
if (value == true) {
- if (document.getElementById("rows" + id).value == 0) {
- document.getElementById("rows" + id).value = 1;
+ if (byId("rows" + id).value == 0) {
+ byId("rows" + id).value = 1;
}
}
}
function doRecalculate() {
- document.getElementById('recalculate').value = true;
- document.getElementById('configureTallySheetForm').submit();
+ byId('recalculate').value = true;
+ byId('configureTallySheetForm').submit();
}
function selectAll() {
+
var length = document.configureTallySheetForm.checkbox.length;
+
for (i = 0; i < length; i++) {
document.configureTallySheetForm.checkbox[i].checked = true;
document.configureTallySheetForm.checked[i].value = true;
@@ -40,7 +45,9 @@
}
function selectNone() {
+
var length = document.configureTallySheetForm.checkbox.length;
+
for (i = 0; i < length; i++) {
document.configureTallySheetForm.checkbox[i].checked = false;
document.configureTallySheetForm.checked[i].value = false;
@@ -48,9 +55,10 @@
}
function generatePdf() {
- document.getElementById('configureTallySheetForm').action = "generateTallySheetPDF.action";
- document.getElementById('configureTallySheetForm').submit();
- document.getElementById('configureTallySheetForm').action = "configureTallySheetGenerator.action";
+
+ byId('configureTallySheetForm').action = "generateTallySheetPDF.action";
+ byId('configureTallySheetForm').submit();
+ byId('configureTallySheetForm').action = "configureTallySheetGenerator.action";
}
//-----------------------------------------------------------------------------
@@ -63,27 +71,24 @@
selectedOrganisationUnitIds = ids;
}
-if (selectionTreeSelection) {
- selectionTreeSelection.setListenerFunction(setSelectedOrganisationUnitIds);
-}
-
function validateData() {
- var tallySheetName = document.getElementById("tallySheetName").value;
+
+ var tallySheetName = byId("tallySheetName").value;
if (!getListValue("selectedDataSetId")
|| getListValue("selectedDataSetId") == "null") {
- setMessage(i18n_select_data_set);
+ setHeaderDelayMessage(i18n_select_data_set);
return false;
}
if (!tallySheetName) {
- setMessage(i18n_type_tally_sheet_name);
+ setHeaderDelayMessage(i18n_type_tally_sheet_name);
return false;
}
if (selectedOrganisationUnitIds == null
|| selectedOrganisationUnitIds.length == 0) {
- setMessage(i18n_select_organisation_unit);
+ setHeaderDelayMessage(i18n_select_organisation_unit);
return false;
}
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/selectTallySheetForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/selectTallySheetForm.vm 2010-04-28 04:59:07 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/selectTallySheetForm.vm 2010-10-15 10:47:44 +0000
@@ -1,3 +1,11 @@
+<script type="text/javascript">
+
+ jQuery(document).ready( function(){
+ // Override the listener after tree loaded succesfully
+ selectionTreeSelection.setListenerFunction( setSelectedOrganisationUnitIds );
+ });
+
+</script>
<h3>$i18n.getString( "tally_sheet_generator" )</h3>
@@ -21,7 +29,7 @@
<tr>
<td><label>$i18n.getString( "tally_sheet_name" )</label></td>
- <td><input type="text" id="tallySheetName" name="tallySheetName" value="$i18n.getString( "tally_sheet" )"></td>
+ <td><input type="text" id="tallySheetName" name="tallySheetName" value="$i18n.getString( 'tally_sheet' )"></td>
</tr>
<tr>
<td><label>$i18n.getString( "use_a3_format" )</label></td>
@@ -46,13 +54,7 @@
</tr>
<tr>
<td>
- <div id="selectionTree" style="width:40em;height:30em;overflow:auto;border:1px solid #cccccc">
- <script type="text/javascript">
- selectionTreeSelection.setMultipleSelectionAllowed( false );
- selectionTree.clearSelectedOrganisationUnits();
- selectionTree.buildSelectionTree();
- </script>
- </div>
+ #organisationUnitSelectionTree( true, false, false )
</td>
</tr>
<tr>
@@ -68,5 +70,4 @@
var i18n_select_data_set = '$encoder.jsEscape( $i18n.getString( "select_data_set" ), "'")';
var i18n_select_organisation_unit = '$encoder.jsEscape( $i18n.getString( "select_organisation_unit" ), "'")';
var i18n_processing = '$encoder.jsEscape( $i18n.getString( "processing" ), "'")';
-</script>
-
+</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTallySheetForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTallySheetForm.vm 2009-10-10 14:40:09 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTallySheetForm.vm 2010-10-15 10:47:44 +0000
@@ -30,13 +30,13 @@
$tallySheetTuple.getDataElement().getName()
</td>
<td style="text-align: right">
- <input id="checkbox$velocityCount" name="checkbox" type="checkbox" #if( $tallySheetTuple.isChecked() ) checked="checked" #end onchange="setChecked($velocityCount);">
- <input type="hidden" id="checked$velocityCount" name="checked" value="$tallySheetTuple.isChecked()">
+ <input id="checkbox$velocityCount" name="checkbox" type="checkbox" #if( $tallySheetTuple.isChecked() ) checked="checked" #end onchange="setChecked($velocityCount);"/>
+ <input type="hidden" id="checked$velocityCount" name="checked" value="$tallySheetTuple.isChecked()"/>
</td>
<td style="text-align: right">
- <input type="text" size="3" style="text-align: right" id="rows$velocityCount" name="rows" value="$tallySheetTuple.getNumberOfRows()">
+ <input type="text" size="3" style="text-align: right" id="rows$velocityCount" name="rows" value="$tallySheetTuple.getNumberOfRows()"/>
</td>
</tr>
@@ -44,8 +44,8 @@
</table>
</div>
<div id="buttonrow" style="text-align: right; margin-top: 5px;">
-<input type="button" style="width:115px" value="$i18n.getString( "select_all" )" onclick="selectAll();">
-<input type="button" style="width:115px" value="$i18n.getString( "select_none" )" onclick="selectNone();">
+<input type="button" style="width:115px" value="$i18n.getString( 'select_all' )" onclick="selectAll();"/>
+<input type="button" style="width:115px" value="$i18n.getString( 'select_none' )" onclick="selectNone();"/>
</div>
</td>
<td style="vertical-align: top; text-align: right;">
@@ -53,10 +53,10 @@
$i18n.getString( "edit_tally_rows" )
</div>
Factor <input type="text" size="3" style="text-align: right; margin-top:15px;" id="factor" name="factor" value="$factor"><br>
-<input type="button" value="$i18n.getString( "calculate_tally_rows" )" style="width:130px; margin-top:15px;" onclick="doRecalculate();"><br>
-<input type="hidden" name="recalculate" id="recalculate" value="$recalculate">
-<input type="button" value="$i18n.getString( "generate_pdf" )" style="width:130px; margin-top:15px;" onclick="generatePdf();"><br>
-<input type="button" value="$i18n.getString( "back" )" style="width:130px; margin-top:15px;" onclick="window.location.href='tallySheetGenerator.action'">
+<input type="button" value="$i18n.getString( 'calculate_tally_rows' )" style="width:130px; margin-top:15px;" onclick="doRecalculate();"/><br/>
+<input type="hidden" name="recalculate" id="recalculate" value="$recalculate"/>
+<input type="button" value="$i18n.getString( 'generate_pdf' )" style="width:130px; margin-top:15px;" onclick="generatePdf();"/><br/>
+<input type="button" value="$i18n.getString( 'back' )" style="width:130px; margin-top:15px;" onclick="window.location.href='tallySheetGenerator.action'"/>
</td>
</tr>