Printing JTable. help required..

I am trying to print the data in JTable in tabular format. I know of the java.awt print API. It used Graphics 2D object to render everything and it requires to do all the math to calculate the co-ordinates with respect to font width & height.
Is there any better way to print the tabular data?
Thanks for any suggestions.

I am trying to print the data in JTable in tabular format. I know of the java.awt print API. It used Graphics 2D object to render everything and it requires to do all the math to calculate the co-ordinates with respect to font width & height.
Is there any better way to print the tabular data?
Thanks for any suggestions.

Similar Messages

  • PRINT WORKBENCH HELP REQUIRED!!

    HI..
    I AM DESGINING A METER READING FORM USING THE PRINT WORKBENCH TOOL.
    MY SPECIFIC PROBLEM IS HOW TO DISPLAY THE DATA THAT IS POPULATED IN THE DDIC STRUCTURE OF THE FORM CLASS.
    IN THIS CASE THE DDIC STRUCTURE IS ISU_DM_MR_ORDER_S_MR_UNIT AND I WANT TO PRINT INFORMATION SUCH AS BUSINESS PARTNER NO, INSTALLATION NO.
    ALL THIS DATA IS THERE IN THE STRUCTURE BUT I AM NOT ABLE TO EXTRACT THIS AS IT IS COMPLEX CONSISTING OF MANY TABLE TYPES IN IT.
    PLEASE HELP ME REGARDING THIS..
    THNX IN ADVANCE

    Hi
    I think the std program may not be using the logic mentioned by you to fetch the storage location
    "Need to read the NAME2 from the storage location on the Stock transfer order which is the reference document for Delivery.
    Take the first item and use the SLOC from it. You can use LIPS-VGBEL for STO# and LIPS-VGPO for item #.
    Input will be delivery item. once you find the STO read EKPO-LGORT for sloc."
    So better create the PROGRAM LINES in the related window and write the code to fetch the storage location as per the above logic
    and fetch the address details(ADRNR)  of  storage location from T001L table and fetch the required field from the ADRC table and display
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Im using HP laserjet M1120N MFP printer and its required WIA driver.

    hi, 
    im using HP laserjet M1120N MFP printer.
    last time i dont have any issues to printer or scan, and lately i cant scan
    and only able to print out.
    its required me have WIA driver. anyone know how to fix its.
    thanks

    Hello zuzack97,
    I am sorry, but to get your issue more exposure, I would suggest posting it in the commercial forums, since this is a commercial product. You can do this at http://h30499.www3.hp.com/hpeb/
    I hope this helps.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • Help require with installing Adobe Acrobat onto my Macbook Pro Retina.

    Help require with installing Adobe Acrobat onto my Macbook Pro Retina.
    I have successfully installed all of my creative cloud apps with the exception being acrobat.
    I cannot print from Indesign to PDF.
    I have unistalled, reinstalled and still no Adobe Acrobat.
    I now have to go back to Windows 8 and create the PDF's there.
    Any one know how to get around this issue?
    Thanks in advance
    Kelvin

    OSX has effectively killed the ability to print to pdf, (print to pdf eliminates most of the "Rich features" of current pdf).
    Export from InDesign, always, excpet for the 1% of the time where you know why print to pdf would produce a better result.

  • Purchasing new HP Photosmart printer which will require new OS X Mountain Lion driver software.  Which steps do I take to install new printer, old printer HP still on iMac.

    Purchasing new HP Photosmart printer which will require new OS X Mountain Lion driver, which installation steps do I take.  Old printer still on iMac.

    Hi Carol 22,
    Thanks for the post.  Depending upon the printer model, print drivers may be available from ASU.  If not, then go to hp.com and download Mt. Lion drivers to your iMac.  After you complete the hardware setup of the printer, if connecting wireless, then connect the printer to your network and then complete the installation and add the printer.  Then you can go back and remove your old printer.  I hope this helps...Good Luck!
    I work for HP but my posts and replies are my own....Thank you!

  • Assign Printer Search Help to XREF1 field in FB70/75.

    Hi All
    I have a requirement where for a particular company code only I need to assign the printer search help to the field Reference Key 1 (XREF1) on the 'Detail' tab of FB70 & FB75.
    Is this feasible? If yes, can anyone please guide me.
    Regards,
    Harsh

    Hi,
    Try :
    PARAMETERS lv_vers TYPE /sapapo/vrsioid MATCHCODE OBJECT /SAPAPO/VRSIOID.
    Regards

  • Print JTable with row headers

    I am using the fancy new printing capablities in java 1.5 to print my JTable and wow is it ever slick!
    PrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
    set.add(OrientationRequested.LANDSCAPE);
    this.matrixJTable.print(JTable.PrintMode.NORMAL, null, null, true, set, false);Its just that easy. Way to go sun!
    The one problem that I am encountering is that my row headers don't print. The problem is that JTables don't support row headers, you have to use a JScrollPane for that.
    I need a way to print my JTable so that the row headers show up in the printout... and hopefully still use the warm and fuzzy new printing capabilities of JTable printing in java 1.5.
    (ps/ Isn't it time to add row header support to JTables?)

    The problem is that JTables don't support row headers, you have to use a JScrollPane for that.Well technically JTable's don't really support column headers either. It is a seperate component (JTableHeader). A JTable will automatically add its table header to the table header area of a JScrollPane. (but you don't have to use a jscrollpane to see the column headers, it is just the quickest and easiest way).
    Really shouldn't be hard to implement a row header and manually add it to the scroll panes row header area or use a BorderLayout and put your row header in the WEST and put your table in the CENTER if you don't want a scroll pane.
    Of course this won't help you with your printing issue.

  • Printing JTable problem

    hi
    i have a problem in printing jtable
    after printing the box around the table only printed and the content of the table isn't
    instead there is a wight space in the box
    can any one help me

    In fact the program i'm making is for printing preview
    it's three classes i found in one of the topics , then i modified them to preview a table
    here is my code : \\ the class "TPrintPreview" needs a JTable object as an argument
    ********************************TPrintPreview.java************************************************************
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.Cursor;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.image.BufferedImage;
    import java.awt.print.PageFormat;
    import java.awt.print.Paper;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.awt.print.PrinterJob;
    import java.text.MessageFormat;
    import javax.swing.JTable;
    import javax.swing.JTable.PrintMode;
    * @author  TAREQ145
    public class TPrintPreview extends javax.swing.JFrame {
       int m_wPage;
       int m_hPage;
        /** Creates new form TPrintPreview */
        public TPrintPreview(JTable table) {
            initComponents();
            PageFormat m_pageFormat = PrinterJob.getPrinterJob().defaultPage();//use PageDialog
            m_wPage = (int)(m_pageFormat.getWidth());
            m_hPage = (int)(m_pageFormat.getHeight());
            int scale = getScale(5);  //Scale Index = 100
            jComboBox1.setSelectedIndex(5);
            int w = (int)(m_wPage*scale/100);
            int h = (int)(m_hPage*scale/100);   
            int pageIndex = 0;
            try{
            while (true) {
                int theFirstImageWidth = table.getColumnModel().getTotalColumnWidth()+1;
                BufferedImage img = new BufferedImage(theFirstImageWidth, theFirstImageWidth+180, BufferedImage.TYPE_INT_RGB); 
                Graphics g = img.getGraphics();
                g.setColor(Color.white);
                g.fillRect(0, 0, theFirstImageWidth , theFirstImageWidth+180);//180 = height - width
                Paper p = new Paper();
                p.setImageableArea(0,0,theFirstImageWidth,theFirstImageWidth+180);
                m_pageFormat.setPaper(p);
                Printable  m_target = table.getPrintable(PrintMode.FIT_WIDTH,null,new MessageFormat("- {0} -"));
               if (m_target.print(g, m_pageFormat, pageIndex) != Printable.PAGE_EXISTS) {
                   img = null;
                   break;
                int rightOrLeftSpace = 25;
                int upOrDownSpace = 25;
                int theSecondImageWidth = theFirstImageWidth + (rightOrLeftSpace*2);
                BufferedImage img2 = new BufferedImage(theSecondImageWidth, theSecondImageWidth+180, BufferedImage.TYPE_INT_RGB); 
                Graphics g2 = img2.getGraphics();
                g2.setColor(Color.white);
                g2.fillRect(0, 0, theSecondImageWidth, theSecondImageWidth+180);
                g2.drawImage(img,rightOrLeftSpace,upOrDownSpace,null); 
                Image img3 = img2.getScaledInstance(m_wPage,m_hPage,Image.SCALE_SMOOTH);
                PagePreview pp = new PagePreview(w, h, img3);
                previewContainer1.add(pp);
                //pp = null;
                pageIndex++;
                img = null;
                g = null;
            } catch (PrinterException e)   {
              e.printStackTrace();
             System.err.println("Printing error: "+e.toString());
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            jLabel1 = new javax.swing.JLabel();
            jScrollPane1 = new javax.swing.JScrollPane();
            previewContainer1 = new PreviewContainer();
            jButton1 = new javax.swing.JButton();
            jComboBox1 = new javax.swing.JComboBox();
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Print Preview");
            jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
            jLabel1.setText("Print Preview");
            jLabel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
            javax.swing.GroupLayout previewContainer1Layout = new javax.swing.GroupLayout(previewContainer1);
            previewContainer1.setLayout(previewContainer1Layout);
            previewContainer1Layout.setHorizontalGroup(
                previewContainer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 752, Short.MAX_VALUE)
            previewContainer1Layout.setVerticalGroup(
                previewContainer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 511, Short.MAX_VALUE)
            jScrollPane1.setViewportView(previewContainer1);
            jButton1.setText("EXIT");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "10 %", "25 %", "30 %", "50 %", "75 %", "100 %", "125 %", "150 %", "175 %", "200 %" }));
            jComboBox1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jComboBox1ActionPerformed(evt);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 754, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 754, Short.MAX_VALUE))
                            .addContainerGap())
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(183, 183, 183)
                            .addComponent(jButton1)
                            .addGap(74, 74, 74))))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 513, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(40, 40, 40)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jButton1)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(80, Short.MAX_VALUE))
            pack();
        }// </editor-fold>                       
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            this.dispose();
        private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
            int scale = getScale(jComboBox1.getSelectedIndex());
                      int w = (int)(m_wPage*scale/100);
                      int h = (int)(m_hPage*scale/100);
                      Component[] comps = previewContainer1.getComponents();
                      for (int k=0; k<comps.length; k++) {
                         if (!(comps[k] instanceof PagePreview)) continue;
                         PagePreview pp = (PagePreview)comps[k];
                         pp.setScaledSize(w, h);
                      previewContainer1.doLayout();
                      getContentPane().validate();
        private int getScale(int scaleIndex) {
          int scale = 10;
          String[] scales = { "10 %", "25 %", "30 %", "50 %", "75 %", "100 %" , "125 %","150 %","175 %","200 %"};
          if (scaleIndex>-1 && scaleIndex<scales.length) {
             String str = scales[scaleIndex];
             if (str.endsWith("%"))str = str.substring(0, str.length()-1);
             str = str.trim();
             try { scale = Integer.parseInt(str); }
             catch (NumberFormatException ex) { ex.printStackTrace();}
          return scale;
        // Variables declaration - do not modify                    
        private javax.swing.JButton jButton1;
        private javax.swing.JComboBox jComboBox1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JScrollPane jScrollPane1;
        private PreviewContainer previewContainer1;
        // End of variables declaration                  
    ********************************PreviewContainer.java************************************************************
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Insets;
    import javax.swing.JPanel;
    * PreviewContainer.java
    * Created on 04 &#1603;&#1575;&#1606;&#1608;&#1606; &#1575;&#1604;&#1579;&#1575;&#1606;&#1610;, 2008, 10:20 &#1605;
    * @author  TAREQ145
    public class PreviewContainer extends JPanel {
        protected int H_GAP = 16;
        protected int V_GAP = 10;
        /** Creates new form BeanForm */
        public PreviewContainer() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
        }// </editor-fold>                       
          public Dimension getPreferredSize() {
             int n = getComponentCount();
             if (n == 0) return new Dimension(H_GAP, V_GAP);
             Component comp = getComponent(0);
             Dimension dc = comp.getPreferredSize();
             Dimension dp = getParent().getSize();
             int nCol = Math.max((dp.width - H_GAP) / (dc.width + H_GAP), 1);
             int nRow = n / nCol;
             if ((nRow * nCol) < n) nRow++;
             int ww = nCol * (dc.width + H_GAP) + H_GAP;
             int hh = nRow * (dc.height + V_GAP) + V_GAP;
             Insets ins = getInsets();
             return new Dimension(ww+ins.left+ins.right, hh+ins.top+ins.bottom);
          public Dimension getMaximumSize() {
             return getPreferredSize();
          public Dimension getMinimumSize() {
             return getPreferredSize();
          public void doLayout() {
             Insets ins = getInsets();
             int x = ins.left + H_GAP;
             int y = ins.top + V_GAP;
             int n = getComponentCount();
             if (n == 0) return;
             Component comp = getComponent(0);
             Dimension dc = comp.getPreferredSize();
             int w = dc.width;
             int h = dc.height;
    //fl+ 03.09.2003
             if (getParent() == null) return;
    //fl-        
             Dimension dp = getParent().getSize();
             int nCol = Math.max((dp.width-H_GAP)/(w+H_GAP), 1);
             int nRow = n/nCol;
             if (nRow*nCol < n) nRow++;
             int index = 0;
             for (int k = 0; k<nRow; k++) {
                for (int m = 0; m<nCol; m++) {
                   if (index >= n) return;
                   comp = getComponent(index++);
                   comp.setBounds(x, y, w, h);
                   x += w+H_GAP;
                y += h+V_GAP;
                x = ins.left + H_GAP;
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    ******************************PagePreview.java***********************************************************************************
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Image;
    import java.awt.Insets;
    import javax.swing.JPanel;
    * PagePreview.java
    * Created on 04 &#1603;&#1575;&#1606;&#1608;&#1606; &#1575;&#1604;&#1579;&#1575;&#1606;&#1610;, 2008, 10:25 &#1605;
    import javax.swing.border.MatteBorder;
    * @author  TAREQ145
    public class PagePreview extends JPanel {
         protected int m_w;
         protected int m_h;
         protected Image m_source;
         protected Image m_img;
        /** Creates new form BeanForm */
        public PagePreview() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
        }// </editor-fold>                       
        public PagePreview(int w, int h, Image source) {
             m_w = w;
             m_h = h;
             m_source = source;
             m_img = m_source.getScaledInstance(m_w, m_h, Image.SCALE_SMOOTH);
             m_img.flush();
             setBackground(Color.white);
             setBorder(new MatteBorder(1, 1, 2, 2, Color.black));
          public void setScaledSize(int w, int h) {
             m_w = w;
             m_h = h;
             m_img = m_source.getScaledInstance(m_w, m_h, Image.SCALE_SMOOTH);
             repaint();
          public Dimension getPreferredSize() {
             Insets ins = getInsets();
             return new Dimension(m_w+ins.left+ins.right,
                m_h+ins.top+ins.bottom);
          public Dimension getMaximumSize() {
             return getPreferredSize();
          public Dimension getMinimumSize() {
             return getPreferredSize();
          public void paint(Graphics g) {
             g.setColor(getBackground());
             g.fillRect(0, 0, getWidth(), getHeight());
             g.drawImage(m_img, 0, 0, this);
             paintBorder(g);
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }please help me
    thankz

  • Print JTable with column heading

    Hi,
    I'm very new to this JTable. I'm try to print a Jtable using the print() function (from JDK 1.5)
    JTable.print(JTable.PrintMode.FIT_WIDTH, new MessageFormat(
    _tabledata.getTitle() ),
    new MessageFormat("Page {0,number}"));
    The problem I have is that some time it print and other time it doens't print. Also, if it doesn't print, then the program become very slow or not respond. Is that the probelm with the new JDK or am I doing something wrong?
    Thanks for you help.

    Don't rely on JTable.print() methods too much.
    Sadly Sun didn't think anyone would need to print anything from java so support was added late and half heartedly (programmers hate printing stuff)
    If you are new to java you need to focus on something simpler than printing documents; unfortunatly printing is a tedious burdonsome task for experreineced developers
    for example: learn how to output your data from a table into an HTML formate/file; you can build beautiful reports/printouts easily and view them in java components easily but you will probably want to print them from a browser.
    Even if you find a class or two to help with your printing efforts on the net you will find you need to know many other generic complicated aspects of java to continue
    Sean

  • I am having trouble with custom color settings. It randomly reverts back to North American General Purpose without warning. This is a big problem for me. My customers (professional photographers) expect consist colors in my printing. Help!

    I am having trouble with custom color settings. It randomly reverts back to North American General Purpose without warning. This is a big problem for me. My customers (professional photographers) expect consist colors in my printing. Help!

    Do you even know how to nuke and re-set Photoshop's preferences, colorplak?  Your last post seems to reveal that you don't understand what I'm talking about. Here's a link you can click on:
    Preference file functions, names, locations | Photoshop CC
    To re-create the preferences files for Photoshop, start the application while holding down Ctrl+Alt+Shift (Windows) or Command+Option+Shift (Mac OS). Then, click Yes to the message, "Delete the Adobe Photoshop Settings file?"
    Note: If this process doesn't work for you while you're using a wireless (bluetooth) keyboard, attach a wired keyboard and retry.
    Important: If you re-create the preferences by deleting the Adobe Photoshop CC Settings file, make sure that you only delete that file. If you delete the entire settings folder, you also delete any unsaved actions or presets.
    Reinstalling Photoshop does not remove the preferences file. Before reinstalling Photoshop, re-create your preferences.
    Note for Photoshop 14.1 and later: If you use Generator and reset your Preferences, Generator is disabled. Choose Preferences > Plug-ins to turn it back on.
    Video: Julieanne Kost created a video that takes you through two ways of resetting your Photoshop preferences. The manual preference file removal method is between 0:00 - 5:05. The keyboard shortcut method is between 5:05 - 8:18. The video is located here.
    Mac OS
    Important: Apple made the user library folder hidden by default with the release of Mac OS X 10.7. If you require access to files in the hidden library folder to perform Adobe-related troubleshooting, see How to access hidden user library files.

  • XSLT mapping Help Required.

    XSLT mapping Help Required.
    Hi Experts,
    I am New to XSLT Mapping. I am practising the below Example:
    InputXML File:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    XSL StyleSheet File:
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
    Xmlns:ns1=”http://XYZ.com/Test”>
    <xsl:template match="/">
    <ns1:MT_XSLT_Target>
    <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
    <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
    </Name>
    <Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
    ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
    <City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
    </ns1:MT_XSLT_Target>
    </xsl:template>
    </xsl:stylesheet>
    The Desired Output shuold be:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
    <Title>Male</Title>
    <Name>Anshul Chowdhary</Name>
    <Street>83/b 2nd Main</Street>
    <City>Mysore</City>
    </ns1:MT_XSLT_Target>
    I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
    Anshul Chowdhary Male 2nd Main 83/b Mysore
    I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
    Regards,
    GIRIDHAR

    Hi,
    I have used below for testing.
    Input xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
    <ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
    <Person>
    <FirstName>Anshul</FirstName>
    <LastName>Chowdhary</LastName>
    <Gender>Male</Gender>
    <Address>
    <Street>2nd Main</Street>
    <Houseno>83/b</Houseno>
    <City>Mysore</City>
    </Address> </Person>
    </ns0:MT_XSLT_Source>
    xsl code:
    <?xml version='1.0' encoding="UTF-8"?> 
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen" 
        xmlns:ns1="http://XYZ.com/Test"> 
        <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> 
        <xsl:template match="/"> 
            <ns1:MT_XSLT_Target> 
                <Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title> 
                <Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/> 
                </Name> 
                <Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '), 
                    /ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street> 
                <City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City> 
            </ns1:MT_XSLT_Target> 
        </xsl:template> 
    </xsl:stylesheet>
    For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
    Regards
    Venkat

  • Urgent help required: Query regarding LC Variables

    Hi All
    Sometime earlier I was working on a performance issue raised by a customer. It was shell script that was taking almost 8-9 hrs to complete. During my research I came across a fact that there were some variables which were not set, the LC variables were impacting the sort funnel operations because of which the script was taking a long time to execute.
    I asked them to export the following commands, after which the program went on smoothly and finished in a couple of mins:
    export LC_COLLATE=en_US.ISO8859-1
    export LC_MESSAGES=C
    export LC_MONETARY=en_US.ISO8859-1
    export LC_MONETARY=en_US.ISO8859-1
    export HZ=100
    export LC_CTYPE=en_US.ISO8859-1
    export LANG=en_US.UTF-8
    Later I did recover that setting the LC_COLLATE to C, is not helping and the program was again taking a lot of time. Few questions that I want to ask are:
    1. Can someone please tell me, what each of these variable mean and how these values make a difference.
    2. When I exported LC_COLLATE=en_US.ISO8859-1, it worked fine, but when i tried with the defalut value LC_COLLATE=C, then why the program didnt work.
    As this issue is still going on, hence I would request All to provide their valuable inputs and let me know as much as possible.
    Appreciate your help in this regard.
    Thanks
    Amit
    Hi All
    A new development in this regard. The customer has send us a screen shot in which they were trying to export the locale variable using the commands which I have pasted above. I can see in the screen shot that while exporting LC_COLLATE and LC_TYPE, they get a message that ""ksh: export: couldn't set locale correctly"".
    Request everyone to please give their inputs as it's a bit urgent.
    Thanks for all the help in advance.
    Thanks
    Amit
    Some help required please...
    Edited by: amitsinhaengg on Jul 22, 2009 2:03 AM
    Edited by: amitsinhaengg on Jul 22, 2009 2:06 AM

    LC_CTYPE
    Controls the behavior of character handling functions.
    LC_TIME
    Specifies date and time formats, including month names, days of the week, and common full and abbreviated representations.
    LC_MONETARY
    Specifies monetary formats, including the currency symbol for the locale, thousands separator, sign position, the number of fractional digits, and so forth.
    LC_NUMERIC
    Specifies the decimal delimiter (or radix character), the thousands separator, and the grouping.
    LC_COLLATE
    Specifies a collation order and regular expression definition for the locale.
    LC_MESSAGES
    Specifies the language in which the localized messages are written, and affirmative and negative responses of the locale (yes and no strings and expressions).
    You can use command
    # locale -k LC_CTYPE
    to see more detail about each type.

  • Help required - Sales order item is partially delivered but the item grayed

    I have a sales order 123 having say item10 with qty 1, item20 with qty 10 , item 30 qty 12
    Item 1 confirmed qty 1 and delivered qty is 1
    Item 2 confirmed qty 10 and delivered qty 10
    Item 3 confirmed qty 1 and delivered qty is 1
    Now the item3 still has open requirements of 11 to be delivered. But the item is GRAYED OUT already.
    even if I do ATP the qty is not confirming for the remaining 11 pieces.
    Why is that? How to make that item out from GRAY.
    How to confirm the remaining 11 qty for that item.
    Help required as early as possible.
    Appreciate ur help guys
    Radha

    hi Radha, how are you ?
         ---the partial deliveries in master data must have not been mentioned.
         ---the deliveries should be upto target quantity.
         ---check order type, item category and schedule line category.
         ---check unrestricted stock availability.
    thank you
    regards
    Khera.

  • Is it possible to print JTable and custom JPanel on the same page?

    Hello everybody!
    I have a custom panel extending JPanel and implementing Printable.
    I am using paint() method to draw some graphics on it's content pane. I would like to print it, but first I would like to add a JTable at the bottom of my panel. Printing just the panel goes well. No problems with that.
    I was also able to add a JTable to the bottom of JFrame, which contains my panel.
    But how can I print those two components on one page?

    Hi, thanks for your answer, but I thought about that earlier and that doesn't work as well... or mybe I'm doing something wrong. Here is the sample code:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.print.PageFormat;
    import java.awt.print.Printable;
    import java.awt.print.PrinterException;
    import java.awt.print.PrinterJob;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    public class ReportFrame extends JFrame implements Printable {
         private static final long serialVersionUID = -8291124097290245799L;
         private MyPanel rp;
         private JTable reportTable;
         private HashPrintRequestAttributeSet attributes;
         public ReportFrame() {
              rp = new MyPanel();
              String[] columnNames = { "Column1", "Column2", "Column3" };
              String[][] values = { { "Value1", "Value2", "Value3" }, { "Value4", "Value5", "Value6" }, { "Value7", "Value8", "Value9" } };
              reportTable = new JTable(values, columnNames);
              add(rp, BorderLayout.CENTER);
              add(reportTable, BorderLayout.SOUTH);
              setTitle("Printing example");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setPreferredSize(new Dimension(700, 700));
              pack();
              setVisible(true);
         @Override
         public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
              if (pageIndex >= 1)
                   return Printable.NO_SUCH_PAGE;
              Graphics2D g2D = (Graphics2D) graphics;
              g2D.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
              return Printable.PAGE_EXISTS;
         public static void main(String[] args) {
              new ReportFrame().printer();
         class MyPanel extends JPanel implements Printable {
              private static final long serialVersionUID = -2214177603101440610L;
              @Override
              public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
                   if (pageIndex >= 1)
                        return Printable.NO_SUCH_PAGE;
                   Graphics2D g2D = (Graphics2D) graphics;
                   g2D.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
                   return Printable.PAGE_EXISTS;
              @Override
              public void paint(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2D = (Graphics2D) g;
                   int x = 0, y = 0, width = 70, height = 70;
                   for (int i = 0; i < 50; i++) {
                        g2D.drawOval(x + i * 10, y + i * 10, width, height);
         public void printer() {
              try {
                   attributes = new HashPrintRequestAttributeSet();
                   PrinterJob job = PrinterJob.getPrinterJob();
                   job.setPrintable(this);
                   if (job.printDialog(attributes))
                        job.print(attributes);
              } catch (PrinterException e) {
                   JOptionPane.showMessageDialog(this, e);
    }UPDATE:
    I've managed to get this to work, by calling 2 methods inside the outer frame's print method (lines 78 and 79)
    Those two methods are:
    rp.paint(g2D);
    reportTable.paint(g2D);but still it is not the way I would like it to be.
    First of all both the ReportPanel and ReportTable graphics are printed with the upper-left corner located in the upper-left corner of the JFrame and the first one is covering the second.
    Secondly, I would like to rather implemet the robust JTable's print method somehow, because it has some neat features like multipage printing, headers & footers. But I have no idea how to add my own graphics to the JTables print method, so they will appear above the JTable. Maybe someone knows the answer?
    Thanks a lot
    UPDATE2:
    I was googling nearly all day in search of an answer, but with no success. I don't think it's possible to print JTable using it's print() method together with other components, so I will have to think of something else i guess...
    Edited by: Adalbert23 on Nov 22, 2007 2:49 PM

  • Search Help with in a serach help required in SRM 4.0

    Hi,                                                     
    Requirement: Search help required for Product Category field in the Search help for Product(BBPH_PRODUCT) in SRM portal.
    This search help is used in Create shopping Cart transaction. The hyper link on Internal Goods/Services leads to the search help BBPH_PRODUCT. 
    My analysis:           
    The field Product Category (CATEGORY_ID) has search help(COM_CAT_HIER) attached to its data element. When I single test the search help BBPH_PRODUCT in SAP GUI,I can see the search help for field product category in the selection dialogue box. However the same does not appear on the corresponding screen in HTML.
    Please let me know whether I need to do some thing to make the search help appear on the HTML screen?
    With Regards,         
    Prakash Kamath

    Hi Prakash,
    I have the same problem but with another field. Unloading point. Could you please tell me how did you solve this problem with displaying F4 help on html/ SRM portal?
    Thank you very much.
    Best regards,
    Danijela ZIvanovic

Maybe you are looking for