Export JSP to Excel : Weird problem (Urgent)
Hi,
Sorry for the length of question.
I am facing a bit weired problem while exporting my JSP report to Excel.
I have multiple tables in my JSP page .( Use of Multiple tables is a requirement .).
I am using Struts and Oracle 9i JDeveloper for developement.
I have a button called "Excel" and on its click , I am opening the same JSP page in a pop up and passing reqd. parameters to it using querystring
( sometimes I am keeping the parameters into session as the length is loo large to fit into queryString. )
I am using
response.setContentType("application/vnd.ms-excel");
to transform my JSP page to Excel.
Sometimes, this works fine.
But, mant times this gives error such ( in Windows2000 Adv. Server ) as
"Memory could not be "read"."..with the tile of error-popup as "Excel.exe".
(In Windows NT , it never exports to Excel. Every time it gives "Dr. Watson Debugger" message box.)
In Windows2000 Adv. Server ,
While debugging, I observed that when I click on Excel button, the pop up opens and executes the page and again goes to the start of the page and executes again and thus tries to open the same Excel document.
As we know, we cannot open same Excel document twice. Hence it gives a popup alert that
" The file <filename with its entire path> could not be opened.
There may be several reasons :
You might be trying to open a file which does not exist.
You might be trying to open the file which is already open. ..."
etc.etc. and something like this.
Now, this is totally unpredictable. If I click Excel button, It may open the file in excel and on next try it would give error.
This is quite annoying. I searched on this forum, Google but could not find the solution yet.
I cannot use POI - HSSF . I cannot use userdefined Excel tags as well. as it will require a lot of reqork and unfortunately I don't have that much time now.
Please help me and let me know how would I be able to successfully and predictably export my JSP pages to Excel.
Thanks,
Swipsy.
Hi,
Why don�t you save as attachment? (use -> <% response.setHeader("Content-Disposition", "attachment; filename=\"name.xls\""); %> scriplet )...
I�m doing the same work, but I have problems to export images to Excel by this method...
Someone could help me??
thanks a lot
Similar Messages
-
Exporting report to excel encoding problem..
Hi All!
A have a problem about encoding. I have a report and I export it into excel file. Everything is in a way. But unicode characters is not written in correct encoding. And I use encoding type everywhere "UTF-8"
I use contentType as
<%page contentType="application/vnd.ms-excel;charset=UTF-8" pageEncoding="UTF-8"%>
and print out as
StringBuffer sb = new StringBuffer();
JspWriter writer = pageContext.getOut();
writer.print(sb);
...Please help me. I couldn't solve this problem.Hi
Actually i have been doing a lot of experimentation in this for past some days.
The various alternatives are as follows:
a> DESFORMAT=SPREADSHEET attribute in case of Oracle 10g Release 2, in this case the formatting will be maintained but the report will consist of empty cells and merged cells which is not required.
b> in case of Oracle 9i, the following link may be helpful to you http://download-west.oracle.com/docs/cd/B14099_15/bi.1012/b13895/orbr_paptoexcel.htm#CIHFDJAJ . But in this case ,also the problem of empty cellas and merged cells cannot be removed.
c> the option which i have preferred is to use the tool rep2excel which is easily downloadable from http://www.lv2000.com/. With some minor changes in the report formatting u will get the desired output. You may inclde the scripts given in the manual to include the software in your normal execution. The problem of empty cells and merged cells can also be removed.
For any further queries of how to use the tool do feel free to ask -
Excel Download problem - Urgent please
Hi All,
I am using 4.6C version.
The user is downloading the ALV output to excel from the output menu
List > Save > File > Spreadsheet >
User tried saving a file to the Local drive and got a "Disk is full" error.
User realized that the export didn't complete (Partial download)
because there wasn't enough disk space to export the report.
User stated that if he had received an error message of some sort, he might have realized the problem.
He didn't receive any kind of errors.
User would like some kind of error message to come up in those situations.
Without an error message, he assumes the reports are acurate and trusts them.
<b>I have analysied and found a exit EXIT_SAPLGRAP_001 which triggres after the popup asking the file path. However this exit doesnot give me the file path</b>.
After this i think i can make use of the class CL_GUI_FRONTEND_SERVICES and method GET_FREE_SPACE_FOR_DRIVE and FILE_GET_SIZE to check for disk space full.
Kindly let me know how to get the file path given in the popup to get it in the exit EXIT_SAPLGRAP_001. Also there was no parameter id for the field.
Thanks for your help.
SenthilSenthil,
"However in this case the sap didnot uses GUI_DOWNLOAD to download instead it uses download FM. "
What "download FM" is 4.6 using then?
The GUI_DOWNLOAD does check for a disk_full situation... I find it hard to believe that SAP made an oversight here.
I believe that the user is not telling the truth to you... or something else happened in that they have not conveyed to you. -
ADF Export Listener exporting Number to excel having problem
HI
I have a table and am trying to export the data of table into excel file(.xls)
Everything is working fine except a number having more than 15 characters. .
As excel cant display more than 15 chars as number currently it is showing the number as
1.79E+18
How to display the number in correct format . .
After looking in to Microsoft blog came to know that its a bug in excel and if we can convert the column as text then it will display in correct format . . .
But am unable to do this . .
Any Inputs from you guys . . .
Thanks
SharathIt may help to resolve the issue.
Update the af:table column which has the problem as below,
<af:column sortProperty="col1" sortable="true"
headerText="HeaderText"
id="resId1c1" width="100" displayIndex="-1">
<af:panelGroupLayout id="pgl2" layout="horizontal">
<af:outputText value='=TEXT("' id="ot11"
inlineStyle="display:none"/>
<af:outputText value="#{row.col1}" id="ot4"/>
<af:outputText value='","000000000")' id="ot12"
inlineStyle="display:none"/>
</af:panelGroupLayout>
</af:column> -
Problem on exporting images from jsp to excel
i had exported content of jsp to excel, but the problem is i couldn't able to export images present in jsp to excel.
the images are present in
webapplication / images directory.
guys if you know any way please let me know
code which i used for exporting was
<%
response.setContentType("application/vnd.ms-excel; charset=UTF-8");
response.setHeader("content-disposition","attachment; filename=test.xls");
%>Message was edited by:
mohaideenkhajaIf Somebody have the solution the please let me know......................
Thx -
Export to Excel formating problem
I am having a problem with the formatting of a an export file
to Excel, which is created by a Coldfusion page. My export file
contains numbers that need to be formatted as text. I found the
style code below on this forum, but I am not having any luck with
it. I tried adding it to my style file or directly as style
formatting on the export page, but neither one of the two are
getting recognized.
Is there anything else I need to code before this works? Your
help is greatly appreciated. Thanks,
Rose
<html>
<STYLE TYPE="text/css">
TD {
mso-number-format:\@;
</style><body>
<!---<cfheader name="Content-Disposition"
value="inline; filename=Exportdata1.xls">--->
<cfcontent type="application/vnd.msexcel">
<cfheader name="Content-Disposition" value="inline;
filename=export.xls">
<cfquery name = "getclub" datasource="#DSN#">
Select mail_name name,…
</cfquery>
<table width="200" border="2">
<cfoutput query='getclub'> <tr>
<td>#customer#</td>
<td>#dateformat(begin_date,'mm/dd/yyyy')# -
#dateformat(end_date,'mm/dd/yyyy')#</td>
</tr></cfoutput>
</table>Could it be a case sensitivity issue? I also noticed that you
are missing a <head> tag pair, and that your date range field
is not actually numeric. I doubt that excel is that delicate when
it comes to those issues, but you might try:
<html><head>
<STYLE TYPE="text/css">
TD.number {
mso-number-format:\@;
</style></head><body>
<cfcontent type="application/vnd.msexcel">
<cfheader name="Content-Disposition" value="inline;
filename=export.xls">
<cfquery name = "getclub" datasource="#DSN#">
Select mail_name name,…
</cfquery>
<table width="200" border="2">
<cfoutput query='getclub'> <tr>
<td class="number">#customer#</td>
<td>#dateformat(begin_date,'mm/dd/yyyy')# -
#dateformat(end_date,'mm/dd/yyyy')#</td>
</tr></cfoutput>
</table>
</body>
</html> -
FR Studio: HTML export to Excel formatting problem
Hey,
I am having trouble with the formatting when exporting from FR Studio to Excel.
I have a report with 2 seperate grids. In HTML and PDF format it looks very neat. But when I export it to Excel, the bottom grid changes its format and some cells have weird colours and borders appear out of nowhere and make it look very ugly. Is there a way to solve this? I have tried many different things including changing cell borders and deleting entire grid and putting in a new one.
Can anyone help me?
Thanks!
Samanthaone can never have control on formatting of exported excel.
At max what can you do is- try different different colors, which look nice in html, pdf as well as excel.
Thanks,
Rahul -
Problem while exporting data to Excel sheet.......
Hi
I have written the following code to export data to excel sheet...
data:
conv_out TYPE REF TO cl_abap_conv_out_ce,
content TYPE xstring.
data : itab_slsrl type table of znslsrlitm.
data: xml_out TYPE string.
Data:
Node_slsrl type ref to If_Wd_Context_Node,
Elem_slsrl type ref to If_Wd_Context_Element,
Stru_slsrl type ref to if_wd_context_element .
call transformation ('ID') source tab = itab_slsrl[] result xml xml_out.
CALL FUNCTION 'CRM_IC_XML_STRING2XSTRING'
EXPORTING
INSTRING = xml_out
IMPORTING
OUTXSTRING = content.
conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
DATA: lv_filename TYPE string.
conv_out->convert( exporting data = xml_out IMPORTING buffer = content ).
cl_wd_runtime_services=>attach_file_to_response(
i_filename = 'Sales_order_release.xls'
i_content = content
i_mime_type = 'application/msexcel'
i_in_new_window = i_in_new_window
i_inplace = i_inplace ).
But when i am trying to export data to excel sheet i am getting
following error...
"Switch from current encode to specified encoding is not supported"
"<?xml version="1.0" encoding='utf-16"?>"
if i change encoding utf-8 to utf-16 in my code its giving dump..
"The conversion of certain code pages is not supported"
Did i miss any step...?
How to resolve this problem please help me....
Thanks & Regards
Sowmya.....Hi Sowmya,
I do had a similar issue, but I avoided that problem temporarily by commenting the following code.
l_conv_out = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
attach the first file
l_conv_out->convert( exporting data = l_xml_out IMPORTING buffer = l_content ).
Once this is done, you can export the data to Excel and open it and see too...But this is a temporary solution only. Implement this solution to get to understand more flaws of this.
Regards
Raja Sekhar
Edited by: Raja Sekhar on Dec 26, 2007 7:51 PM -
Weird problem when downloading the output to an excel sheet
Hi to all,
when i download the list, output by an alv grid, i observe a weird problem..in the excel sheet the last digit (10th digit) of the first col. which is delivery no., is getting truncated...0001802563 is getting downloaded as 000180256..couldn't understand why...when i use conversion_exit fm, the values are not getting truncated and downloading correctly...curious to know what's gone wrong in this funcationality? thanks all
cheers,
Shankar. M.actually the problem is in the field catalog.if u can send me the code, i shall bug fix it for u.
-
Problem in exporting data to excel in nwds 7.3
Hi All,
I was using the following code for exporting data to excel in NWDS 7.3
private IWDCachedWebResource getCachedWebResource(byte[] file, String name,
WDWebResourceType type) {
IWDCachedWebResource cachedWebResource = null;
if (file != null) {
cachedWebResource = WDWebResource.getWebResource(file, type);
cachedWebResource.setResourceName(name);
return cachedWebResource;
I was getting the error in the following line cachedWebResource = WDWebResource.getWebResource(file, type); when I clicked the quick help it ststed the getWebResource method is depricated. Kindly provide some assistance on what is the new method in its place.
Thank you
Regards,
Preet KaurHi Ganesh,
Thanks that worked fine, but when we go further we are facing problem ie
byte[] excelXMLFile;
IWDCachedWebResource cachedExcelResource = null;
String fileName = dataNode.getNodeInfo().getName() + ".xls";
try {
// create Excel 2003 XML data as a byte array for the given context node,
// attributes and headers
excelXMLFile = toExcel(dataNode, columnInfos).getBytes("UTF-8");
// create a cached Web Dynpro XLS resource for the given byte array
// and filename
cachedExcelResource = getCachedWebResource(
excelXMLFile, fileName, WDWebResourceType.XLS);
// Store URL and file name of cached Excel resource in context.
if (cachedExcelResource != null) {
wdContext.currentContextElement().setExcelFileURL(
cachedExcelResource.getURL());
wdContext.currentContextElement().setExcelFileName(
cachedExcelResource.getResourceName());
// Open popup window with a link to the cached Excel file Web resource.
openExcelLinkPopup();
} else {
wdComponentAPI.getMessageManager().reportException(
"Failed to create Excel file from table!", true);
} catch (UnsupportedEncodingException e) {
wdComponentAPI.getMessageManager().reportException(
e.getLocalizedMessage(), true);
} catch (WDURLException e) {
wdComponentAPI.getMessageManager().reportException(
e.getLocalizedMessage(), true);
The above bold lines also would need to be converted to inputstream, but not sure how to correct that
We are following the below pdf for the implementation.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353?QuickLink=index&overridelayout=true
Thank you
Regards,
Jaspreet Kaur -
Problems Exporting rpts to Excel!
Post Author: miguelitobh
CA Forum: Exporting
Hello Everybody! I´m new in the forum, and i have a question that is killing me... I´ve an application that runs asp and COM+ using Visual Basic... I made another litlle module for Crystal Reports rpts imports... I wrote the code using the Business Objects Samples like example (rtpserver.asp, etc) ands works fine. The problem that i´ve found is: In the export all the options are working, except the 2 excel´s types. When a try do export a report to Excel, i put the file name and try to save, but the application hangs my IIS server... Anyone can help me? I´m using Windows XP SP2, Office 2003 and Crystal Reports XI R2...
Tahnk´sWannetta,
When the user filters the data and then exports it to excel; all of the original data is exported rather than the filtered data.
Can you describe the exact workflow in a bit more detail. Here is one "gotcha" to consider, which sounds suspicous to your case. If the user is using InfoView (not WebI), and he or she uses Export to Excel with CSV, then there is no consideration to what has been done in the report, the contents of what you see in the "Results Object" panel from the Edit Query view is what is sent over to the CSV file. Also, the order of the columns of data is according to what is specified in the "Results Object" panel. So, just a heads-up to consider if this is happening or not. Otherwise, please give us the workflow and the version of XI and client's versioin of Java on the workstation...
Thanks,
John -
Missing data when exporting webi to excel (not 65536 limit problem)
Hi guys
I just meet a problem about webi that it will miss data when exporting webi to excel.
It's not about 65536 limitation, as my webi report do some aggregration and limitation and never beyond that limitation.
Also there are 2 tabs in my reports, if I split the 2 tabs into 2 separate reports and export them separately, then problem disappeared.
Any ideas on this?Hello Claes
according to:
http://help.sap.com/erp2005_ehp_05/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
Tools => Import and Export => Specifying the Sequence of the External Data Structure => External File Structure: Specification
Table EST07 should be part of export file. I am not sure if the packing requirement ist part of EST07.
Furthermore wirh ECC 6.0 EnhPAck3 some changes happend generally in the area of DG classification.
E.g. Dynamic dangerous goods classification. I am not sure if these changes are "included" in some sense in the EH&S data download.
With best regards
C.B.
PS: please check this link on the top:
http://help.sap.com/erp2005_ehp_05/helpdata/en/c1/eda0f591ec12408b25e7a1b369ca45/frameset.htm
Refer to "Table Assignment: Specifications"
I believe packaging requirement is part of table EST0B but this is part of the download file.
Edited by: Christoph Bergemann on Aug 27, 2011 7:12 PM
Edited by: Christoph Bergemann on Aug 27, 2011 7:13 PM -
Exporting data from JSP to EXCEL
Hi All,
I am getting data in form of table in my jsp page. I need to know how to export the data in excel sheet with a click of button.
Please help me.
ThanksThanks for your help
I put the code in my jsp page. it shows a dialog box which ask the location for the excel sheet to save. However the excel it blank. It does not retrive any values from the database or jsp page
Here is an overview of the page which i`m generating the report
1) creating a connection object, and loading the Mysql driver
2) getting the values from the database using select command
3) Displaying the values in form of table
4) in the bottom creating a button called "Export"
5) this export will go to another page called "export.jsp"
6) here i write the code
<%@ page contentType="application/vnd.ms-excel" %>Plz help -
Export to Excel - Macro problems
I have moved this to the Discoverer forum. Exporting to Excel - Macro Problems
Message was edited by:
user385142Hello Denes.
Excuse me for send you a message in this way , but I dont find other way to contact with you.
Im using the export_excel_pkg, and really it work good.
I have only one problem, I tell you.
When, in one item, data is very long and numeric, by example a EAN code, without any class of format, by default it give me the value ###, Im studing the package and trying to resolve this, but if you can send me any idea it can help me a lot.
Thanks in advanced.
You are doing a great work for us. -
Export data from JSP to Excel on click on button
Hi,
I want to display the table data in my Jsp to Excel on click of "Export to Excel" icon, The data in my jsp table is dynamic, only click of "export to Excel" icon i want the contents of the table needs to be exported to Excel. Can pls anyone help me in doing this..
Thanks & Regards
Sowmya.JOn click of the button, you will have to reuse the same java code which you used to populate the table in the JSP except that you will have to create an excel file with the data you got using suitable excel api's (look for POI api). Write the stream to the response and the browser will take care of opening a dialog to save/open the file.
Maybe you are looking for
-
Office 2013 Home and Business License Compatability with Windows Server 2012 R2
Are there any license issues with installing Office 2013 Home and Business on Server 2012 R2 operating system? I am having inconsistent issues installing this software on a server running this operating system. The Office software is not being accc
-
How can I get a search bar added when trying to archieve emails in my IPhone's email app?
My IPhone email app is connected to my Outlook email system in which I have many archieved folders, when I want to place an email in my archieved folders on my IPhone I have to scroll a long list of archieved folders to find the right one, how can I
-
Online number showing as completely Different Numb...
My online number I have purchased with skype and have had for almost 1year. Recently I have been told by numorous people that when I call them a completely different number is showing up on there caller ID. I am unsure what to do please help. Thank
-
Can not conect to itunes store "An unknown error has occurred(-3248)"
I haven't been able to connect to itunes for about a week now and none of the other posts have this error (-3248) in them. I have no clue what to do. I made sure that my firewall was not blocking it and i flushed my dns, but none of them worked. Can
-
Zen Xtra - help connecting to home ste
hi,?i was hoping that someone would be able to recommend a way to connect my 30gb Zen Xtra to my home stereo....what brand of cable works best, what type of cable (y split) etc. thanks?