cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting table to Excel

Former Member
0 Kudos

Hi Experts,

I have created the Java class, calculating sum is working fine using TableUtility blog.

I am trying to export the table data to Excel, for that I have created context element(Excelfile) and LinkToURL(url).

If there is any mistake in following code, please correct it.

Do I need set any parameters in LinkToURl properties?.

public void wdDoInit()

{

//@@begin wdDoInit()

ArrayList al = new ArrayList();

al.add(IPrivateResults.ISalesOrdersElement.MATERIAL);

al.add(IPrivateResults.ISalesOrdersElement.REQ__QTY);

wdContext.currentContextElement().setExcelfile((String)wdContext.currentContextElement().getTableutility().DownloadToExcel(al).get("url"));

//@@end

}

I am getting follwoing error...

-


java.lang.NullPointerException

at .sd.salesorderslist.Results.wdDoInit(Results.java:106)

at .sd.salesorderslist.wdp.InternalResults.wdDoInit(InternalResults.java:171)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)

-


Thanks in advance,

Accepted Solutions (0)

Answers (1)

Answers (1)

i827647
Product and Topic Expert
Product and Topic Expert
0 Kudos
Former Member
0 Kudos

Hi Thomas,

I am following this blog...

/people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities

Thank you,

Former Member
0 Kudos

Hi,

Bind ur Contex element ExcelFile to LinkToURL

Former Member
0 Kudos

Hi Ruchi,

I already did it(LInktoURL reference is pointed to Context element), is it correct?.

All the coding part for this functionality is in DoInit, Do I need to add anything?.

I have created only one context element and one UI(Link to URL) element for this, Do I need to create any other elements?.

Thank you,

Former Member
0 Kudos

Follow the instructions in the blog Jai. Check the feedback from Paola Groppo. I guess he had a similar problem. This should solve your problem.

Former Member
0 Kudos

Hi,

I did some debugging(Commented the complete functionality in Java Utility and tried, just to induct error is from java utility class or farm my program)...

I figured out that, when I call the method it is thorwing exception....

ArrayList al = new ArrayList();

al.add(IPrivateResult.ISalesOrdersElement.MATERIAL);

al.add(IPrivateResult.ISalesOrdersElement.REQ__QTY);

Map m = wdContext.currentContextElement().getTableutility().DownloadToExcel(al);

java.lang.NullPointerException

at .componenets.Result.wdDoInit(Result.java:111)

at .componenets.wdp.InternalResult.wdDoInit(InternalResult.java:124)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)

at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)

at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)

Doing anything wrong in the Arrylist?...Please advice..this is bit urgent!!!.

Former Member
0 Kudos

Can you please post that blog here?.