Hi,
I would like to generate a file PDF when an user has no obligatory ownership.
However, it is possible that this file sometimes is empty. When I try a trial game for this case I have this error :
Exception in component tFileOutputPDF_1 java.lang.ArithmeticException: / by zero at importcrm.importusers_0_1.ImportUsers.tJDBCInput_4Process(ImportUsers.java:2413) at importcrm.importusers_0_1.ImportUsers.tJava_1Process(ImportUsers.java:492) at importcrm.importusers_0_1.ImportUsers.tSageCRMConnection_1Process(ImportUsers.java:430) at importcrm.importusers_0_1.ImportUsers.runJobInTOS(ImportUsers.java:10536) at importcrm.importusers_0_1.ImportUsers.main(ImportUsers.java:10439)
The job is a simple tMap which tried users with an address mail or not. Some users without adress mail are send from PDF file.
I how do not see resolving this problem??
Someone knows :
tFileOutputPDF works even if no data are inserted in this file??
I ask this question because I try with a test with the same job but I exchange the table of the first database.
I observed that when there were no data to insert in the file, the error which explained previously appeared. Else, all works perfectly.
I'm sorry but my problem isn't resolve. So, in line 2413, effectively, there is an operation arithmetic :
int numrow_tFileOutputPDF_2 = (listdata_tFileOutputPDF_2.size() / SizeColumns2_tFileOutputPDF_2);
When there is none record listdata_tFileOutput is empty, listdata_tFileOutputPDF_2.size() = 0 ==> ERROR / by zero
and SizeColumns2_tFileOutputPDF_2 is number of columns.
I try to debug this line but then, when I want to run my job by the designer, the error come back.
An idea ?
CODE :
Part of code where the "listdata_tFileOutputPDF" are filled if (rejectEN != null) {
/** * start */
currentComponent = "tFileOutputPDF_2";
// get the column quantity
SizeColumns2_tFileOutputPDF_2 = 3;
String[] row_tFileOutputPDF_2 = new String;
// add each column name to the list
listhead_tFileOutputPDF_2.add("CodeEncaiseur");
// add each column name to the list
listhead_tFileOutputPDF_2.add("LibelleEncaisseur");
// add each column name to the list
listhead_tFileOutputPDF_2.add("Prenom");
// test the pattern of each data
row_tFileOutputPDF_2 = String.valueOf(rejectEN.CodeEncaiseur);
// Add the data to the dataList
listdata_tFileOutputPDF_2.add(row_tFileOutputPDF_2);
// test the pattern of each data
row_tFileOutputPDF_2 = String.valueOf(rejectEN.LibelleEncaisseur);
// Add the data to the dataList
listdata_tFileOutputPDF_2.add(row_tFileOutputPDF_2);
// test the pattern of each data
row_tFileOutputPDF_2 = String.valueOf(rejectEN.Prenom);
Part of code where the error is
String printHeader_tFileOutputPDF_2 = "true";
String printalternaterow_tFileOutputPDF_2 = "true";
int[] colLengths_tFileOutputPDF_2 = new int;// array
float[] abscolLengths_tFileOutputPDF_2 = new float;// array
int num_tFileOutputPDF_2 = 0;// indice
int totalsize_tFileOutputPDF_2 = 0;// sum of every max column size
---> int numrow_tFileOutputPDF_2 = (listdata_tFileOutputPDF_2.size() / SizeColumns2_tFileOutputPDF_2);
Hi,
yes looks like you are right. The variable is defined and set to 0 in the begin section of javajet and, if there is now row, never updated. So this will fail in the end block. So I think the component should be changed to create an empty page if there is no data or never create the file or ... ?
I suggest to contact cahsohtoa, the creator of this module. He is very active for the community. And I'm sure he will fix this problem.
Bye
Volker
Update: I sent him a message