Allowing to export all rows to Excel in Openbravo 2.23 and previous
Code snippetName: Allowing to export all rows to Excel in Openbravo 2.23 and previous
|
This is applicable for versions of Openbravo 2.23 and previous.
It is possible that you want to export to Excel all the rows and not only the ones that you are visualizing in the grid.
In order to do this it is needed to modify WAD:
Edit the file src-wad/org/openbravo/wad/javasource.javaxml
In the function printPageDataSheetXLS (the one that carries out the export to Excel) you should replace the values of the variable intRecordRange (number of rows to be shown) and initRecordNumber (first row from which we start showing) with Integer.MAX_VALUE (maximum value that admits an int, in order to show all of them) and 0 (showing since the first one). Here is the code:
String strRecordRange = Utility. getContext (this, vars, “#RecordRange", windowId);
//Replaced sentence
//int intRecordRange = (strRecordRange equals ("" )?0:Integer.parseInt(strRecordRange));
int intRecordRange = Integer. MAX_VALUE; String strInitRecord = vars. getSessionValue (tabId + "|<PARAMETER_TMP id="class">Almacen</PARAMETER_TMP>. initRecordNumber");
//Replaced sentence
//int initRecordNumber = (strInitRecord equals("" )?0:Integer.parseInt(strInitRecord));
int initRecordNumber = 0;
In this way you will be able to configure it according to your wishes.
Finally you will need to re-compile WAD (ant wad.lib) and all the windows (ant compile).
Category: Code Snippets

