cancel
Showing results for 
Search instead for 
Did you mean: 

Get the label of webdynpro table columns for export to excel

Former Member
0 Kudos

Hi

We are using the export excel component, but the problem is that in the getinfocolumns method we need to put the label for the column and we have the application working in two language: spanish and english. We want to send the translated label of the webdynpro table in this method.

Someone can help us?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi, thank you but in the method for set the columns names for excel i dont have access to view element. I only can access to viewElement in the method modifyview, so i cant do it.

srinivas_sistu
Active Contributor
0 Kudos

Hi ,

Still you can do that.

one way: Get the lables in the domodify put them inside a context attribute of type array and use this context variable where ever you want.

second way: create a context variable of type IWDView and set this context values in domodify(may be use can use the iffirsttime variable to set it only ones) and use this context variable where ever you want.....

Looks some thing like this:

first in domodify()

try

{

if(firstTime)

{

wdContext.currentContextElement().setVa_view(view);

}

.

.

.

.}

then i used this context variable in doinit() like this...

public void wdDoInit()

{

//@@begin wdDoInit()

try

{

IWDTable tbl=(IWDTable )wdContext.currentContextElement().getVa_view().getElement("Table");

IWDTableColumn col=(IWDTableColumn )tbl.getColumn(0);

IWDCaption cap=(IWDCaption)col.getHeader();

String strColHdr=cap.getText();

//Or use try the below one

String strColHdr2=cap.toString();

}

catch(Exception e)

{

}

//@@end

}

Regards,

SrinivaS

Edited by: srinivas sistu on Sep 24, 2009 2:42 PM

Answers (2)

Answers (2)

Former Member
0 Kudos

thank you very much. I thought the first way, but i prefer the second way you said.

Thank you

srinivas_sistu
Active Contributor
0 Kudos

Hi,

In domodify, write the below code and get the colomn headres of the table and pass this value to the required method where you are displaying the XL.

try

{

IWDTable tbl=(IWDTable )view.getElement("Table");

IWDTableColumn col=(IWDTableColumn )tbl.getColumn(0);

IWDCaption cap=(IWDCaption)col.getHeader();

String strColHdr=cap.getText();

//Or use try the below one

String strColHdr2=cap.toString();

}

catch(Exception e)

{

}

Regards,

SrinivaS

PS: The above is just give you an initial idea. Sorry I couldnot give exact code as now I am not able to connect an EP Server to test my code