Jexcel api

Hi all,
If any one has used jexcel api to show a drop down box in excel sheet please share the code... or any help for the same is higly appreciated.
Thanks in advance.

Hi all,
I found the solution to my problem,
For implementing <option name="x" value="0"> smiliar in html in Excel sheet
you need to do a work around , something like writing the name in the data validation list and the value in a hidden cell
and when the drop down is changed to select some name corresponding value will be selected by accessing the hidden cell.
To export data to excel sheet
using jexcel and want to show a drop down(i.e. dataValidationList), normally you will find the below code to do so -
/* Start Code */
//Create a blank obj with row and col num
Blank b = new Blank(1,1);
//Create a array list and put objs which u want as list
ArrayList arrList = new ArrayList();
arrList.add("DropDown1");
arrList.add("DropDown2");
arrList.add("DropDown3");
//Create writable cell features obj
WritableCellFeatures cellFeatures = new WritableCellFeatures();
//set the array list in writable cell features
cellFeatures.setDataValidationList(al);
//set the cell features in the blank class
b.setCellFeatures(cellFeatures);
//add this blank class to writable sheet
sheet.addCell(b);
//write to workbook
/* End Code */
The above code will just create a Data Validation List with default value as blank
to have default value as selected don't use the blank class to write to cell , use Lable instead
Below is the code for doing this -
/* Start of Code */
cellFeatures = new WritableCellFeatures();
ArrayList al = new ArrayList();
al.add("bagpuss");
al.add("clangers");
al.add("ivor the engine");
al.add("noggin the nog");
cellFeatures.setDataValidationList(al);
Label checkLabel = new Label(1,63,(String)al.get(1));
checkLabel.setCellFeatures(cellFeatures);
s1.addCell(checkLabel);
// write to workbook
/* End code */
above code will create a list(DropDown) with values "bagpuss,clangers,ivor the engine,noggin the nog"
with selected value as "clangers"

