This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Aug 16, 2011, 10:42 AM
6 Posts
topic has been resolvedResolved

Export to Excel

  • Category: Other
  • Platform: Windows
  • Release: 8.5.1
  • Role: End user,Developer
  • Tags: Excel,Export,Xpage,Xpages
  • Replies: 2
Hi all,
 
I need help to get the Export to Excel to function properly.
What I used was the script found in the net like the one at the bottom.
I will always get something like this in Excel:
 
'------------------------------RESULT----------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="de">
<head>
<title></title>
<script type="text/javascript" src="/domjs/dojo-1.3.2/dojo/dojo.js" djConfig="locale: 'de'"></script>
<script type="text/javascript" src="/domjs/dojo-1.3.2/ibm/xsp/widget/layout/xspClientDojo.js"></script>
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xsp.css">
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xspLTR.css">
<link rel="stylesheet" type="text/css" href="/domjava/xsp/theme/webstandard/xspFF.css">
</head>
<body>
<form id="view:_id1" method="post" action="/SKP/reikotool.nsf/xpExcelExport.xsp" class="xspForm" enctype="multipart/form-data">

<input type="hidden" name="$$viewid" id="view:_id1__VUID" value="!cxldb2h7uu!">
<input type="hidden" name="$$xspsubmitid">
<input type="hidden" name="$$xspexecid">
<input type="hidden" name="$$xspsubmitvalue">
<input type="hidden" name="$$xspsubmitscroll">
<input type="hidden" name="view:_id1" value="view:_id1">
<script type="text/javascript">
function clearFormHiddenParams_view__id1(curFormName) {
  var curForm = document.forms[curFormName];
}</script>
</form>
</body>
</html>a;s;d;f
--------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------
 
 
Why is that?
I'm new to Xpages and stuff so please explain it as good as you can.
Thanks in advance!
Alex
 
 
|
|
|  
Code Example from my Xpage in Event afterRenderResponse
 
 
// The external context gives access to the servlet environment
var exCon = facesContext.getExternalContext();

// The writer is the closest you get to a PRINT statement
// If you need to output binary data, use the stream instead
var writer = facesContext.getResponseWriter();

// The servlet's response, check the J2EE documentation what you can do
var response = exCon.getResponse();

// In this example we want to deliver xml and make sure it doesn't get cached
response.setContentType("text/comma-separated-values");
response.setHeader("Cache-Control", "no-cache");

// Here all your output will be written
writer.write("a;s;d;f");

// We tell the writer we are through
writer.endDocument();
facesContext.responseComplete();
writer.close();
 
 
 
Aug 16, 2011, 12:01 PM
272 Posts
Re: Export to Excel
Hi Alex,
 
did you set your XPage properties to "rendered = false"?
 
Sven
Aug 16, 2011, 12:56 PM
6 Posts
Re: Export to Excel
Sven you are my man!
 
That's it. It's most of the times as easy as this, but most of the times undocumented.
Thanks so much for your help!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal