Background lines in Excel - URGENT!

Hey guys,
Why is it that when I export my table from JSP to EXCEL the column and row lines in EXCEL dont appear? I only get a blank white background???
Anyone know why this would be happening?? and how I could fix it?
I am just setting the contentType to -
<%@ page contentType ="application/vnd.ms-excel" %>

I had a similar porblem....
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......
Thanks in advance...

Similar Messages

  • Can SAP ignore blank lines in Excel when uploading the planning for PCA?

    Hi,
    We have launch planning on PCA in SAP. We are uploading the planning figures from an Excel-sheet via the standard function in SAP. The problem is that sometimes we get blank lines in the Excel-doc. When we upload with blank lines we receive an error. Can I somehow get SAP to ignore blank lines?
    Best regards
    Carl-Johan

    Well you can delete the empty lines in excel using the sort functionality and try it.
    Hope it helps..
    Thanks,
    Nandita

  • Issue with exporting line to excel on Crystal Report 2013

    Hi all,
    I got the issue when exporting to Excel
    I would like to export to excel with line border in cells. But it seems there is limitation when using "line" object. If I use line, in excel file, there is nothing. Then I changed to use border cells. It's exported fine to excel, but I got another issue.
    Because data is so long, so I use "can growth" function. But if I use "can growth" function. I got issue when export to excel file like the picture I attach here.
    There are a lot of empty cells when wrapping text, how can we remove empty cells? And the line was drawn incorrectly.
    Thanks so much.

    I need a report with border cell and do not merge cell or blank row/cell after exporting to Excel. Most of them are fine (using border cell instead of line object). But I got issue when using "CanGrow" option to extend height of text object automatically.
    Below is detail.
    1. If the "CanGrow" option is false
    - In preview report, the field does not extend the height to show all data if it is over
    - Then, export to Excel by "Microsoft Excel (97-2003)"=> it shows exactly what I saw in previewing (data has been truncated automatically).
    - If export to Excel by "Microsoft Excel (97-2003) Data only" => it shows all data but the formatting of cell (border, width) is missing
    2. If the "CanGrow" option is true
    - In preview report, the field extends automatically if the field is too long but other fields still remain
    - Then, export to Excel
    I expect I can see all data with the correct border cell and do not merge cell in the preview and Excel (the cell may be wrap text or not if it is over the size but the data need to be kept instead of truncating)
    Is there any solution to meet it?
    Many thanks.

  • Email an existing excel file in background !!!urgent please ...

    Hi Gurus….
    I wrote an Abap that creates an excel file using the OLE methods for Excel.
    After that i am trying to send the file that Already I have created as an email Attachment.
    I am using FM 'SO_DOCUMENT_REPOSITORY_MANAGER' .
    The problem is that I want to schedule the work to be executed in background but I can’t do it because I can’t pass the Popup Window .
    I say again that the file already exists !!!
    Can anyone help me ???
    Please ….
    Points will be rewarded !!!!

    hi
    in background no body will see the popwindows
    u should stop the popupwindow in front end itself....
    put okcode = save...
    otherwise go to that functionmodule comment the window
    if u comment the window no problem it will process everything

  • Data refresh in background for an Excel workbook published on a SharePoint 2013 site

    Hi,
    I've created a site to publish some Excel workbooks on a SharePoint 2013 farm with Excel Services.
    I'd like to run in background the data refresh against the cube connected to Excel, so when the end user will open the workbook he already will see the updated data without any waiting times.
    How can I solve this issue, please?
    Keep attention: I don't talk about PowerPivot for SharePoint.
    Thanks

    did you try to use the
    unattended service account for authentication to external data, in order to refresh the excel data?
    Check this technet: http://technet.microsoft.com/en-us/library/hh525344.aspx
    more options over here:
    http://technet.microsoft.com/en-us/library/ff191191.aspx
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Blank line in excel using SO_NEW_DOCUMENT_ATT_SEND_API1

    Hi Experts
    I have a small issue while using the FM "SO_NEW_DOCUMENT_ATT_SEND_API1". I am sending an excel file using this function module, but in the mail, the excel has one blank row on top. My client people doesnt want it.
    Is there any method where we can control this in the program. I m filling pack list like below
    CLEAR i_pack_list-transf_bin.
      i_pack_list-head_start = 1.
      i_pack_list-head_num = 1.
      i_pack_list-body_start = 1.
      i_pack_list-body_num = i_lines.
      i_pack_list-doc_type = 'RAW'.
      APPEND i_pack_list.
      DESCRIBE TABLE i_excel LINES i_lines.
      READ TABLE i_excel  INDEX i_lines.
      i_pack_list-transf_bin = 'X'.
      i_pack_list-head_start = '1'.
      i_pack_list-head_num = '1'.
      i_pack_list-body_start = '1'.
      i_pack_list-body_num = i_lines.
      i_pack_list-doc_type = 'XLS'.
      i_pack_list-obj_name = 'Propose UWYR Results'.
      CONCATENATE 'Propose UWYR Results' sy-datum INTO i_pack_list-obj_descr SEPARATED BY space.
      i_pack_list-obj_langu = 'E'.
      i_pack_list-doc_size = i_lines * 255.
      APPEND i_pack_list.
      CLEAR i_pack_list.
    Please suggest me if there is any other alternative.
    Thanks
    Praveen

    Clear i_pack_list. and then ,
    Remove lines in BOLD.
    READ TABLE i_excel INDEX i_lines.
    i_pack_list-transf_bin = 'X'.
    i_pack_list-head_start = '1'.
    i_pack_list-head_num = '1'.
    i_pack_list-body_start = '1'.
    i_pack_list-body_num = i_lines.
    i_pack_list-doc_type = 'XLS'.
    i_pack_list-obj_name = 'Propose UWYR Results'.
    CONCATENATE 'Propose UWYR Results' sy-datum INTO i_pack_list-obj_descr SEPARATED BY space.
    i_pack_list-obj_langu = 'E'.
    i_pack_list-doc_size = i_lines * 255.
    APPEND i_pack_list.
    CLEAR i_pack_list.
    Now issue will be solved
    Edited by: Harsh Bhalla on Nov 26, 2009 4:39 PM

  • "Enter" in a multi-line text item (Urgent)

    Hello,
    I am using developer 6i.
    I have a text item on my form with the following properties:
    Height = 100
    width = 100
    Multiline = True
    Now i am assiging a value to this text item programatically.
    I want to show the data assigned to this field in the same pattern as written below:
    Name: Imran Baig
    Age: 27
    Email: misterimran@hotmail.
    Now how to show Age:27 on the next line of the text item, i am using chr(13) but its not working, is there any other way to do this???
    Please help and its also urgent!
    Thanks a lot
    Imran

    Hello,
    Use CHR(10) instead of CHR(13)
    Francois

  • How can we handle for german special characters for EXCEL -----URGENT

    HI All,
    I have report like to display data in more than one operating unit like german,us,spain.... etc
    I used the xml version like
    <?xml version="1.0" encoding="ISO-8859-1"?>
    and
    <?xml version="1.0" encoding="ISO-8859-2"?>
    In the above versions I am able to view the output well,but problem with the german/Spain letters.
    in place of germna letters .. it is displaying somethign others
    eg: 1.NYMPHENBURGER STR. 14 MÜNCHEN BAYERN 80335 Germany
    in excel report it is showing as
    NYMPHENBURGER STR. 14; MÃ?NCHEN;BAYERN;80335;GERMANY
    I registred the template with English Language and terrritory as United States..
    Result: I am able to view the ouput without any issues
    Issue: displaying other characters in place of German/Spain letters
    The report has the Customer Ship To address and Short descriptions ..
    please how can we fix this isssue.. it is very urgent for me
    Thanks,
    HTH
    Edited by: user9135824 on Nov 29, 2010 5:07 AM

    Hi All,
    Any body can provide the solution for this.
    Thanks in Advance

  • Mutiple lines in Excel sheet.

    Hi Experts,
    In my excel sheet I have 400 characters text is there for a single field.
    I tried by using FM ALSM_EXCEL_TO_INTERNAL_TABLE and TEXT_CONVERT_XLS_TO_SAP
    but the filds here is only 45, and 250 characters only.
    How to upload taht 400 characters text.

    in SAP possible text line is 132 chars, take your internal table text filed is 400 length, and truncate the each line 132 chars and append other internal table with multiple text lines.
    wa_text-text+0(132) =  Textline
    wa_text-text+132(132) =  Textline....

  • How to calculate number of lines (its very urgent)

    Hi,
    i have to display 31 lines in the ouput in the main window.If the 31 lines had the amount had to be calculated and display in the bottom of the main window as "Balance forward".
    and the subsequent page had to be generated.
    how we know the page is the last page. if this is last page i have to  calculate the total amount and balance forward amount want had to display in the footer section.
    its urgent can any one provice the logic or sample code

    The same would hold true for SAP-SCRIPTS ...basically in the code replace the WRITE statements with the corresponding WRITE_FORM.
    Example you would have a text element for ITEM_DATA displaying the values &ITAB-F1& &ITAB-Q1&
    another one for TOTAL_DATA.
        &L_DESC& &LBAL&
    and another one for command new-page....NPAGE.
    NEW-PAGE.
    so in your loop..
    loop at itab.
      lrec = lrec + 1.
      call write_form...item_data.
      lbal = lbal + itab-q1.
      if lrec = 31.
         lrec = 0.
         l_desc = 'Balance'.
         call function write_form ....total_data.
         call function write_form ...npage.
      endif.
      at last.
         l_desc = 'Total'.
         call function write_form...total_data.
      endat.
    endloop.
    endloop.

  • Local File - Downloads Data into 1 line in Excel 2007

    Hello
    When I have the option to download a spreadsheet into excel, the data is downloaded correctly.  When I have information in a table format and I have to use the local file to download into excel all of my data is exported into 1 line.
    Can anyone help?
    Thanks!
    Joe

    Hello
    Request you to please search for notes further in the Service Place. There is a note which I have found might help you. It is
    1010935.
    Hope it helps you.
    Rgds

  • Grid lines on excel sheet

    HP Officejet j4550 All-In-One does not print all of the grid lines on my excel document. I have downloaded driver and updates with no results. I am on Windows 7 32 bit. What's next???

    Hi - Do you see the gridlines in print preview?  If not, it is most likely a setting in Excel.  If the gridlines do show up in print preview, it sounds like the driver and Excel aren't getting along.  At that point, click on Page Setup and the Sheet tab and make sure that Gridlines is checked under the Print heading.
    If that doesn't take care of it, I believe there is also an OJ J4550 driver that comes with Win 7 (go into "start" (or equivalent in Win7), printers and add a printer.  You should be able to find HP and a list of HP drivers that come with Windows.  This might provide a workaround.
    Hope that helps.
    Say Thanks by clicking the Kudos thumbs up. Please mark the post that solves your problem as an Accepted Solution so other forum users can utilize the solution.
    I am an HP employee.

  • "Invisible" grid lines in Excel format

    Hello,
    We are using Oracle Reports 10_1_2 to generate a report to an excel file.
    We are doing this via rwRun. Specifying desformat=SPREADSHEET destype=file as parameters
    Everything is exactly as it should be Except we are missing the grid lines in the excel file. We can get the users to insert them manually but we'd rather they we're there automatically.
    Any ideas how to get the grid lines placed into the report?
    Thanks
    Mark

    Hello,
    There is a note about this problem on Metalink :
    Note 453166.1 Spreadsheet Output Contains White Fill Color by Default Hiding the Excel Gray Border
    Regards

  • DOWNLOAD into EXCEL -URGENT

    Hi,
    I am downloading data to excel file.
    Some fields has data like 0013, but when it goes to excel cell, it becomes 13 instead of 0013. So, while uploading, it is a problem.... That to the field has check table and it looks for only 0013 and not 13.
    If it had been numeric field, then i could have made 0013 by assignment. But it is a character field.
    This object is on variant download/upload functionlaity. So, this program can be used for any report program to know its variants. I cannot know i am getting char/numc type of parameters.
    Please suggest me whether i can handle somehow while downloading the data on to excel itself.
    Can i have some function modules which will control the cell FORMATTING capabilities.
    Regards,
    Manjunatha.T.S

    Hey MTS!!
    This might actually sound very silly at the first look.
    But if u can be sure that nothing will be done with the data in the file till the time it gets uploaded back into sap then u can probably do this.
    u can't store 0015 as 0015 in excel.
    but u can store it as OO15 (english character 'O')
    now when u retrieve the data back, retrieve it in a type n variable of the requisite length....it will then be retrieved as 0015(zero zero one five)...
    does that make a bit of sense....i know this is too weird...but i tested it works...may b it can help u too...
    u can try this sample code...
    types : begin of n_c,
    n1(4) type n,
    end of n_c.
    types : begin of t_c,
    c1(4) type c,
    end of t_c.
    data : itab type table of t_c with header line,
        ntab type table of n_c with header line.
    itab-c1 = 'oo12'.
    append itab.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = 'C:\num.txt'
       FILETYPE                        = 'ASC'
       WRITE_FIELD_SEPARATOR           = ' '
      tables
        data_tab                        = itab
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'C:\num.txt'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = ' '
      tables
        data_tab                      = ntab
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17.
    loop at ntab.
      write :/ ntab-n1.
    endloop.
    once u have this data back in ur table, then u can convert it again to character and proceed with ur logic...
    rgds,
    PJ
    Message was edited by: Priyank Jain
    Message was edited by: Priyank Jain

  • Oracle - export to excel - Urgent

    dear all :
    i am using oracle 11g ,
    and i write PLSQL code to export data from data base to excel and it run successfully ,
    but i have data must be inserted to excel cell but in diffrent lines ,
    so how i can enter to new line in the same excel cell to fill my data
       UTL_FILE.put_line (output,
                                   ' my name '
                                   || ','
                                  'first line , second line,third line '
                                   || ','
                                    9889
                                   ||   'last column '
                                  );is there is any thing help me to wrape excel sheet cell and add multiple line on it .
    thanks in advance

    i need to put v_dn_informations in excel cell and it is in loop :
    is it true in this way :
    v_dn_informations := v_parameter_code_info || ' : ' ||
                                 v_parameter_value_info || '\n'||v_dn_informationsi try it and this is the result in excel cell :
    LINE EQUIPMENT NUMBER : \nPM NODE NUMBER : \nNCOS : \nSUBGRP : \nCUSTGRP : \nLINE CLASS CODE : \nCARDCODE : \nTYPE : \nMNO : \nGND : \nIBN TYPE : \nPADGRP : \nSNPA : \nSIG : \nPM TERMINAL NUMBER : \nBNV : \nLNATTIDX : \n

Maybe you are looking for