on 10-26-2007 11:05 AM
Hi
I have to download table contents to excel sheet for printing purpose,or is there any other facility through which we can directly print the table data?
please explain in detail.
thanks
prajakta
Hello,
Try If the following code help you
//Take This is sample data in table with three records
String str[][]={{"One ","Hyd","MG","Manager"},{"Two","Chennai","ASM","AsstManager"},{"Three","Chennai","SREX","SrExecutive"},{"Four","Hyd","EX","Executive"}};
for(int i=0;i<str.length;i++)
{
String aa[]=str<i>;
byte b[]=aa[0].getBytes();
fos.write(b);
fos.write("\t".getBytes());
b=aa[1].getBytes();
fos.write(b);
fos.write("\t".getBytes());
b=aa[2].getBytes();
fos.write(b);
fos.write("\t".getBytes());
b=aa[3].getBytes();
fos.write(b);
fos.write("\t".getBytes());
fos.write("\n".getBytes());
}
// Find the URL of this File and bind to Context Using Following Code
FileInputStream fis = new FileInputStream(f);
FileChannel fc = fis.getChannel();
byte[] data = new byte[(int)(fc.size())];
ByteBuffer bb = ByteBuffer.wrap(data);
fc.read(bb);
IWDCachedWebResource objCachedWebResource = null;
if (data != null)
{
objCachedWebResource = WDWebResource.getWebResource(data,WDWebResourceType.XLS);
objCachedWebResource.setResourceName(f.getName());
}
wdContext.currentContextElement().setResource(objCachedWebResource.getAbsoluteURL());
Regards
LakshmiNarayanaChowdary.N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prajakta
You can use File Download UI Element for this. But first you will have to iterate through the data in the Table Node and convert it in to Spreadsheet ML format.
This file than can be downloaded on to your local system. Open the downloaded file in Excel and then print.
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this blog
/people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities
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
One 'PrintButton' UI element is available, through that you can directly print the whole data inside a view.
thanks
Smitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.