Excel and jsp

Hi,
I am writing into a jsp whose response content type is excel. I have a number value in one of the beans for which i am trying to display the full number and not round it off.
for example my jsp page looks something like this
<%@ page contentType="application/vnd.ms-excel" %>
<td><bean:write name="transactionResult" property="pan" /></td>
the value in pan is a large number like 215020175160527,
when the jsp page opens up in excel its rounding it off to like 2.1502E+14. I am trying to make sure that it doesn't do that. Can it be done through my jsp code or is there some setting in excel that i can change so that its a permanent change. Please help.
Thanks

There are two products I am aware of that will factilitate this: JExcel and POI. I have used the latter, and it is relatively feature-rich and compatible with M$ Excel files. You can download a copy at jakarta.apache.org.
- Saish

Similar Messages

  • Need help on conterting jsp to Excel and word

    Hello every body,
    we are developing one small web application ,in that one my jsp page displaying data in tablurform , option box with Excel and word document and sumbit button.Suppose when select Excel and click submit the table data should be displayed inside Excel sheet. If i select word and click submit data should be displayed inside word document.Could u plz help me how we have to do this..?
    u have any reference document plz forward to [email protected]
    Thanks & regards,
    Anil.

    http://poi.apache.org/
    Excel => http://poi.apache.org/hssf/index.html

  • Export to excel and csv

    I have table in a jsp and an export button. When user clicks on the export button the data in the table should be exported to either text, csv or excel depending on the option user chhoses. Can anyone help me with this? How to export to excel and csv format.

    Hi arthur_branham,
    I really liked the way you have replied. Can you pleae share the code with me at [email protected] below is my problem...
    I had data in XML.I have displayed the data in jsp. Now i need to provide a link "Export to Excel" in jsp which will invokea servlet prepare the excel report and open up directly through a servlet....
    I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
    This is my code in servlet...
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet spreadSheet = wb.createSheet("Users");
    spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
    spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
    // Creating Rows
    HSSFRow row = spreadSheet.createRow(0);
    HSSFCell cell = row.createCell((short) 1);
    cell.setCellValue("Year 2005");
    cell = row.createCell((short) 2);
    cell.setCellValue("Year 2004");
    HSSFRow row1 = spreadSheet.createRow(1);
    HSSFCellStyle cellStyle = wb.createCellStyle();
    cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
    cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
    cell = row1.createCell((short) 0);
    cell.setCellValue("Revenue ($)");
    cell = row1.createCell((short) 1);
    cell.setCellValue("25656");
    cell = row1.createCell((short) 2);
    cell.setCellValue("15457");
    FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
    ServletOutputStream out = response.getOutputStream();
    wb.write(output);
    output.flush();
    output.close();
    forward = null;
    In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......
    1)If possible help me with the above code.
    2)Or else plz sahre you code with me...
    Its urgent....
    Thanks in advance...

  • Excel Report JSP Exception

    Hello All,
    I am unsuccessfully following the "Output to Excel with Oracle9i Report" tutorial found at http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html to create a web-based JSP report that automatically opens in Excel within the browser. I created the template using Excel, saved this as a web page, opened this in Reports Builder, etc. Once I complete the report in Reports Builder and save it as a Reports JSP, I can successfully run this within Reports Builder using the "Run Web Layout" feature. The problem is when I try to run this JSP within my web-application in JDeveloper using the in-line reports server. The browser launches Excel, but then the ReportsTag.doStartTag() method throws a JspException (see below). Anyone seen this problem or been successful achieving this? I have a normal web-based JSP report that is running fine within JDeveloper using the reports in-line server. Also, the only way I could get my web/paper-based report to be generated in PDF format and Paginated HTML was to start a separate reports server and submit my report to the rwservlet of this server. Shouldn't I be able to use the in-line server in JDeveloper? Any help or ideas would be greatly appreciated. Thanks!
    Exception I'm getting from Excel Report: javax.servlet.jsp.JspExceptionjavax.servlet.jsp.JspException
    at oracle.reports.jsp.ReportTag.doStartTag(ReportTag.java:341)
    at jsp.reports._schedule._Excel._jspService(_Excel.java:58)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)

    Hi Bill
    Let me clarify your doubts. You can use in-process Reports server with report servlet as well as from the jsp engine. The difference here is really on what Reports you can actually run from Reports servlet and jsp engine.
    For running from Report servlet:
    http://xx.x.xx.xxx:9004/reports/rwservlet?reports=...
    You would be using report definition file [rdf/jsp] which have paper layout information included in definition. You can run these paper reports to pdf/html/rtf/delimited/delimitedata format.
    Runnig a reports from jsp engine:
    http://xx.x.xx.xxx:9004/reports/examples/<reports_name.jsp>?server=...+userid=...
    You would be running a report definition [jsp/xml] which have reports jsp tags as part of reports web layout information. Please note these web layout reports which you mention using reports jsp tags, are run under the jspengine using reports tag libraries. The only format you can generate here is html [or excel output].
    Reports in-process server is a concept where if user has not started a exclusive Report server, Report servlet, and also reports tag libraries, would start a default reports server to run the particular request. This way it would make things easy for the user and he would need to manage a seperate report server of it own.
    Thanks
    Rohit

  • Excel with JSP

    Hi everyone
    I relly do need some help...
    I have an Oracle Database and I need to:
    1. View my results (of any request) in an excel spreadsheet using JSP (I think this part is the easiest...)
    2. And that is my real problem: Use an excel spreadsheet to insert values in the database with JSP...
    I hope I made it clear because even for me it's really tricky...
    Thanks a lot...
    Yassi

    There is a example in Marty Hal;l's book"Core Servlets and JSP pages".
    It is static, but the same idea would work coming from a database.
    <HTML>
    <HEAD>
    <TITLE>Comparing Apples and Oranges</TITLE>
    </HEAD>
    <BODY>
    <CENTER>
    <H2>Comparing Apples and Oranges</H2>
    <%
    String format = request.getParameter("format");
    if ((format != null) && (format.equals("excel"))) {
    response.setContentType("application/vnd.ms-excel");
    %>
    <TABLE BORDER=1>
    <TR><TH></TH><TH>Apples<TH>Oranges
    <TR><TH>First Quarter<TD>2307<TD>4706
    <TR><TH>Second Quarter<TD>2982<TD>5104
    <TR><TH>Third Quarter<TD>3011<TD>5220
    <TR><TH>Fourth Quarter<TD>3055<TD>5287
    </TABLE>
    </CENTER>
    </BODY>
    </HTML>

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • Creating Charts in MS - Excel from JSP tables

    Hi,
    Is there any way of taking the values in my JSP tables and passing them into ms-excel, and creating graphs or charts based on these values??
    I don't particulaly want to use a macro ... is this the only way? or does someone know an easier and more profficent way?
    Cheers

    graphs and charts - no. There is probably no easier way.
    Putting the values in is not hard. Just set the return type to vnd/ms-excel instead of text/html. And send the HTML table only. This will read into newer versions of excel fine. If for older versions then make your table comma delimited data instead. This can be done through style sheets using XML.
    Just some ideas. Without knowing more can't really help more.

  • How to Export to Excel and Pdf

    Hi,
    I displayed the data into table using JSP page.
    I am creating two buttons as one is Export to Excel and 2nd one is Export to Pdf. If i click Export to Excel button then the table data has to Export to Excel sheet. and same to to Pdf also.
    Can you please send me the corresponding code
    It's very urgent

    Can you please send me the corresponding codereally ???
    It's very urgentindeed...
    See:
    - iText (pdf) => www.lowagie.com/iText/
    - POI HSSF (excel) => http://poi.apache.org/hssf/index.html
    hope that helps

  • I can't get a 'real' file excel using jsp

    I have a page as this:
    <%
         response.setContentType("application/vnd.ms-excel");
         response.setHeader("Content-Disposition","attachment;filename=c.xls");
    %>
    <html><head></head><body>
    i'm writing on a excel file
    </body></html>
    when the browser execute this page there are 2 options:
    open the file c.xls or save it.
    i have noticed that if i save (or i open and then save) this file on my computer i don't get a 'real' excel file.
    in fact if i open this file with notepad and look at the code i find this code:
    <html><head></head><body>
    i'm writing on a excel file
    </body></html>
    then i open the file saved on my computer and i save it again with the file-type set on Cartella di lavoro Microsoft Excel(i don't know the translation for the english/american version of Excel); now i have a 'real' file excel and if i open with notepad the code is something as a lot of strange characters.
    Why by default the file is saved as Pagina Web(the translation is Web Page)??
    And how can i get(if it is possible) that the file is saved by default as a Cartella di lavoro Microsoft Excel(a 'real' file excel)???
    thanks and sorry for my bad english

    No kidding? Really?! I'm shocked as sh*t.
    It's saving exactly, no more and no less, then you are giving it. You are writing out:
    <html><head></head><body>
    i'm writing on a excel file
    </body></html>
    So that's what you get. ....
    I think I see you're mistake. I guess that you think that by specifying this line:
    response.setHeader("Content-Disposition","attachment;filename=c.xls");
    That the server is magically going to open this file for you and attach it to the response. Well, that's not in any way shape or form how it works. Setting headers set's a header in the response that the server sends to the browser. The browser looks at it and says "oh, the content of this page is a file called "c.xls". The content of the file is the "<html> ..." stuff that you write. If you want to write an Excel file, then you should open the Excel file and write it out.
    But you should also probably not do this in a JSP page, but in a servlet for several reasons, all of which are discussed in several threads in this forum which you could undoubtedly find by searching for "download servlet".

  • Controlling the data formatting in excel using jsp.

    Hi,
    How to controlling the data formatting in excel using jsp with out using external jar files such as "jexcel" and "POI". And one more limitation is that it should be compatible with java 1.2.1

    dineshniot wrote:
    Hi - Is there any possibility to automatically display the chart for the logged datas using write to measurement file or write to data file? Please let me know as soon as possible.
    Thanks and Regards,
    Dinesh
    As an aside, "data" is already a plural.  The singular is "datum."
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • How to use servlets and JSP for my homepage?

    servlets and JSP are server-side program. If my homepage is on some web-hosting websites, can I upload the servlets and JSP to run it? if possible, where can I find such a web-hosting place?
    sraiper

    Not many hosts offer JSP or Servlet support (and some do but then stop and never give you a refund, grrrrrrr!!!!).
    Also, ones that do support it can often be more expensive. There are some free ones but all the one's I've come across have problems that made them unsuitable for my needs.
    Here is a list of hosts that support Java:
    http://www.thejspbook.com/resources/category.jsp?id=1005&name=JSP+web+hosting
    I can't comment on any from that list, however I use http://www.positive-internet.com they are a bit pricey but they have excellent support and are always happy to help with any Tomcat (the JSP/Servlet server they use)configuration issues or needs that you may have.

  • Problem with "Save as Adobe PDF format" in Excel and Word

    Hi
    When I use printing zone in Excel and make a «Save as Adobe PDF format» (menu File / Save as Adobe PDF), the first save is well done. But when I make it a second time, what's not in the printing zone is printing in the document.
    I have also problem with the «Save as Adobe PDF format» in Word. The images superposition are not well print.
    I'm using Windows 7 in french, Office 2010 french and Adobe Acrobat XI standard. All is in the latest version.
    Thanks

    The Save As PDF feature in Office2008 Call up a PDF  Creator similar to the AdobePDF Print Driver. whch OX.6 can't use.
    To create Pdf you have to use method used:
    http://indesignsecrets.com/acrobats-adobe-pdf-printer-replaced-in-snow-leopard.php
    Not before you attempt to use this method if  Rossetta is not installed. pop in your Systems DVD and install Rosetta. Then follow directions to install the Adobe Quality PDF Automator Script which will show up in the Print Menu. Click on Print > then click PDF. Then Click on Adobe quality PDF.  AS for setting up Job options and other details Supposedly your suppose to  have access. But I have no idea.
    First thing Rosetta should be installed out of the box. and Second Adobe should install this Script from their installer. So their should be no intervention from the user. it should just work. Early report when OSX.6 first came out almost no one was able to get this to work. and I see periodic reports that people still can't get it tork and they have to to resort to saving as .ps files then droping on distiller.
    Good luck.

  • Export to Excel and Save as Static File

    Hello all,
    When I export to excel from SharePoint 2013, and save the file, the data remains dynamic in that if I update the list in SharePoint it will update the data in Excel. This is great and I use it in a few places, but I also need to capture a point in time and
    save the exported Excel file as static data (i.e. Export to Excel, and Save as the Q3 Report). How can I save the file as static/remove the dynamic link so I just have the data at the time of export?
    Thanks!
    K.
    Personal Blog: http://thebitsthatbyte.com

    Hi Kelly,
    According to your description, my understanding is that you want to export to excel as a static file.
    In SharePoint, when you export list to excel, it works as a one-way sync. It can sync data from SharePoint to Excel. If you don’t want to sync the data from SharePoint, you can copy the data from the exported excel file to a new excel, then save the new
    excel file.
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Edit .app file in excel and then open it in client tool?

    Dear Gurus,
    I am very new to HFM and would like to know what practice a HFM consultant will use in editing the metadata.
    My boss recommend me to edit metadata( .app file) in excel and save it into a format that can be read and opened by client tool.
    However, I find no way to achieve this.
    How can i edit metadata in excel and then open it in HFM client tool?

    Good morning,
    I think the best way to do it it's working with macros. You can work with an Excel file and then, convert it to the .txt format by using macros. A .txt is more suitable to be later worked as .app.
    However, you can also do it by using Copy/Paste.
    1. Open the .app in a Note Pad, so you can work with .txt file.
    2. Copy the .txt data in the Excel file.
    3. Then, it's just working with Data > Text to Columns to format the file. Then, you can work in Excel.
    Then, you will have to put the Excel file in a .txt, so you will have to follow the data files requirements. You still can do this manually, but you will have to pay attention to the format (FILE_FORMAT=11.1.2, !VERSION=11.1.3609, !CUSTOM_ORDER=Custom1;Custom2;Custom3;Custom4, !APPLICATION_SETTINGS, !CURRENCIES, etc., as it is the Admin Guide). It will also depend on the HFM version you're working with, specially when working with customs.
    I received a good document about a couple of months ago that can be helpful, so if you send me an email address, I'll forward it.
    Regards,
    Lu

  • WORD, EXCEL, and POWERPOINT now crashing when saving new file

    I have Microsoft Office 2004 WORD, EXCEL, and POWERPOINT, which were working just fine for several days on 10.5.1. (all updates are current). Now, every time I try to save a new document, all 3 apps crash, with the following thing in common in the crash log:
    0xb80ec881 gettimeofday_wrapper + 37593
    This doesn't happen when opening an existing file, and saving changes to it. Note: A few days ago, I ran Disk Utility to do a permissions repair for another issue - could this have caused this issue?
    Any ideas???
    Thanks,
    Below is the complete crash log from one of the EXCEL crashes:
    Process: Microsoft Excel [144]
    Path: /Applications/Microsoft Office 2004/Microsoft Excel
    Identifier: com.microsoft.Excel
    Version: 070724 (11.3.7)
    Code Type: PPC (Translated)
    Parent Process: launchd [69]
    Date/Time: 2007-11-26 18:33:08.466 -0500
    OS Version: Mac OS X 10.5.1 (9B18)
    Report Version: 6
    Exception Type: EXC_CRASH (SIGILL)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Crashed Thread: 0
    Thread 0 Crashed:
    0 ??? 0x801a194a 0 + 2149194058
    1 translate 0xb80ec881 gettimeofday_wrapper + 37593
    Thread 1:
    0 ??? 0x800bb8e6 0 + 2148251878
    1 ??? 0x800c30dc 0 + 2148282588
    2 translate 0xb818b69a CallPPCFunctionAtAddressInt + 202826
    3 ??? 0x800ec075 0 + 2148450421
    4 ??? 0x800ebf32 0 + 2148450098
    Thread 2:
    0 translate 0xb8152b0b spinlockwrapper + 92383
    1 translate 0xb817b5d8 CallPPCFunctionAtAddressInt + 137096
    2 translate 0xb80bd6fb 0xb8000000 + 775931
    3 translate 0xb80b6b77 0xb8000000 + 748407
    4 translate 0xb80d4530 0xb8000000 + 869680
    5 translate 0xb813d2cf spinlockwrapper + 4259
    Thread 3:
    0 translate 0xb8152bc4 spinlockwrapper + 92568
    1 translate 0xb817b2ee CallPPCFunctionAtAddressInt + 136350
    2 translate 0xb80bd6fb 0xb8000000 + 775931
    3 translate 0xb80b6b77 0xb8000000 + 748407
    4 translate 0xb80d4530 0xb8000000 + 869680
    5 translate 0xb813d2cf spinlockwrapper + 4259
    Thread 4:
    0 translate 0xb8152803 spinlockwrapper + 91607
    1 translate 0xb816e76d CallPPCFunctionAtAddressInt + 84253
    2 translate 0xb80bd6fb 0xb8000000 + 775931
    3 translate 0xb80b6b77 0xb8000000 + 748407
    4 translate 0xb80d4530 0xb8000000 + 869680
    5 translate 0xb813c9e9 spinlockwrapper + 1981
    Thread 5:
    0 translate 0xb815298f spinlockwrapper + 92003
    1 translate 0xb8183603 CallPPCFunctionAtAddressInt + 169907
    2 translate 0xb8186194 CallPPCFunctionAtAddressInt + 181060
    3 translate 0xb80df67b 0xb8000000 + 915067
    Thread 6:
    0 translate 0xb815298f spinlockwrapper + 92003
    1 translate 0xb8183603 CallPPCFunctionAtAddressInt + 169907
    2 translate 0xb8186194 CallPPCFunctionAtAddressInt + 181060
    3 translate 0xb80df67b 0xb8000000 + 915067
    Thread 0 crashed with X86 Thread State (32-bit):
    eax: 0x00000000 ebx: 0xb813cb3c ecx: 0xb7fffa6c edx: 0x801a194a
    edi: 0xb81d8794 esi: 0x00000004 ebp: 0xb7fffa98 esp: 0xb7fffa6c
    ss: 0x0000001f efl: 0x00000246 eip: 0x801a194a cs: 0x00000007
    ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
    cr2: 0xb8135118
    Binary Images:
    0xb8000000 - 0xb81d7fe7 translate ??? (???) /usr/libexec/oah/translate
    Translated Code Information:
    NO CRASH REPORT

    I just fixed my own issue, based on a posting I saw in one of the other discussions. I did the same thing, by downloading the standalone update and then installing. After the required restart, everything worked fine!!! It seems like there was definitely a problem with the version that was installed via Software Update.

Maybe you are looking for

  • Error while Updating "Failure configuring Windows updates - Reverting changes"

    I've recently formatted my HP ENVY 15t-3200 CTO Notebook PC. When I'm updating the PC the Error of "Failure configuring Windows updates - Reverting changes - Do not turn off your computer" triggers on screen when the PC restarts after installing the

  • Error in import of tables splitted with SQL splitter of note 1043380

    I'm doing an import on AIX for a Sap system, while the source system was on Windows and during the export I splitted some table using the splitter of note 1043380. THe export went fine, and I see from the .TOC files into the export directory a huge n

  • Help please - Cursor not working whilst browsing internet

    Hi Not long had my Curve 8520 and afraid I'm a bit of a techno dinosaur so please bear with me ! Wonder if someone can help with this. Whilst browsing the internet my "cursor" has suddenly stopped working. My "cursor" - the little black arrow - is st

  • Weblogic 6.0 SP1 default server starting problem

    Hi After I successfully installed WLS6.0SP1 on solaris, I was trying to run the default server as mentioned in your post-installation tasks. I am getting the following error: <Apr 11, 2001 12:11:33 PM PDT> <Error> <HTTP> <[Default WebApp] failure ext

  • Third-party Geocoding Program

    Dear All, I am looking for a Third-party Geocoding Program to integrate our TM 8.0 system. Do you have any suggestion for that? Regards, Mehmet YILMAZ