Log in / create account
View source | Discuss page | Page history | Printable version   
ADVERTISEMENT
Accounting eLearning Courses
Partnerships
SourceForge.net Logo
Openbravo ERP at SourceForge

SourceForge.net Logo
Openbravo POS at SourceForge

Open Solution Alliance Logo
Openbravo at Open Solutions Alliance

Allowing to export all rows to Excel in Openbravo 2.23 and previous

Code snippet

Name: Allowing to export all rows to Excel in Openbravo 2.23 and previous
Version: Openbravo 2.23
Author: Carlos Romero



Rating :
N/A
(0 votes cast)
You have to be registered to be able to vote

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).

Retrieved from "http://wiki.openbravo.com/wiki/Allowing_to_export_all_rows_to_Excel_in_Openbravo_2.23_and_previous"

This page has been accessed 1,120 times. This page was last modified 11:43, 30 July 2008. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.


Category: Code Snippets