How to print table contents?
hi @,
I am having a view which is dsiplaying data fetched from the R/3 through Adaptive RFC in a table. This table need to have a print functionality to print on the client.
How to do this I am not having any function / UI to do this.
Any help.
Regards
Hi,
Try This:
When the user click on Print button, launch a new window as below:
public void onActionPrint(com.sap.xyz.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionPrint(ServerEvent)
StringBuffer strB = new StringBuffer("/webdynpro/dispatcher/xyz.com/(component name space) ab~xyz~testprint/(application name)PrintTestApp");
IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(strB.toString(), "Print");
window.show();
//@@end
The above code helps to launch a new window with your Web Dynpro application. The application is sepecific to print functionality.
ThePrintTest App should have the content with format what exactly you would like to print. (Users use the browser standard print functionality to print the table content).
This is a kind of work around and as of NW 7.0 there is no standard print functionality available in Web Dynpro.
Thanks
Krishna
Similar Messages
-
can anyone tell me how to print HTML contents...i needed it urgently
Thanksactually i have a print button on html page....when i click on print button using window.print(); the html page gets printed...but along with it print button is also printed...i dont want print button to be printed...
this is the issue...
please resolve it
Thanks a lot... -
How to change table content ...
Hi All,
Pl. give us soltution for the following :
1. How to change table content of standard table ?
(eg. mara content not from MM02.).
2. How to add field in standard table ?
waiting reply.
YusufHi Yusuf,
Modifying a standard table through a program using SQL statements is highly risky. However if u wish to do it programatically and not through MM02, you have the option of using BAPIs.
Goto transaction BAPI and through the application hirarchy, goto Material Management section. There i am sure u will find some BAPIs to modify material master and they are the most stable mode of update programatically.
Hope this helps.
Regards,
Aditya -
How to print Iview contents only
Hello All,
How to print IView contents only instead of the whole portal. If I use javascript function, it prints whole screen. I want to print only the IVIEW contents. IView has tableview.
Thanks in advance,
PraveenHi,
we are using a 7.0 SP 16 Portal.
If you have an light portal with an low EPCF level maybe the option will not be shown.
Try it with the default SAP Portal Style as admin in that case you have an high EPCF level and you also should see the print option.
If your iview is embeded inside a page this can have different effects. Please test it with an stand alone iView before.
So with the high EPCF level the default portal style a single portal iView and the print option set to true you should see and use the print option.
The option "Show print option" is not for every iView type avaible for example web dynpro iViews has that option this i know for sure, because i use this option with web dynpro iViews.
Maybe you can build this function by your own i did this also with the following code. Maybe you can adapt that code:
String p1 = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter("PagePath");
String p2 = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("sap-ext-sid");
String p3 = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("sap-wd-cltwndid");
String[] url = wdThis.wdGetAPI().getComponent().getApplication().getURLService().getGeneralService().getAbsoluteWebResourceURL(wdThis.wdGetAPI().getComponent().getDeployableObjectPart().getName()).split("/");
parameter = p1 + "&iview_mode=default&sap-wd-renderMode=print&sap-wd-cltwndid=" + p4 + "&sap-wd-cltwndid-print=" + p4 + "&sap-wd-pb-ext-sid=" + p2 + "--" + p3 + "--&IviewPrint=true";
String newUrl = "http://" + url[2]+ "/irj/servlet/prt/portal/prtroot/com.sap.portal.pagebuilder.IviewModeProxy?iview_id=" + parameter;
kind regards
Fabian
Edited by: Fabian Eidner on Mar 23, 2009 3:40 PM -
How to delete table content for particular filed in a table?
Hi Experts,
How to delete table content for particular field in table?
Thanks
RavillaIs it a standard or customer table, changing a standard table with non-standard tool can raise database inconsistencies...
Then use search tool for &SAP_EDIT (*) or look for BAPI/BDC...
Regards,
Raymond
(*) Also look for notes from 1420281 - CO-OM tools: SE16N: Deactivating &SAP_EDIT to 1915828 - CO-OM-Tools: Technical enhancement of SE16N -
How to print the contents of the table in new page?
Hi,
I want to print my table contents in the next page by clicking on a button. ie., kind of a print preview. I'm using netweaver2004s.
Thanks & Regards,
SureshHi,
1)Create a new View, map the context node which is bound to the table to the context of this view.
2) Iterate throught the element and print them to the screen.
3) Embed this view to a window.
4) on click of the button open the newly created window.
Code to iterate through the nodes
for(int x=0; x< wdContext.nodeTest().size(); x++) // Replace nodeTest with yours
ITestElement nodeElement = wdContext.nodeTest().getElementAt(x);
nodeElement.getAttribute("TestAttribute"); //Replace with yours
nodeElement.getAttribute("TestAttribute"); //Replace with yours
Regards
Ayyapparaj -
How to export table contents in xml file format through SQL queries
hi,
i need to export the table data in to xml file format. i got it through the GUI what they given.
i'm using Oracle 10g XE.
but i need to send the table name from Java programs. so, how to call the export commands from programming languages through. is there any sql commands to export the table contents in xml format.
and one more problem is i created each transaction in two tables. for example if we have a transaction 'sales' , that will be saved in db as
sales1 table and sales2 table. here i maintained and ID field in sales1 as PK. and id as FK in sales2.
i get the combined data with this query,
select * from sales1 s1, sales2 s2 where s1.id=s2.id order by s1.id;
it given all the records, but i'm getting two ID fields (one from each table). how to avoid this. here i dont know how many fields will be there in each table. that will be known at runtime only.
the static information is sales1 have one ID field with PK and sales2 will have one ID filed with FK.
i need ur valuable suggestions.
regards
pavan.You can use DBMS_XMLGEN.getXML('your Query') for generating data in tables to XML format and you can use DBMS_XMLGEN.SETROWSETTAG to change the parent element name other wise it will give rowset as well as DBMS_XMLGEN.SETROWTAG for row name.
Check this otherwise XMLELEMENT and XMLFOREST function are also there to convert data in XML format. -
How to print the content of a text edit ?
Hi to all,
I have a view with a text edit and I want to print its content. I created a button and I want to print text edit content pressing this button. How can I do? Which java code I have to insert in that button?
thanks a lot,
AntonioAntonio,
Sadly, there is no way to do it directly. Even in plain HTML application it is impossible to print text of UI control (<textarea> in this case).
So you have to open new browser window containing entered text and let user print text himself. Or invoke window.print() on document load event.
VS -
How to print the content of LinkedList int[] and LinkedList LinkedList ?
Hi guys, its been a long time since i posted here, and now im coming back to programming using java. My problem is, how can i print the content of the list?
Example:
LinkedList<int[]> list = new LinkedList<int[]>;
int[] input = {1,2,3,4,5};
int[] input2 = {2,32,43,54,65};
list.add(input);
list.add(input2);
how can i print all the content of the linkedlist?
Please help me..I know its a dumb question but i really dunno how.
here is the code:
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Arrays;
public class Test{
static void printThis(String[] in){
System.out.print("Value: ");
for(int i = 0;i<in.length;i++){
System.out.print(in[i] + " ");
System.out.println();
static void reset(String[] val){
for(int i = 0;i<val.length;i++){
val[i] = "";
public static void main(String[] args){
LinkedList<String[]> list = new LinkedList<String[]>();
LinkedList<String> listTrans = new LinkedList<String>();
System.out.print("Enter the number of records: ");
Scanner s = new Scanner(System.in);
int numOfRecords = s.nextInt();
System.out.print("Enter the number of records per run: ");
s = new Scanner(System.in);
System.out.println();
int numOfRecordsInMemory = s.nextInt();
String[] getData = new String[numOfRecords];
String[] transferData = new String[numOfRecordsInMemory];
int numOfRuns = 0;
int counter = 0;
for(int i = 0;i<numOfRecords;i++){
counter++;
System.out.print("Enter value number " + counter + ": ");
Scanner scan = new Scanner(System.in);
getData[i] = scan.next();
listTrans.add(getData);
if(getData.length%numOfRecordsInMemory == 0){
numOfRuns = getData.length/numOfRecordsInMemory;
}else if(getData.length%numOfRecordsInMemory != 0){
numOfRuns =(int)(getData.length/numOfRecordsInMemory)+ 1;
System.out.println();
System.out.println("Number of Runs: " + numOfRuns);
int pass = 0;
System.out.println("Size of the main list: " + listTrans.size());
while(listTrans.size() != 0){
if(listTrans.size() >= numOfRecordsInMemory){
for(int i = 0;i<numOfRecordsInMemory;i++){
transferData[i] = listTrans.remove();
System.out.println("Size of the list: " + listTrans.size());
printThis(transferData);
System.out.println();
Arrays.sort(transferData);
list.add(transferData);
reset(transferData);
}else if(listTrans.size() < numOfRecordsInMemory){
pass = listTrans.size();
for(int k = 0;k<pass;k++){
transferData[k] = listTrans.remove();
System.out.println("Size of the list: " + listTrans.size());
printThis(transferData);
System.out.println();
Arrays.sort(transferData);
list.add(transferData);
reset(transferData);
//This is the part that is confusing me.
//im trying to print it but its not working.
System.out.println("Size of the next list: " + list.size());
// for(int i = 0;i<list.size();i++){
// System.out.println();
// for(int j = 0;j<list.get(i)[j].length();j++){
// System.out.print(list.get(i)[j] + " ");Here's the funnest, mabye clearest way you could do it: Use 2 Mappers
package tjacobs.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import tjacobs.Arrays;
public class Mapper <T>{
public static interface MappedFunc<T> {
void map(T value);
public Mapper(T[] vals, MappedFunc<T> function) {
this (new Arrays.ArrayIterator<T>(vals), function);
public Mapper(Iterator<T> iterator, MappedFunc<T> function) {
while (iterator.hasNext()) {
function.map(iterator.next());
public static void main(String[] args) {
String[] s = new String[] {"a","b", "c", "abc", "ab"};
MappedFunc<String> func = new MappedFunc<String>() {
public void map(String s) {
if (s.toLowerCase().startsWith("a")) {
System.out.println(s);
Mapper m = new Mapper(s, func);
} -
How to print the contents of a form(window)
I'm devloping visitors application in java. After the data entry, I need to display the selected information from database along with the photo and take a printout so that it looks like a card.
I know how to display the contents in a form. How do I print the contents of the form?
-Thanx
Hanein JComponent there is a method called print(Graphics g)
you can use that with a Printable class
read bout the java.print package in the java doc -
How to print the contents of doubly-Linked List
Hi
I have a DLList consists of header , trailer and 10 linked nodes in between
Is there a simple way to print the contents ie "the elements"
of the list
thanksIn general you should write an iterator for every linked data structure for fast traversal. I'm guessing you're writing your own DLL for an assignment because one normally uses the LinkedList structure that is included in the api. Anyway, here is an example of how the iterator is implemented for a double linked list:
http://www.theparticle.com/_javadata2.html#Doubly_Linked_Lists_with_Enumeration -
How to print table items in column in smartform in 4.6c version.
Hi Experts,
I want to print the items i have in columns (like name invoice number) in smartforms but when i create table in main window there no options for header footer and main area, i have created the template for header and footer but how i print the items in columns. Pls reply ASAP.
Thanks in advance,
Abhishek Pandey.Hi
create a table under main window
Under the Header create a Row or Line
Under the Row create a Cell and Under that Cell create a text field
In that text you can write what ever field name u want to write
Reward if it is helpful to you
Thanks
Krushna -
How to print window contents at the backside of a page(In scripts&smartform
Hi,
How to print the window contents at the back side of a page
in scripts and smartforms?
regards,
prajwalaCreate a new page with the window and select "duplex" printing. Use Search button to get more information.
-
Urgent: how to print the contents displayed in JTextPane
hi all,
i've a problem printing the contents typed in styled format in JTextPane, when i print the contents nothing is printed. can anyone tell how can i print the contents typed in styled format or so. the code for implementing the print is given below.
class ContentsArea extends JTextPane implements Pritable {
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
if (pi >= 1) {
return Printable.NO_SUCH_PAGE;
Graphics2D g2d = (Graphics2D) g;
g2d.translate(pf.getImageableX(), pf.getImageableY());
g2d.translate(pf.getImageableWidth() / 2,
pf.getImageableHeight() / 2);
Dimension d = getSize();
double scale = Math.min(pf.getImageableWidth() / d.width,
pf.getImageableHeight() / d.height);
if (scale < 1.0) {
g2d.scale(scale, scale);
g2d.translate(-d.width / 2.0, -d.height / 2.0);
return Printable.PAGE_EXISTS;
}i'd be grateful to all ppl who helps me.
Afroze.What's the exact problem? The printer printing a blank sheet or the printer not doing anything at all? First make sure in the main program you've got something along the lines of...
import java.awt.print.*;
PrinterJob printerJob = PrinterJob.getPrinterJob();
PageFormat pageFormat = printerJob.defaultPage();
if(!printerJob.printDialog()) return; //not essential but lets the user tweak printer setup
pageFormat = printerJob.pageDialog(pageFormat); //ditto
printerJob.setPrintable(this, pageFormat);
print(...);
The above code should go in an ActionListener, triggered when the user hits a print button or menuitem. I'm guessing you already have something similar set up.
Then your print(...) method should be similar to
public int print(Graphics g, PageFormat pageFormat, int pageIndex)
if(pageIndex>0) return NO_SUCH_PAGE;
Graphics2D gg = (Graphics2D)g;
gg.draw(whatever's going to be printed);
return PAGE_EXISTS;
Which it is, although yours has clever scaling stuff built in ) The only thing you're not doing is rendering the actual content.
So if you want the contents of the textpane, it'd make sense to use something like g.drawString(myTextPane.getContents()); in the print method. Note it's g and not g2d, since Graphics2D has more complicated text handling routines.
I'm no expert tho ) -
How to pass table contents to Workflow?
hi all,
my workflow accepts a table as input. when i execute the Workflow from SWUS i can enter the table contents.
Now how to pass these <b>table contents to workflow through Function module</b>
say the table has 3 columns and 5 rows.
regards.
Subbavery Helpful answer.
i referred to the below link.
<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/e4b130453d11d189430000e829fbbd/frameset.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/e4b130453d11d189430000e829fbbd/frameset.htm</a>
my workflow input container is a tableas below:
table: ZEMPLOYEE
Empid empname empaddress
<b>0001 john texas
0002 jay india
0003 hassan karachi</b>
so how to declare the container and pass these values to the container through function module. Also what is object type and object key, i have not defined any object type and object key. just a direct table contents to be imported into Workflow.
regards,
Subba
Maybe you are looking for
-
If we share one iTunes account can we have multiple iCloud accounts?
My children and I share one iTunes account. Can each one of us have our own iCloud account. We upgreaded the IOS and my daughter ended up with my contacts and hers. She deleted mine and now they are all gone. I want to avoid this issue in the fut
-
Route determination screenshots and stock transfer order urgent
Hi sd gurus, Can any one plz send screen shots of routedetermination abd sto to my mail id [email protected]
-
Reporting data in another database
Is there in any mechanism to store reporting data in a database (Single table) using OBIEE without any customization ?
-
Is it possible to open QuarkXPress files in CC or CC 2014?
Is it possible to open QuarkXPress files in CC or CC 2014?
-
Is the new 15" macbook pro retina display (Crystalwell) in stores yet?
I know the new macbook pro just came out 3 days ago so i just wanna know if the macbooks have arrived to stores so i can buy them.