cancel
Showing results for 
Search instead for 
Did you mean: 

how to print table data on click of a button

former_member205624
Contributor
0 Kudos

hi, all

can some one tell me How one can print table data on click of a button in web dynpro.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Jitender,

One way (not the simplest one, however described here

Read thread down from this message.

Or you may use Adobe Form for printing.

VS

Former Member
0 Kudos

Create a table during the design time in the normal way.

Bind table "Visibility" property to Context attribute of type "com.sap.ide.webdynpro.uielementdefinitions.Visibility" and initialize with "WDVisibility.NONE" in code.

With "onAction" event handler of button, change context attribute value to "WDVisibility.VISIBLE"

former_member205624
Contributor
0 Kudos

hi,kranthi

What is wrong with you boss that is not my question. Please read it again if you have some solution for that then please tell me.

Regards.

Dheerendra
Participant
0 Kudos

hi, jitender....I think U can Do This with the Help of Java Print api's....Just Do all coding for printing on button click methods and pass all data into the new Browser Window then user can print it thrgh FIle Menu option........

regard's

Former Member
0 Kudos

LOL!

Printing from server-side application to client local printer with <a href="http://java.sun.com/j2se/1.4.2/docs/guide/jps/index.html">Java Print Service</a>. Or to printer attached to server with the following delivery via regular mail?

I must see this ))

Could you submit sample code?

VS

Dheerendra
Participant
0 Kudos

Sorry V.S............But I have got the Solution of printButton problem and had tested it....through following code...

-


final String formattedStr = wdContext.currentContextElement().getTable_data();

final IWDCachedWebResource resource = WDWebResource.getWebResource

(

//formattedStr.getBytes("UTF-8"), WDWebResourceType.HTML

formattedStr.getBytes("UTF-8"), WDWebResourceType.HTML

);

resource.setResourceName("HTML_inline.html");

// resource.setAttachement( false );

// resource.setReadOnce( false );

wdContext.currentContextElement().setTable_dataOutput( resource.getAbsoluteURL() );

-


Regard's

Dheerendra

Former Member
0 Kudos

Hello Dheerendra:

Will you please pass the complete code (with out any company sensitive info) ?

I am very interested in your proposed solution.

Thanks,

Prasad Nutalapati