Similar Messages

  • Unable to display double values in Excel sheet using JExcel API

    Hi
    I am writing code to generate report in the form of Excel Sheet using JExcel API.
    Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
    Any kind of reply might help me lot.
    Thank U.

    If you enable the submit zero option, it still happens? This is a new feature on the display tabl
    #NumericZero Enhancements
    To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
    · Excel formatting for the cell is retained.
    · All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
    · This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
    You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
    Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
    1. (Highest) Metadata errors
    2. #No access
    3. #Invalid/Meaningless
    4. #No data\Missing

  • How to use JExcel API (excel,csv)

    Hi,
    I have my java application and I want to read an excel file (.xls) using the Jexcel API to convert a part of it into csv format or a xml format (to make after a pdf file with another java library).....
    How can I do it? I need only the first steps!!! I don't know where must I start!!
    Thanks a lot

    to read Excel files using JExcel, look at the docs API first. The code you'll need looks like the following:
    Workbook workbook = Workbook.getWorkbook(new File("D:/tmp/source.xls"));
    import jxl.Cell;
    import jxl.Sheet;
    import jxl.Workbook;
    import jxl.read.biff.BiffException;
    Sheet sheet = workbook.getSheet(3);
              int cols = sheet.getColumns();
              int rows = sheet.getRows();
              Cell cell = null;
                   for (i = 1; i < rows; i++) {
                        for (i = 1; i < rows; i++) {
                          cell = sheet.getCell(j, i);
                          //System.out.println(cell.getContents());
                   }In order to generate PDF after, you can use iText or FOP.
    iText doesn't require XML. It uses simply java objects. (http://www.lowagie.com/iText/)
    If you want to generate XML file first, so use FOP. It requires XML and XSL files to generate PDF. (http://xmlgraphics.apache.org/fop/)
    Personnaly, I used the two tools (iText and FOP). I prefer iText because it simple and can generate complex PDF.
    hth

  • Java and Excel : POI vs JExcel API?

    Hello,
    I am hesitating between using the JExcel API and the Jakarta POI API to manipulate (rather simply) excel files with java.
    Has anyone experimented both? What are the drawbacks and the advantages of both?
    Thanks a lot,
    Laetitia

    Laetitia,
    Hello! I've written a significant app (J2EE, EJB using WebLogic) utilizing first the POI api and then the jexcel API to produce MS excel output financial reports (for online content provider) . The application processed 80K plus lines of subscriber information, calculated monthly subscription delivery charges for 100+ publications, each with custom contracts and wrote the calculated data to 'reporting tables'. Basically a specialized datamart of sorts (I know little about 'true' data marting). App would then generate the ms excel spreadsheet reports, one per publisher, utilizing the excel API. The largest publisher report would be over 10Mb in size, containing some 40K rows of data, 30 columns wide.
    I utilized the POI api first because it looked to be a more substantial product with firmer support, more developers, etc. However I soon became confused on how different modules worked, received slow feedback from the development team, and found the documentation to be horribly out of date and misleading. Additionally, the larger the generated excel file became the less stable the server would be until it would crash with memory problems. I'm not saying that the memory errors were within the POI code, but after I switched to jexcel the server crashing went away (perhaps the jexcel code is more forgiving).
    I then switched to use the jexcel API and was immediately pleased. The documentation was accurate and clearer. The functionality I needed was easy to find and worked first time. When I had problems I posted my questions to the yahoo message board and was immediately helped. As an aside on the message board I'm an old internet hack with message boards and am used to stupid posts (and posters) being immediately 'flamed' and derided by those on the list 'in the know'. I was amazed by all the posts from people asking 'I just downloaded jexcel and need help' who actually got thoughtful and helpful posts, not just rude 'RTFM you @#%$$@%' replies.
    Jexcel API was written by one guy but seems to be supported by several. I'd recommend it strongly - new releases come out continually and it's easy to get answers to questions on how to use it. Plus, and this is a biggy with me, the documentation is accurate and useful.
    Email me for more.
    -wcrighton
    [email protected]

  • Installing JExcel API

    Hello Everybody,
    I've posted some messages before about using JExcel API.
    Will, Finally it worked with me, and this is how it��s done; I just thought it will be helpful to be archived
    First: Download Andy Khan��s JExcel API from (Free JExcel API) :
    http://www.andykhan.com/
    Next: extract the zipped file to the C:\ drive (or any other drive)
    e.g. C:\jexcelapi
    Now you need to set the CLASSPATH to have the Jar file
    *(Windows users)* Go to: Control Panel �� System �� Environment Variables
    If you don��t yet have a system variable called CLASSPATH, create a new one and add the following path to it (including the dot and the semicolon)
    .;C:\jexcelapi\jxl.jar
    Then set JAVA_HOME to include your JDK path :
    e.g.     C:\Program Files\Java\jdk1.5.0_01
    Assigning CLASSPATH Using CMD (Dos):
    C:\jexcelapi> set CLASSPATH=.;C:\jexcelapi\jxl.jar
    Now you are done.
    To run the Demo provided with the API
    Type the following lines in the CMD window:
    C:\jexcelapi\src>javac jxl/demo/Demo.java //compile
    C:\jexcelapi\src>java jxl.demo.Demo // run
    Jxl.demo is the package provided; you need to add it to each program you create as the first line of the code
    package jxl.demo; Regards,
    MOE

    The servlet api gets installed with any web server that you install. For example if you are installing Jeeves(Java Web Server) you will find a file called servlet.jar which contains all the servlet classes. The path is ./JavaWebServer2.0/lib/servlet.jar.
    Hope that helps.
    Regards
    Jaydeep

  • Re: [JExcel API] how to insert object into a cell

    Hi all,
    i am using JExcel API for Excel file creation. i want to
    insert object like file in particular cell how can i do it.
    i tried WritableHyperLink but it is only inserting hyper link.
    i want proper object inserted into the specific cell.
    please help me out.
    VenuG.

    I am using jxl api to generate a report. i want the insert->object->create from file excel functionality to be implemented using jxl. Help me

  • JExcel api jxl.jar problem

    hi,
    I just downloaded the Jexcel API from source forge. i added the jxl.jar file to my classpath and wrote a small program. But i am getting the following error.
    Read_Excel.java:4: package jxl does not exist
    import jxl.*;
    ^I am running my program through command promt only. and i have added the jar also to folder C:\Program Files\Java\jre1.6.0_04\lib\ext
    But still same problem.
    Please help.

    Opening a new command shell and working from there, would have worked, too, but hey, if you wanted to take the time to reboot, more power to you.

  • Reading and Writing large Excel file using JExcel API

    hi,
    I am using JExcelAPI for reading and writing excel file. My problem is when I read file with 10000 records and 95 columns (file size about 14MB), I got out of memory error and application is crashed. Can anyone tell me is there any way that I can read large file using JExcelAPI throug streams or in any other way. Jakarta POI is also showing this behaviour.
    Thanks and advance

    Sorry when out of memory error is occurred no stack trace is printed as application is crashed. But I will quote some lines taken from JProfiler where this problem is occurred:
              reader = new FileInputStream(new File(filePath));
              workbook = Workbook.getWorkbook(reader);
              *sheeet = workbook.getSheet(0);* // here out of memory error is occured
               JProfiler tree:
    jxl.Workbook.getWorkBook
          jxl.read.biff.File 
                 jxl.read.biff.CompoundFile.getStream
                       jxl.read.biff.CompoundFile.getBigBlockStream Thanks

  • Help about jexcel API!!!

    I have a code that read and write excel file. I want to format the spreadsheet the cell margin and to color the cell once my program write an excel.
    how is it?
    is there anybody that can share the code?

    I have a code that read and write excel file. I want
    to format the spreadsheet the cell margin and to
    color the cell once my program write an excel.
    how is it?
    is there anybody that can share the code?If you have the code... why dont you ask the ones who did the code or where you got the code? More chances to get the info from there than from here....

  • JExcel API : Locking a cell

    Hi all,
    Can anyone please suggest how to lock a cell so that it becomes non-editable/disabled using the WritableCellFeatures in JXL..
    Thanks in advance.

    Use CSS to style your table.
    table {
        width: 600px; /**adjust width as req'd**/
        margin: 0 auto;  /**width width, this is centered**/
        border: 1px solid #666; /**optional border**/
    th {
        background: #333;
        color: #FFF;
    td { padding: 0; }
    .bg { background: #C69 url(your_background.jpg) no-repeat; }
    HTML:
    <table>
    <tr>
    <th>Table Heading</th>
    <th>Table Heading</th>
    <th>Table Heading</th>
    </tr>
    <tr>
    <td class="bg">This cell has a background</td>
    <td>This cell has no background</td>
    <td>This cell has no background</td>
    </tr>
    </table>
    Nancy O.

  • Excel API in WD ABAP

    Hello All,
    I want to create a excel file with formatting options like color or writing some values in a particular cell inside a web dynpro application. Is there any API available like we have JExcel API for WD JAVA. I tried doing that with OLE calls but it does not create a excel from a web dynpro application ??

    Hi Nirav,
    Please use ALV ( ABAP List Viewer ) component to replicate excel like functionality. There are no API is available for excel in WDA.
    Regards
    Rohit Chowdhary

  • Hierarchy using jExcel

    Hello,
    I want to display a web dynpro tree in Excel as a Hierarchy. For that I want to use the jExcel API. I know how to regular table export. But I am not sure how to display a hierarchy inside excel.
    If anybody knows, could you please share your thoughts with me. I appreciate your help.
    Thanks,
    Sunita.

    hi Sunita
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30d56578-f7e5-2a10-5ab5-8afc55d2e0e8
    Please check this pdf
    Regards
    Ruturaj

  • Most popular api for modifying excel spreadsheets?

    I googled a bit and it seems like POI and jexcel are the most popular ? I'm interested in hearing your opinions... I've tried POI and I find it OK, but I wish I had more features like copying a row and "pasting/inserting" it into another row and copying formulas and having it modified as you "paste" it to another cell.
    edit:
    scratch jexcel off the list... it's not free :(
    Message was edited by:
    lapchern

    hi,
    POI is best
    The most popular API for manipulating Excel files is Apache POI (http://jakarta.apache.org/poi). This is an API for reading office-documents in general. For reading Excel there is the hssf subproject (http://jakarta.apache.org/poi/hssf). They also have a list of alternative projects that can be used for accessing Excel files (http://jakarta.apache.org/poi/hssf/alternatives.html)
    You can also read in the excel file through the jexcel api (http://www.andykhan.com/jexcelapi/)
    once you can read in the entire excel file into java, you can create your own Java object structure and go from there.
    some other
    http://www.download3k.com/Web-Authoring/Java-JavaScript-Editors/Download-SpreadsheetConverter-to-Java-JSP.html

  • Number Precision- JExcel

    Dear friends,
    I am using JExcel API to parse an Excel file. i would like to know how to retrieve a number value in a formula cell rounded off to its nearest integer. I don't want to use any ceiling/floor function but would like to use the functionalities provided with JExcel.
    Kindly help.
    Subhash

    lxl.NumberCell.getNumberFormat() gives you whatever format Excel was using. If that isn't the format you need, I don't see anything in JExcel that will do it.

  • Jexcel assertion error

    I have just started using the Jexcel api. an i am in trouble.
    I copied the following code from the jExcel faq on sourceforge.
    for (int i = 0 ; i < numrows ; i++)
        for (int j = 0 ; j < numcols ; j++)
          readCell = sheet.getCell(i, j);
          newCell = readCell.copyTo(i, j);
          readFormat = readCell.getCellFormat();
          newFormat = new WritableCellFormat(readFormat);
          newCell.setCellFormat(newFormat);
          newSheet.add(newCell);
      }I added the necessery code. and it compiled without a problem. but
    when i ran the program this line
    newFormat = new WritableCellFormat(readFormat);gave a assertion error.
    another problem is i was trying to change the orientation .usiong
    Orientation.setOrientation(getOrientation(int));there was no effect on the display. and I could not find any examples specific to this.
    any help is appreciated

    Hi yoster,
    I have the same problem, but I couldn't solve the problem by removing a war file like you did.
    It's nearly the same stacktrace:
    ASSERTION FAILED *****[ Could not find dynamically generated class: 'weblogic.jdbc.rmi.internal.StatementImpl_weblogic_jdbc_wrapper_Statement_oracle_jdbc_driver_T4CStatement_921_WLStub' ].
    java.lang.ClassNotFoundException: weblogic.jdbc.rmi.internal.StatementImpl_weblogic_jdbc_wrapper_Statement_oracle_jdbc_driver_T4CStatement_921_WLStub
    My database is also oracle.
    Do you have other ideas that could sold this ?
    I hope you do, because I'm stuck ... don't know where to look anymore :(
    Toni

Maybe you are looking for

  • Oracle Applications error in install

    Hello everyone, I have installed the OBI 10.3.3 version and I am trying to install the Oracle BI Applications. At the end of the installation I receive a message that an error ocurred during the copying of files (DWFilesBean). I look at C:\OracleBI\l

  • Safari displays messages in Outlook Web Access (OWA)  incorrectly

    I use Safari on my Iphone to view/process my Outlook email. It is a bit cumbersom, but works. However, just recently, it changed. Now, when I open an email, if I press "Reply" (agian this is an OWA) button, it creates a reply, but only shows the orgi

  • "3rd Party" display iPhone 5

    I recently went inside the apple store here in texas to see as to why my iPhone wouldn't charge correctly. Last year I had the same problem and someone was able to just clean the phone and tried it out and it worked fine. This time it was fairly busy

  • My iMac 2009 model won't start.

    My iMac 2009 model won't start. Was working fine the night before, tried to on it but still no response. I also tried unplugging and plugging into the main switch plus other power points several times , doesn't work either. Please assist as most of w

  • Getting songs off more than one computer

    Why can't I put songs from more than one computer on my ipod?   Windows ME     Windows 2000     Windows ME