on 10-14-2008 6:05 AM
Hi all,
I used standard excel download option in one application.There is one text column in the table .Whwn I display in excel the test is displayed as #### (ofcourse if the text size is gretaer than 255).Rest is working fine.
Did anybody came across this type of problem.
Any solution please.
Thank you,
Regards,
Rajesh
Hi,
Increase the column width in excel it will display the entire content.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Thank you for immediate reply.How to increase the size of the excel column programatically.The end user should not see that # when he clicks the download to excel.
This is the code used by me to download tje data to excel.
Map m = new HashMap();
try
{
//IWDNode wdTableNode = wdContext.nodeItab_Report2();
IWDNode wdTableNode = null;
int type1 = type;
switch(type)
{
case 1:
{
wdTableNode = wdContext.nodeItab_Report1();
break;
}
case 2:
{
wdTableNode = wdContext.nodeItab_Report2();
break;
}
case 3:
{
wdTableNode = wdContext.nodeItab_Report3();
break;
}
case 4:
{
wdTableNode = wdContext.nodeItab_Report4();
break;
}
default :
{
wdTableNode = wdContext.nodeItab_Report1();
break;
}
}
byte[] b = null;
String linktoFile = null;
StringBuffer err = new StringBuffer();
StringBuffer xml_file = new StringBuffer();
int noofelem = wdTableNode.size();
ArrayList columnInfos = trimHeaderTexts(columnInfos1);
String nodename = wdTableNode.getNodeInfo().getName().trim();
String _nodename = nodename.substring(0, 1).toUpperCase()+nodename.substring(1).toLowerCase();
xml_file.append("<?xml version='1.0' encoding='UTF-8' standalone='no'?><")
.append(_nodename)
.append(">\n");
int size = columnInfos.size();
for(int i =0;i<noofelem;i++)
{
IWDNodeElement elem = wdTableNode.getElementAt(i);
xml_file.append("<")
.append(_nodename)
.append("Element>");
for (int j = 0;j<columnInfos.size();j++)
{
String attributeName = (String)columnInfos.get(j);
String attributeValue = "";
if(elem.getAttributeValue(attributeName)!=null)
attributeValue = elem.getAttributeValue(attributeName).toString().trim();
xml_file.append("<")
.append(attributeName)
.append(">")
.append("<![CDATA[")//added by rajesh
// .append(elem.getAttributeValue(attributeName))
.append(attributeValue)
.append("")//added by rajesh
.append("\n");
}
xml_file.append("\n");
}
xml_file.append("\n");
try
{
b = xml_file.toString().getBytes("UTF-8");
IWDCachedWebResource xlfile = WDWebResource.getWebResource(b,WDWebResourceType.XLS);
xlfile.setResourceName(this.getDropdownText()+" Report ");
//xlfile.
linktoFile = xlfile.getURL();
IWDWindow win = wdComponentAPI.getWindowManager().createExternalWindow(xlfile.getURL(),"Service Request Details",true);
win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
//win.removeWindowFeature(WDWindowFeature.MENU_BAR);
win.removeWindowFeature(WDWindowFeature.STATUS_BAR);
win.show();
}
catch (WDURLException e1)
{
err.append(""+e1.getCause());
}
catch (UnsupportedEncodingException e)
{
err.append(""+e.getCause());
}
m.put("data",b);
m.put("url",linktoFile);
m.put("error",""+err.toString());
}
catch(Exception e)
{
this.catchMessage("E","Download To Excel"+e.toString());
}
return m;
]]>
Where can I set the column size in this code.
Thank you,
Regards,
Rajesh
closed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Following article may be of use
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.