Java Recursively sum up the Excel column values

I have a requirement to perform some calculations using java taking inputs from Excel file.
My Excel file content is as follows:
Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
Row[1] ECIN - INPUT VALUE (ADD)     | NetTradeAllowanceAmount = -600.00
Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
Row[3] ECIN - INPUT VALUE (ADD)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[6] ECIN - INPUT VALUE (ADD)
Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[11] ECIN - INPUT VALUE (SUB) | ManufacturerRebateAmount = 250.00
Row[12] ECIN - INPUT VALUE (SUB) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[13] ECIN - INPUT VALUE (SUB)     
Row[14]
Row[15] ECOUT EXPECTED VALUE     900.00
Row[16] ECOUT ACTUAL VALUE     900.00
Row[17] RESULTS     PASS
To perform one calculation there can be any no.of rows but columns are fixed i.e., column(0) & column(1). My calculation logic in java is as follows:
import java.io.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
public class ReadXlsxXls
public static void main(String[] args) throws Exception, FileNotFoundException, IOException
          try
     Workbook workbook = WorkbookFactory.create(new FileInputStream("C:/Users/Pradeep.HALCYONTEKDC/Desktop/Excel.xlsx"));
     Sheet sheet = workbook.getSheet("ROLLUPS - Results");
     double summ = 0;
     double sub = 0;
     double result=0;
     for (int i = 0; i < sheet.getLastRowNum(); i++)
          Row row = sheet.getRow(i);
     Cell cell1 = row.getCell(0);
     Cell cell2 = row.getCell(1);
     if (cell1 != null && cell2 != null)
     String cellValue1 = cell1.getStringCellValue();
     String cellValue2 = cell2.getStringCellValue();
     if(cellValue2.contains("="))
     String stringNumber = cellValue2.split("=")[1].trim();
     if (cellValue1.contains("ADD"))
     if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
     //System.out.println("Path Does Not Exist");
     else
     //System.out.println(cellValue1 + "/" + stringNumber);
     summ = getSumm(summ, stringNumber);
     else if (cellValue1.contains("SUB"))
     if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
     //System.out.println("Path Does Not Exist");
     else
     //System.out.println(cellValue1 + "/" + stringNumber);
     sub = getSubstraction(sub, stringNumber);
     /* else
     System.out.println("Smt wrong");
     System.out.println("ADD = " + summ);
     System.out.println("SUB = " + sub);
     result=summ-sub;
     System.out.println("RESULT = " result"0");
     catch(NullPointerException e)
          e.printStackTrace();
     catch(Exception e)
          e.printStackTrace();
     private static double getSubstraction(double main, String your)
     if (your.contains("-"))
     return main + Double.parseDouble(your.replace("-", ""));
     else if (your.contains("+"))
     return main - Double.parseDouble(your.replace("+", ""));
     else
     return main - Double.parseDouble(your);
     private static double getSumm(double main, String your)
     if (your.contains("-"))
     return main - Double.parseDouble(your.replace("-", ""));
     else if (your.contains("+"))
     return main + Double.parseDouble(your.replace("+", ""));
     else
     return main + Double.parseDouble(your);
Up to here fine. If there exists any more data in the rows after the row having cell value RESULTS like below, my program should perform the same logic repeatedly until it finds empty row. i.e., if program find empty row after RESULTS row stop the loop, else continue the loop to perform the no.of individual calculations.
column(o) column(1)
Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
Row[1] ECIN - INPUT VALUE (ADD) | NetTradeAllowanceAmount = -600.00
Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
Row[3] ECIN - INPUT VALUE (ADD) | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[6] ECIN - INPUT VALUE (ADD)
Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[11] ECIN - INPUT VALUE (SUB)     | ManufacturerRebateAmount = 250.00
Row[12] ECIN - INPUT VALUE (SUB)     | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[13] ECIN - INPUT VALUE (SUB)     
Row[14]
Row[15] ECOUT EXPECTED VALUE     | 900.00
Row[16] ECOUT ACTUAL VALUE     | 900.00
Row[17] RESULTS     | PASS
Row[18]
Row[19] ECOUT - EXPECTED VALUE     | Amount = 1100.00
Row[20] ECIN - INPUT VALUE (ADD)     | TradeAllowance = -300.00
Row[21] ECIN - INPUT VALUE (ADD)     | Cash = 400.00
Row[22] ECIN - INPUT VALUE (ADD)     | PaymentAmount = PATH DOES NOT EXIST
Row[23] ECIN - INPUT VALUE (ADD)     | RebateAmount = 950.00
Row[24] ECIN - INPUT VALUE (ADD)     | DownPaymentAmount = PATH DOES NOT EXIST
Row[25] ECIN - INPUT VALUE (ADD)
Row[26] ECIN - INPUT VALUE (SUB)     | Total = 900.00
Row[27] ECIN - INPUT VALUE (SUB)     | NetAllowanceAmount = -600.00
Row[28] ECIN - INPUT VALUE (SUB)     | CashPayment = 100.00
Row[29] ECIN - INPUT VALUE (SUB)     | OtherAmount = PATH DOES NOT EXIST
Row[30] ECIN - INPUT VALUE (SUB)     | RebateAmount = 250.00
Row[31] ECIN - INPUT VALUE (SUB) |      DownPaymentAmount = PATH DOES NOT EXIST
Row[32] ECIN - INPUT VALUE (SUB)     
Row[33]
Row[34] ECOUT EXPECTED VALUE     | 440.00
Row[35] ECOUT ACTUAL VALUE     | 320.00
Row[36] RESULTS     | FAIL
Row[37]
Row[38] ECOUT - EXPECTED VALUE     | Bell = 200.00
Row[39] ECIN - INPUT VALUE (ADD)     | Charges = -700.00
Row[40] ECIN - INPUT VALUE (ADD)     | Expenses = PATH DOES NOT EXIST
Row[41] ECIN - INPUT VALUE (ADD)
Row[42] ECIN - INPUT VALUE (SUB)     | Cosmetics = 300.00
Row[43] ECIN - INPUT VALUE (SUB)     | Allowances = -100.00
Row[44] ECIN - INPUT VALUE (SUB)     | CashPayment = 500.00
Row[45] ECIN - INPUT VALUE (SUB)     
Row[46]
Row[47] ECOUT EXPECTED VALUE     | 640.00
Row[48] ECOUT ACTUAL VALUE     | 720.00
Row[49] RESULTS     | FAIL
I could able to write the logic for one calculation, but I don't have any idea to use the same logic to perform no.of times for no.of calculations if there exists any more rows after the row RESULTS.Please help me in this case.
If my requirement is not clear, please let me know. Thank you.
Edited by: 1002444 on Apr 25, 2013 11:20 PM

I have a requirement to perform some calculations using java taking inputs from Excel file.
My Excel file content is as follows:
Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
Row[1] ECIN - INPUT VALUE (ADD)     | NetTradeAllowanceAmount = -600.00
Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
Row[3] ECIN - INPUT VALUE (ADD)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[6] ECIN - INPUT VALUE (ADD)
Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[11] ECIN - INPUT VALUE (SUB) | ManufacturerRebateAmount = 250.00
Row[12] ECIN - INPUT VALUE (SUB) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[13] ECIN - INPUT VALUE (SUB)     
Row[14]
Row[15] ECOUT EXPECTED VALUE     900.00
Row[16] ECOUT ACTUAL VALUE     900.00
Row[17] RESULTS     PASS
To perform one calculation there can be any no.of rows but columns are fixed i.e., column(0) & column(1). My calculation logic in java is as follows:
import java.io.*;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
public class ReadXlsxXls
public static void main(String[] args) throws Exception, FileNotFoundException, IOException
          try
     Workbook workbook = WorkbookFactory.create(new FileInputStream("C:/Users/Pradeep.HALCYONTEKDC/Desktop/Excel.xlsx"));
     Sheet sheet = workbook.getSheet("ROLLUPS - Results");
     double summ = 0;
     double sub = 0;
     double result=0;
     for (int i = 0; i < sheet.getLastRowNum(); i++)
          Row row = sheet.getRow(i);
     Cell cell1 = row.getCell(0);
     Cell cell2 = row.getCell(1);
     if (cell1 != null && cell2 != null)
     String cellValue1 = cell1.getStringCellValue();
     String cellValue2 = cell2.getStringCellValue();
     if(cellValue2.contains("="))
     String stringNumber = cellValue2.split("=")[1].trim();
     if (cellValue1.contains("ADD"))
     if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
     //System.out.println("Path Does Not Exist");
     else
     //System.out.println(cellValue1 + "/" + stringNumber);
     summ = getSumm(summ, stringNumber);
     else if (cellValue1.contains("SUB"))
     if (cellValue2.split("=")[1].trim().contains("PATH DOES NOT EXIST"))
     //System.out.println("Path Does Not Exist");
     else
     //System.out.println(cellValue1 + "/" + stringNumber);
     sub = getSubstraction(sub, stringNumber);
     /* else
     System.out.println("Smt wrong");
     System.out.println("ADD = " + summ);
     System.out.println("SUB = " + sub);
     result=summ-sub;
     System.out.println("RESULT = " result"0");
     catch(NullPointerException e)
          e.printStackTrace();
     catch(Exception e)
          e.printStackTrace();
     private static double getSubstraction(double main, String your)
     if (your.contains("-"))
     return main + Double.parseDouble(your.replace("-", ""));
     else if (your.contains("+"))
     return main - Double.parseDouble(your.replace("+", ""));
     else
     return main - Double.parseDouble(your);
     private static double getSumm(double main, String your)
     if (your.contains("-"))
     return main - Double.parseDouble(your.replace("-", ""));
     else if (your.contains("+"))
     return main + Double.parseDouble(your.replace("+", ""));
     else
     return main + Double.parseDouble(your);
Up to here fine. If there exists any more data in the rows after the row having cell value RESULTS like below, my program should perform the same logic repeatedly until it finds empty row. i.e., if program find empty row after RESULTS row stop the loop, else continue the loop to perform the no.of individual calculations.
column(o) column(1)
Row[0] ECOUT - EXPECTED VALUE | TotalDownPaymentAmount = 900.00
Row[1] ECIN - INPUT VALUE (ADD) | NetTradeAllowanceAmount = -600.00
Row[2] ECIN - INPUT VALUE (ADD) | CashDownPayment = 100.00
Row[3] ECIN - INPUT VALUE (ADD) | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[4] ECIN - INPUT VALUE (ADD) | ManufacturerRebateAmount = 250.00
Row[5] ECIN - INPUT VALUE (ADD) | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[6] ECIN - INPUT VALUE (ADD)
Row[7] ECIN - INPUT VALUE (SUB) | TotalDownPaymentAmount = 900.00
Row[8] ECIN - INPUT VALUE (SUB) | NetTradeAllowanceAmount = -600.00
Row[9] ECIN - INPUT VALUE (SUB) | CashDownPayment = 100.00
Row[10] ECIN - INPUT VALUE (SUB)     | OtherDownPaymentAmount = PATH DOES NOT EXIST
Row[11] ECIN - INPUT VALUE (SUB)     | ManufacturerRebateAmount = 250.00
Row[12] ECIN - INPUT VALUE (SUB)     | DeferredDownPaymentAmount = PATH DOES NOT EXIST
Row[13] ECIN - INPUT VALUE (SUB)     
Row[14]
Row[15] ECOUT EXPECTED VALUE     | 900.00
Row[16] ECOUT ACTUAL VALUE     | 900.00
Row[17] RESULTS     | PASS
Row[18]
Row[19] ECOUT - EXPECTED VALUE     | Amount = 1100.00
Row[20] ECIN - INPUT VALUE (ADD)     | TradeAllowance = -300.00
Row[21] ECIN - INPUT VALUE (ADD)     | Cash = 400.00
Row[22] ECIN - INPUT VALUE (ADD)     | PaymentAmount = PATH DOES NOT EXIST
Row[23] ECIN - INPUT VALUE (ADD)     | RebateAmount = 950.00
Row[24] ECIN - INPUT VALUE (ADD)     | DownPaymentAmount = PATH DOES NOT EXIST
Row[25] ECIN - INPUT VALUE (ADD)
Row[26] ECIN - INPUT VALUE (SUB)     | Total = 900.00
Row[27] ECIN - INPUT VALUE (SUB)     | NetAllowanceAmount = -600.00
Row[28] ECIN - INPUT VALUE (SUB)     | CashPayment = 100.00
Row[29] ECIN - INPUT VALUE (SUB)     | OtherAmount = PATH DOES NOT EXIST
Row[30] ECIN - INPUT VALUE (SUB)     | RebateAmount = 250.00
Row[31] ECIN - INPUT VALUE (SUB) |      DownPaymentAmount = PATH DOES NOT EXIST
Row[32] ECIN - INPUT VALUE (SUB)     
Row[33]
Row[34] ECOUT EXPECTED VALUE     | 440.00
Row[35] ECOUT ACTUAL VALUE     | 320.00
Row[36] RESULTS     | FAIL
Row[37]
Row[38] ECOUT - EXPECTED VALUE     | Bell = 200.00
Row[39] ECIN - INPUT VALUE (ADD)     | Charges = -700.00
Row[40] ECIN - INPUT VALUE (ADD)     | Expenses = PATH DOES NOT EXIST
Row[41] ECIN - INPUT VALUE (ADD)
Row[42] ECIN - INPUT VALUE (SUB)     | Cosmetics = 300.00
Row[43] ECIN - INPUT VALUE (SUB)     | Allowances = -100.00
Row[44] ECIN - INPUT VALUE (SUB)     | CashPayment = 500.00
Row[45] ECIN - INPUT VALUE (SUB)     
Row[46]
Row[47] ECOUT EXPECTED VALUE     | 640.00
Row[48] ECOUT ACTUAL VALUE     | 720.00
Row[49] RESULTS     | FAIL
I could able to write the logic for one calculation, but I don't have any idea to use the same logic to perform no.of times for no.of calculations if there exists any more rows after the row RESULTS.Please help me in this case.
If my requirement is not clear, please let me know. Thank you.
Edited by: 1002444 on Apr 25, 2013 11:20 PM

Similar Messages

  • How to Rename the "All Column Values" in Propmt for 11 G.

    Hello,
    i have one Requirement where i have to change the "All Column values" label to custom label.
    I know how to do in 10 g but as here in 11g the oracle directory structure is changed.
    if anyone have idea how to do this?
    Thanking you..

    Hi Veer,
    I think "kmsgPromptRunTimeDropdownAllChoices" is the identifier which will pick up this value from a messages file. Request you to search for this string in Oracle_BI1\bifoundation\web folder's files if you can get one.
    Hope this helps.
    Thank you,
    Dhar

  • Get every 10 sec a int.value and need to take the sum of the last 18 values

    Hi,
    i get every 10 sec a int.value and need to take the sum of the last 18 values (3 minutes).
    the programm should work permanently.
    I tried with a 1d-array but didn´t get a result. Could anyone help me?
    Best regards
    kasche

    Use the example in the posted link, then add another shift register for your sum of all elements. Dont add all the elements every time, add them to a running total when they come in. You will need to evaluate how big this number is going to get, however, and decide if you should use an I64 for your running total of all elements. Even this will overflow eventually. 
    So your code would look like that posted by GerdW in the above link, then add a shift register with a starting value of 0. Then add your input value to the value comming from this shift register and send the output to the shift register's output terminal. This creates your running total of all values. The code by GerdW provides your "last 18 elements" total in a very efficient manner, just change the 15 to an 18.
    I have attached a sample bit of code to make it clear. I saved it in LV 8.0 so more people can open it.
    CyberTazer
    Software Systems Engineer
    Attachments:
    Running 18 total.vi ‏11 KB

  • How to fetch the Alias column values based on different column values?

    Hello Gurus,
    I have a table with the following struture -
    "drop table T;
    create table T(Name, Symbol, Amount,dep) as select
    'Anderia', 'AA', 1050000,'HR' from dual union all select
    'Michael', 'ML',150000,'Sales' from DUAL union all select
    'Bill', 'BL', 1050000,'Finance' from dual union all select
    'Nancy', 'NY', 4000,'HR' from DUAL union all select
    'Anderia', 'AA',3000,'HR' from dual union all select
    'Michael', 'ML',1050000,'Sales' from DUAL union all select
    'Bill', 'BL', 1200000,'Finance' from DUAL union all select
    'Anderia', 'AA', 1200000,'HR' from DUAL union all select
    'Vish', 'VH', 1200000,'Marketing' from DUAL;"Ans try to find out the values of the column like
    Name,symbol,dep,Amount,%Total,$Cumm Total, Rank but some additional columns like -
    HR Amount, %HRTotal,$HR Cumm Total,
    Finance Amount, %FinanceTotal,$Finance Cumm Total
    Sales Amount, %SalesTotal,$Sales Cumm Total,
    Marketing Amount, %MarketingTotal,$Marketing Cumm Total
    then i am using the following query to fetch the Name,symbol,dep,Amount,%Total,$Cumm Total, Rank columns -
    select name
         , decode(grouping(symbol), 0, symbol, 'Total') symbol
         , dep
         , sum(amount) amount
         , sum(per_total) "% Total"
         , decode(grouping(symbol), 0, max(Cum_per_total), null) "% Cumm Total"
         , decode(grouping(symbol), 0, max(rank), null) rank
      from (
              select name
                   , symbol
                , dep
                   , amount
                   , per_total
                   , sum(per_total) over(order by rk) cum_per_total
                   , rank
                   , rk
                from (    
                        select name
                             , symbol
                    , dep
                             , sum(amount) amount
                             , round((sum(amount)/max(total_amount)) * 100,2) per_total
                             , dense_rank () over (order by sum(amount) desc) as rank
                             , row_number() over(order by sum(amount) desc) as rk
                          from (
                                 select name
                                      , symbol
                                      , amount
                          , dep
                                      , sum(amount) over() total_amount
                                      , sum(amount) over ()
                                   from t
                         group
                            by name, symbol, dep
      group        
         by grouping sets((name, symbol, dep), ())
      order by rank, max(rk) nulls lastBut i want to fetch the following columns as well.......how can i do it?-
    HR Amount, %HRTotal,$HR Cumm Total,
    Finance Amount, %FinanceTotal,$Finance Cumm Total
    Sales Amount, %SalesTotal,$Sales Cumm Total,
    Marketing Amount, %MarketingTotal,$Marketing Cumm Total
    as i want all of the records, then going to specific to the dep.....do i need to use the case here?
    Thanks for all of your time and effort in advance

    Hello Frank Kulash/Łukasz Mastaler,
    Thanks for your time and effort.
    I am using the Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    I am looking forward to have some additional columns (column alias) along with the the returned by the mentioned query - which are named as -
    1- HR Amount
    2- %HRTotal
    3- %HR Cumm Total
    4- Finance Amount
    5- %FinanceTotal
    6- %Finance Cumm Total
    7- Sales Amount
    8- %SalesTotal
    9- %Sales Cumm Total
    10 -Marketing Amount
    11- %MarketingTotal
    12- %Marketing Cumm Total
    based on the logic like -
    HR Amount = sum of amount case dep ='HR'
    %HR Total = % of amount case dep ='HR'
    %HR Cumm Total (cumulative % based on the cumulative total of %HR Total) = Cumm % of amount case dep ='HR'
    similarly rest of the column........
    Now how do i use case with a logic so that it returns me the columns as i want them ...using the above mentioned query .......
    Kindly help me .....thanks in advance for all of your time

  • Possible to set the Created_by column value for File Browse?

    I'm using database account authentication and then a user gets to upload a file. Then my stored procedure reads the file. I was investigating a problem, happened to search the apex_workspace_files view and noticed the created_by column is always set to APEX_PUBLIC_USER for the files my users upload. Is there some way I can set that value when they log in, so I can track who actually did the upload?
    Thanks,
    Stew

    Dimitri,
    I was just using the standard File Browse item, so getting the blob from the workspace view. Though I've seen notes here about loading to your own table, what I had seemed to work (and was done) fairly well. There were just these little features I wanted to use...
    Thanks for the suggestion.
    Dave, I'm not sure which stored procedure you're suggesting I add the apex_custom_auth.get_username value to? I hoped that the internal File Browse routine would pick up the get_username value automatically instead of the application definition Public User value.
    Thanks,
    Stew

  • Java Error while executing the excel template in the BIP 10g report server

    Hello Gurus,
    While we are executing the excel template we are getting the following java error and the report cannot be rendered to user who triggers the report. Where as the same excel template is generating output when user run it against the same data locally.
    "oracle.apps.xdo.servlet.scheduler.ProcessingException: [ID:652] Document file to deliver not found : C:\Oracle\bipublisher\oc4j_bi\j2ee\home\applications\xmlpserver\xmlpserver\xdo\tmp\xmlp3307tmp
    at oracle.apps.xdo.servlet.scheduler.XDOJob.deliver(XDOJob.java:1172)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:495)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)"
    We have tried with designing the .rtf template for this report and we are able to generate the report form the server. Please let us know the cause for this error in the server and way to rectify the exception from the report server.
    Thanks,
    Kamath.

    "oracle.apps.xdo.servlet.scheduler.ProcessingException: [ID:652] Document file to deliver not found : C:\Oracle\bipublisher\oc4j_bi\j2ee\home\applications\xmlpserver\xmlpserver\xdo\tmp\xmlp3307tmp
    imho it's about empty result file
    Data are there
    may be yes but is some data from all for report itself ?
    in other words data can be in output ( in xml ) but report can filters data and so report doesn't have appropriate data to representation ( it's assumption for error )
    Data are there, when we are using rtf template, it is generating the output.
    if you sure about data for report and on this data report works fine by bip desktop, so no ideas, only SR
    btw you can first check my assumption and try to catch "no data found" in template
    also you can check data itself, is it well-formed xml

  • Changing a datagrid column image according to the datagrid column value

    Flash Builder 4.5 / SDK 4.5.1.
    Fairly new to Flash Builder & Flex
    Application targets tablets so it's a "mobile" project.
    Been beating my head up against the wall on trying to figure out how to do this. Watched videos on Lynda.com.  Read Adobe "docs" till my eyes glaze over.  Takes me about 2 lines of code in my corresponding .NET project doing the same thing.....
    Tried numerous examples.  Inline rendering, external rendering files per the examples.
    I have a response field in the database and corresponding column in the s:datagrid.  If the "reportInfoResponse" field is null (not answered), show an image with a question mark.  If yes show an image with "Yes" on it.  Same for a no answer.
    I get errors of:
    1120:Access of undefined property negativeAnswer.
    1120:Access of undefined property affirmativeAnswer
    1120:Access of undefined property reportInfoResponse
    1120:Access of undefined property showResponseImage
    If I put this in an external rendering file I also get an error where it can't access the datafield (reportInfoResponse).  I've tried data.reportInfoResponse, {data.reportInfoResponse}, {reportInfoResponse} and just plain reportInfoResponse the external rendering file with no luck.  I've tried single and double quotes around Y and N.  According to all the examples (not to say there aren't more!), I should be able to reference data.reportInfoResponse in the external file and things should be fine.  Of course, the examples are bare bones code and I don't have a clue if any importing of classes or other items need to take place.  I never see any references of such.  The examples also show the image embedding and changing the image by using imageID.source=...  In my code it tells me it can't find it.
    I have put (ERROR HERE...) on the lines where I'm getting the error messages.  I've eliminated a lot of database scripting and such cause that's all working. 
    Any and all suggestions would be appreciated as I'm pulling out what little hair I have left.......and that's not much at my age........  And yes, I probably could do it by just show text in the column, but that's not what the customer wants... There are other columns I need to do this for so I figure if I can get 1 done and working, the rest are a snap.  I CAN use inline or external rendering to show an image.  It's the changing it that is the catch.........
    Thanks in advance!
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    creationComplete="onCreationComplete()"
    title="{whichCategoryName} > {whichSubCatName} > Questions">
    <fx:Script>
    <![CDATA[
    import com.adobe.serializers.utility.TypeUtility;
    import flash.data.SQLConnection;
    import flash.data.SQLMode;
    import flash.data.SQLResult;
    import flash.events.StatusEvent;
    import flash.filesystem.File;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.net.navigateToURL;
    import flashx.textLayout.tlf_internal;
    import mx.collections.ArrayCollection;
    import mx.core.BitmapAsset;
    import mx.events.FlexEvent;
    import spark.events.GridEvent;
    import spark.events.IndexChangeEvent;
    ...(lots of database coding left out here)
    <s:DataGrid id="showQuestions" width="100%" height="100%"
    creationComplete="Grid_creationCompleteHandler(event)" fontFamily="_sans"
    gridClick="gridClickEvent(event);" horizontalScrollPolicy="off"
    selectionColor="#8AD8EF" selectionMode="singleRow" sortableColumns="false"
    variableRowHeight="true" verticalCenter="middle">
    <s:columns>
    <s:ArrayList>
    <s:GridColumn visible="false" dataField="id_report" headerText="id_report" resizable="true" sortable="false"></s:GridColumn>
    <s:GridColumn visible="false" dataField="id_question" headerText="id_question" resizable="true" sortable="false"></s:GridColumn>
    <s:GridColumn id="col_reponse" visible="true" dataField="reportInfoResponse" headerText="Response" resizable="true" sortable="false">
    <s:itemRenderer>
    <fx:Component>
    <s:GridItemRenderer>
    <fx:Script>
    <![CDATA[
    [Embed(source="assets/unknown.png")]
    [Bindable]
    public var unknownAnswer:Class;
    [Embed(source="assets/yes.png")]
    [Bindable]
    public var affirmativeAnswer:Class;
    [Embed(source="assets/no.png")]
    [Bindable]
    public var negativeAnswer:Class;
    (ERROR HERE - 1120:Access of undefined property reportInfoResponse)
    if(reportInfoResponse == "Y")
    (ERROR HERE - 1120:Access of undefined property showResponseImage)
    showResponseImage.source = affirmativeAnswer;
    (ERROR HERE - 1120:Access of undefined property reportInfoResponse)
    if (reportInfoResponse == "N")
    (ERROR HERE - 1120:Access of undefined property showResponseImage)
    showResponseImage.source = negativeAnswer;
    ]]>
    </fx:Script>
    <s:Image id="showResponseImage" source="{unknownAnswer}" verticalCenter="0" horizontalCenter="0"/>
    </s:GridItemRenderer>
    </fx:Component>
    </s:itemRenderer>
    </s:GridColumn>
    <s:GridColumn id="col_question" visible="true" dataField="question" headerText="Question" resizable="true" sortable="false"></s:GridColumn>
    </s:ArrayList>
    </s:columns>
    <s:AsyncListView list="{showTheseQuestions}"/>
    </s:DataGrid>
    </s:View>

    Ioan Thanks for the reply.
    Probably my previous explanation of the problem was a little incomplete. Let me give a better description.
    The situation is something like this.
    I have a requirement in which the customer wants the column header to reflect the 'keep filter value' restriction that he does dynamically in the query report.
    i.e:
    -- usually the kf column header shows 'sales volume'
    -- column header with text variable of the Calender year / month variable -- 'sales volume for 2000 oct'
    -- but when the report is run, if the user wants to go and change the filter:   calender year / month > rt clk > keep filer value > select Jan 2003.
      The kf column header still shows 'Sales Volume 2000 Oct'
    How to make the column header change to 'sales volume for Jan  2003' ?
    Any suggestions greatly appreciated.
    Thanks,

  • How to use the same column value in the casecadeing parameter in ssrs report?

    Hi frnz,
    I have a table site contains one filed SiteCode
    Now i have fields like below using the below quries 
    SThe above are the two results sets coming from the single table ,now i will use these two results /Query in my ssrs Casecade report
    1.First result set/Query will use for the first dataset and use these values in the paramet1 selection as PrimaryCodes
    2.Second result set/Query will use for the second Dataset and use these values in the parameter2 as SecondayCodes
    3.Using these two datsets and create a Casecadeing paramet in ssrs report.
    4.so using this information how can i create the Casecade report ,I have tried different ways but i didnt get the soluction
    I have done the follw but ididnt get the o/p.
    I have created two parameter and mapped to the results but while paramter selection i will able to see only the first paramet(PrimaryCodes) ,and i will not see the second paramter(SecondaryCodes) it could not show me the second paramter values in the drop
    down list.
    Note:Here i will use the Single Table to get the all the sitecodes 
    Can some one please help me out for this report.
    Thanks.

    Hi,
    Try below links for your reference:
    http://blogs.msdn.com/b/sqlforum/archive/2011/05/26/ssrs-cascading-parameter-with-optional-select-all-in-sql-reporting-services-report.aspx
    http://msdn.microsoft.com/en-us/library/dd255197.aspx
    http://blogs.msdn.com/b/psssql/archive/2010/01/29/how-to-have-a-select-all-multi-value-cascading-parameter.aspx
    sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **.

  • Can I sum only the top 10 values in a range?

    I am new to mac and numbers.  I bought my first mac this fall.  I have a grade book in Numbers.  I am only counting the top 10 out of 11 homework scores and top 10 out of 13 quiz scores.
    Essentially, I want to add the top K values out of a range of N cells.  Can I do this?
    Thanks.

    you can use the large() function like this:
    C1=AVERAGE(LARGE(B,1), LARGE(B,2), LARGE(B,3), LARGE(B,4), LARGE(B,5), LARGE(B,6), LARGE(B,7), LARGE(B,8), LARGE(B,9), LARGE(B,10))
    this is shorthand for... select cell C1, then type (or copy and paste from here) the formula:
    =AVERAGE(LARGE(B,1), LARGE(B,2), LARGE(B,3), LARGE(B,4), LARGE(B,5), LARGE(B,6), LARGE(B,7), LARGE(B,8), LARGE(B,9), LARGE(B,10))

  • Conditional Text and Image based on Excel column values

    Hi,
       I have an excel file which contains data that needs to be imported/merged in an InDesign document. I have converted that file into a CSV... I'm unable to figure out how to create document using Data Merge after evaluating some conditions on data ... Example InDesing document layout is like below and will be repeated for say 200 data rows...
    Heading 1
    Text 1, Text 2
    Text 3
    Image
    Heading 1, Text 1 and Text 2 even Image value will be set after checking some condition like below
    if ( column 'A' == ' ' && column 'B' == '1')
      Set 'Heading 1' == column X
    if ( column 'C' == '0' && file.exist(column C & '.jpg'))
       Set 'Image' == column C & '.jpg'
    Can someone please guide me how to create document when CSV and Images are given based on this scenario? and even if Data Merge is the right solution for this.
    -- Thanks.

    Data merge can only reproduce one layout, so you can't merge 200 rows and then change things unless you do it in separate documents and then combine them. Of course anything you can do via scripting or manually on a regular document you can also do to a merged document after the merge is complete.
    It sounds like this is a multiple-records-per-page scenario. TO do that you set up ONE instance only of what you want to merge, in the upper left position on the page. ID then duplicates EVERYTHING that is on the page as many times as will fit using the spacing parameters you provide. This means you need to be careful with frame sizes so they don't extend beyond where they should, but it also means you can add a no-fill, no-stroke frame as a border or bounding box to make it easier to get a precise size to be used by each record. Frames in merged documents are not threaded from record to record (though there are methods for doing that after the merge, if desired), so deleting a record normally leaves a hole in the page.
    If you have master page items, it's probably best to us the "none" master before the merge, then apply the correct master page after.
    Peter

  • Powershell script to change the a column value of all documents in a site.

    Hi,
    I need a powershell script to change the value of a column (a site column which has been added to all document libraries) in all documents in a site,
    For example: 
    -column 1 is a site column added to all libraries
    the value of column 1 of all documents under this site: http://intranet.doman/ex1 should be equal to V1
    the value of column 1 of all documents under this site: http://intranet.doman/ex2 should be equal to V2
    So, if I can write a powershell script to change the value of all documents in a site, I can modify it for different site that I have and run it for each of them individually,

    cls
    # Is dev version?
    $dev = $false
    # Configuration
    $termStore = "Managed Metadata Service"
    $group = "G1"
    $subjectMatterTermSetName = "Subject Matter"
    # Check if SharePoint Snapin is loaded
    if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
         Add-PSSnapin Microsoft.SharePoint.PowerShell
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Taxonomy") | Out-Null
    function GetTermStore($site, $termStore, $group, $termSet) {    
        $session = New-Object Microsoft.SharePoint.Taxonomy.TaxonomySession($site)
        $termStore = $session.TermStores[$termStore]
        $group = $termStore.Groups[$group]
        $termSet = $group.TermSets[$termSet]
        return $termSet
    if($dev) {
        Write-Host "Running DEV version..."
        $webUrl = "http://Site1"   
        $libraryName = "L1"
        $subjectMatter = "C1"
    } else {
        $webUrl = Read-Host "Enter Site URL" 
        $libraryName = Read-Host "Enter Document Library name"
    $subjectMatter = Read-Host "Enter Subject Matter"
    try {
        $web = Get-SPWeb $webUrl
        $site = $web.Site
        $library = $web.Lists[$libraryName]
        $items = $library.GetItems()
        $subjectMatterTermSet = GetTermStore $site $termStore $group $subjectMatterTermSetName
        $subjectMatterTerm = $subjectMatterTermSet.GetTerms($subjectMatter,$true) | select -First 1
        foreach($item in $items) {
            if([string]::IsNullOrEmpty($item["Subject Matter"])) {     
                #Write-Host "Filename: $filename / Keywords: $keywords / Subject Matter: $subjectMatter / Document Type: $documentType"        
                Write-Host "Updating $($item["ows_FileLeafRef"])..."           
                # Set Subject Matter column
                $subjectMatterField = [Microsoft.SharePoint.Taxonomy.TaxonomyField]$item.Fields["Subject Matter"]
                $subjectMatterField.SetFieldValue($item,$subjectMatterTerm)
                # Update Item
                $item.SystemUpdate()
    catch
        $ErrorMessage = $_.Exception.Message
        Write-Host "Something went wrong. Error: $ErrorMessage" -ForegroundColor Red

  • UPDATE_ROW_CONFLICT error, get the details (columns, values)

    Hi,
    I am getting the following error:
    Error :Number of conflicts while synchronizing: 1 SyncResolver.UPDATE_ROW_CONFLICT row 0 attempt to update a row that has been updated or deleted by another user
    has anybody an idea how to get more information about the conflic?
    In what column is the conflic ? The values ?
    regards,
    Andorn

    Hi,
    Please go through the tutorial titled "Performing Inserts, Updates, and Deletes" which is available at: http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    Also, go through the below forum threads:
    http://swforum.sun.com/jive/thread.jspa?threadID=95174&tstart=15
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=65088
    Hope this helps.
    RK

  • Query to grab the sum and the most recent values?

    hi,
    Just wondering if its possible to have a query on the temp table,
    which fetches school,most_recent(sub1),sum(sub2),sum(sub3) group by school
    table temp
    SCHOOL DATE1 SUB1 SUB2 SUB3
    ABC                    01-AUG-07 1 5 6
    ABC                     02-AUG-07 2 5 6
    ABC                     03-AUG-07 3 5 6
    ABC                     04-AUG-07 4 5 6
    ABC 05-AUG-07 5 5 6
    XYZ                    01-AUG-07 6 7 8
    XYZ                     02-AUG-07 7 7 8
    XYZ                     03-AUG-07 8 7 8
    XYZ                     04-AUG-07 9 7 8
    XYZ 05-AUG-07 10 7 8
    Just wondering if its possible to have a query on the temp table,
    which fetches school,most_recent(sub1),sum(sub2),sum(sub3)
    required output
    SCHOOL SUB1 SUB2 SUB3
    ABC 5 25 30
    XYZ 10 35 40
    thanks

    I think you want this:
         EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-12-1981        950                    30
          7902 FORD       ANALYST         7566 03-12-1981       3000                    20
          7934 MILLER     CLERK           7782 23-01-1982       1300                    10
          7876 ADAMS      CLERK           7788 12-01-1983       1100                    20
    4 rows selected.
    real: 63
    SQL>select * from emp order by deptno;
         EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO
          7782 CLARK      MANAGER         7839 09-06-1981       2450                    10
          7839 KING       PRESIDENT            17-11-1981       5000                    10
          7934 MILLER     CLERK           7782 23-01-1982       1300                    10
          7369 SMITH      CLERK           7902 17-12-1980        800                    20
          7876 ADAMS      CLERK           7788 12-01-1983       1100                    20
          7902 FORD       ANALYST         7566 03-12-1981       3000                    20
          7788 SCOTT      ANALYST         7566 09-12-1982       3000                    20
          7566 JONES      MANAGER         7839 02-04-1981       2975                    20
          7499 ALLEN      SALESMAN        7698 20-02-1981       1600        300         30
          7698 BLAKE      MANAGER         7839 01-05-1981       2850                    30
          7654 MARTIN     SALESMAN        7698 28-09-1981       1250       1400         30
          7900 JAMES      CLERK           7698 03-12-1981        950                    30
          7844 TURNER     SALESMAN        7698 08-09-1981       1500          0         30
          7521 WARD       SALESMAN        7698 22-02-1981       1250        500         30
    14 rows selected.
    real: 141
    SQL>select * from emp a
      2  where a.hiredate in (select max(b.hiredate)
      3                       from emp b
      4                      group by b.deptno
      5                     );
         EMPNO ENAME      JOB              MGR HIREDATE          SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-12-1981        950                    30
          7902 FORD       ANALYST         7566 03-12-1981       3000                    20
          7934 MILLER     CLERK           7782 23-01-1982       1300                    10
          7876 ADAMS      CLERK           7788 12-01-1983       1100                    20
    4 rows selected.HTH
    Ghulam

  • Passed parameter value to be checked with the retrieved column value

    select app.compositename,
    (select distinct stringvalue from WFMESSAGEATTRIBUTE where taskid = APP.taskid and name = 'approverPayload') as APPROVERPAYLOAD,
                                     from DEVT_SOAINFRA.WFTASK APP
                                   where APP.TEXTATTRIBUTE6 not like 'Product Data%'
                                   and (:P_REQUESTTYPE like '%JobCha%')
                                   and (:P_APPROVERID is null or
                                                   upper(nvl(APPROVERPAYLOAD,'-1')) like upper(:P_APPROVERID || ',%') or
                                                   upper(nvl(APPROVERPAYLOAD,'-1')) like upper('%,'||:P_APPROVERID ||',%') or
                                                   upper(nvl(APPROVERPAYLOAD,'-1')) like upper(:P_APPROVERID)
                                                                             above is my query and iam retriving approverpayload based on below select statement
                                                                             (select distinct stringvalue from WFMESSAGEATTRIBUTE where taskid = APP.taskid and name = 'approverPayload')
                                                                                                                and in the where conditions can i check the passed parameter :P_APPROVERID exists in the APPROVERPAYLOAD as i have tried below
                                                                             and (:P_APPROVERID is null or
                                                   upper(nvl(APPROVERPAYLOAD,'-1')) like upper(:P_APPROVERID || ',%') or
                                                   upper(nvl(APPROVERPAYLOAD,'-1')) like upper('%,'||:P_APPROVERID ||',%') or
                                                   upper(nvl(APPROVERPAYLOAD,'-1')) like upper(:P_APPROVERID)
                                                                                                                is my attempt correct if not can any one suggest me how to write it so.

    You cannot use the column alias in the same level in the where clause as you are doing it. It needs to be done one level higher. So it will look something like this.
    select * from
       select <column_name> <new_column_alias>
       from <table_name>
    where <new_column_alias> <operator> <condition>Regards
    Raj

  • Column link - call java script & assign current report column value to item

    Hi,
    How to call java script and assing current report column value to item?
    I have a button column in the report to 'delete' the selected row.
    I want to first show dialog box with message 'Are you sure?'. If yes, process to delete
    will be executed, else no action.
    In order to fire JS, I used Column Link ->Target=URL.
    Problem: The alert is showing but I don't know how to pass selected row's primary
    key value to process (to delete selected row).
    I have a item which can be used to store selected primary key value but don't know how to assign the value
    when button pressed.
    Thanks in advance
    Dip

    Ok. The issue has been resolved by following way.
    PAGE PROCESS: delete_request
    begin
    delete xyz
    where id = :P8_id;
    commit;
    end;BUTTON URL:
    javascript: DelRec(null,'CREATE', 'f?p=&APP_ID.:8:&SESSION.:delete_request:NO::P8_id:#id#');Java Script:
    <script language="JavaScript1.1" type="text/javascript">
    function DelRec(msg, req, url){
    var confDel = msg;
    if(confDel ==null){
    confDel= confirm("Are you sure?");
    }else{
    confDel= confirm(msg);}
    if (confDel== true){
    redirect(url);           }
    </script>

Maybe you are looking for