Printing elements of a table

I've got the printing problem fixed but I'm trying to print elements of an array onto paper. It keeps giving me an unclosed character compiler error. Am I using the wrong method?
class PaintCover implements Printable{
Font fnt = new Font("Helvetica-Bold", Font.PLAIN, 12);
public int print(Graphics g, PageFormat pf, int pageIndex)
throws PrinterException{
g.setFont(fnt);
g.drawString('" + hold[0] + "'), 100, 200)");
return Printable.PAGE_EXISTS;
the hold field is an array field I have loaded further up in my code.

Your reply is not polite either I might add. Since when did you become the newsgroup etiquette committee.

Similar Messages

  • Get selected elements from a table

    Hi all,
    I have a requirement like i m enhancing standard component in that i have added one button on click of that i want fetch the selected line item from the table ( which is a normal table). selection mode is auto.
    i tried with  the following code.
    DATA:lr_element                   TYPE REF TO if_wd_context_element,
           lv_index                     TYPE i.
    *--Get selected element
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
    ****Here itself its throughing dump because lr_element is initial***************
    *--get selected element index.
      lv_index = lr_element->get_index( ).
    can any one help me what is the wrong.. else suggest me how to get the selected elements from a table....
    Thanks in advance.

    *--Get selected element
    lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
    if  lr_element is bound.
    lv_index = lr_element->get_index( ).
    endif.
    Instead you can directly read the node if that row is a lead selected one.
    lo_node = wd_context->get_child_node( name = 'EMP' ).  "Emp is node name
    lo_ele = lo_node->get_lead_selection( ).
    or
    lv_index = lo_node->get_lead_selection_index( ).
    where is the above code written..is it written in OnLeadSelect event of the TABLE..
    can any one help me what is the wrong.. else suggest me how to get the selected elements from a table....
    As the selection mode is Auto there is no multiple selection..hence try to use the lead selection only.
    Edited by: Lekha on Jan 3, 2012 6:47 PM

  • How to get Index of a single element in a table

    Hi Gurus,
    I need to get the index number of the element in a table even if the row is not selected.
    I've already searched the forum for this but all i'm getting are selected rows in the table.  I need to get the index even if that elemen's row is not selected in the table.
    Please advise.
    Regards,

    Hi,
    Could you please specify what exactly you want to do?
    You said you want to get the index of an element even if the corresponding row is not selected. But there might be more than one element where the correponding rows are not selected. So it would be better if you could be more specific about what you want to achieve.
    Regards,
    Srilatha

  • How to insert a text edit UI element  in a table

    hi all,
    I want a text edit UI element in a table .I do not want input field because text entered can be very long and whole text cant be seen then.Is there any way to increase the width of input field if i insert an input field ? or what can be other solution for this?

    Hi Govind,
    You can't insert Text Edit as a cell variant in table. But you can increase the 'Width' property of Input Field, say to 500px or as per your requirement, so that you can display the full text at one go. Or you can bind the 'Width' property to a context and set the width at run time as per the text length.
    Thanks,
    Sumit

  • Regarding Link to URL UI Element in a table

    Hi All,
    I am using "link to url" UI Element in a table column. I have mapped the column (i mean the "reference" property of "link to url" UI to a bapi node). Now, when I am populating the table, for some rows the bapi is not returning the url links. So, the column is getting disabled and not even showing the links for the rows which are getting the url link from the bapi.
    Is there any way to set the mapping row wise, so that the rows which have data get enabled with the link and which do not have data will be disabled.
    Also, can I make the whole table readonly, except for one column.
    Please help me in this regard.
    Regards,
    Murthy.

    Hi Armin,
    Thank you very much. The problem is solved. 10 points for you.
    Another Question.......
    Can we make the table readonly, leaving just one column to select.(that is the column with link to url). Is it possible? If so, please tell me how....
    Also, can you tell me the reason for the following exception.....
    <b>com.sap.tc.webdynpro.progmodel.context.ContextConfigurationException: DataNodeInfo(CreateTemplateComp.Zad_Bapi_Get_Template_Details_Input.Output.T_Template_Details): structure field Ad_Height not found
        at com.sap.tc.webdynpro.progmodel.context.DataAttributeInfo.init(DataAttributeInfo.java:299)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.initUnmappedAttributes(NodeInfo.java:687)
        at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:238)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:671)
        at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
        ... 49 more</b>

  • Insert a new Dropdown UI-Element in a Table header

    Hello,
    i need to insert a Dropdown UI-element in a Table header, i was looking in the forum and the Web, BUT i didnt find anythinf that can help.
    please schow me how can I insert a DropDown UI-Element in the Header.
    thank you all

    Hello,
    You can normally create a table. Insert a table column and for the table column you need to give Dorpdown by Key / index as a cell editor.
    Thanks,
    Raju Bonagiri

  • Clickable UI element in a table tree as a child

    Hi experts,
    I haev created a tree in a table column. And in a treebykeytable coumn of a table, what type of cell editor can be included so that we can capture a event on a click of it.
    I.e once a child is clicked- I want to caoture the value of child clicked and navigate further.
    I dont want to use linktoaction UI element and moreover table need initialze lead selection and on using linktoaction, for clicking any child it capture only root value i.e lead selected by default.
    Thanks
    Depesh

    https://www.sdn.sap.com/irj/sdn/nw-70
    would help you
    regards
    nag

  • FileDownload UI Element in a table

    I'm tryign to use FileDownload UI Element in a table, but it seems not to work.
    I have defined a binary, an IWDAttributeInfo and a IWDModifiableBinaryType attributes in the same context node of the table.
    In wdDoInit() I wrote the following code:
    for (int i=0;i<wdContext.nodeFileTab().size();i++)
    try {
    wdContext.nodeFileTab().getFileTabElementAt(i).setAttInfo(wdContext.nodeFileTab().getNodeInfo().getAttribute(IPrivateView_pdfView.IFileTabElement.T_FILE_DOWNLOAD));
    wdContext.nodeFileTab().getFileTabElementAt(i).setBinaryType((IWDModifiableBinaryType)wdContext.nodeFileTab().getFileTabElementAt(i).getAttInfo().getModifiableSimpleType());
    wdContext.nodeFileTab().getFileTabElementAt(i).getBinaryType().setFileName(wdContext.nodeFileTab().getFileTabElementAt(i).getFilename());
    wdContext.nodeFileTab().getFileTabElementAt(i).getBinaryType().setMimeType(WDWebResourceType.PDF);
    wdContext.nodeFileTab().getFileTabElementAt(i).setTFileDownload(this.getByteArrayFromResourcePath("/sapmnt/PCD/global/config/cm/etc/pdf/"+wdContext.nodeFileTab().getFileTabElementAt(i).getFilename()));
    catch (Exception e)
    wdComponentAPI.getMessageManager().reportException(e.toString(),true);
    As result each row download the file in the last row. Is there any other way I can try?

    Hi Anita,
    you cannot set metadata at element level of a node. When you set the metadata ( example mime type or file name ) for a particular element in the node , it changes for all the element. So you are always getting the file for the last row. ( most recent set metadata ).
    Try using the inteface IWDCachedWebResource for file download.
    For each row add a button, and associate an action "DownloadFile" for it. Use the following "onAction" for the said action. 
    public void onActionDownloadFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionDownloadFile(ServerEvent)
        int selectedIndex = wdContext.nodeFileTab().getLeadSelection();
        IPrivateView_pdfView.IFileTabElement file = wdContext.nodeFileTab().getFileTabElementAt(selectedIndex);
        try {
         IWDCachedWebResource webResource = WDWebResource.getWebResource(
              this.
              getByteArrayFromResourcePath("/sapmnt/PCD/global/config/cm/etc/pdf/"+
              wdContext.nodeFileTab().getFileTabElementAt().getFilename(selectedIndex),
              WDWebResourceType.PDF);
         wdComponentAPI.getWindowManager().createExternalWindow(webResource.getURL(),"Download File",true).open();
       catch(Exception e) {
         // take some action
         wdComponentAPI.getMessageManager().reportException(e.toString(),true);
        //@@end
    Hope you get a solution.
    Regards
    KK.

  • Creating a "Print View" of a Table on Another Sheet

    Hi-
    I would like to create a "print view" of a table on another sheet that already has reorganization filters applied to it.  There is a template in Numbers called "Employee Schedule" that has exactly this, where the "printable" table's cells simply reference every cell in the source table on the other sheet.
    I know there is a way to very quickly (i think with a dragging motion), create the references in each cell in one or two operations, as opposed to going to each individual cell and typing in the reference to the source table.  I saw a post about how to do this a while back but cannot seem to locate it again
    How do I do this?  Thanks again for everyones help ;-)
    Thanks
    Matt

    mattford1 wrote:
    Hi-
    Re-reading this, I don't think this answered my question.  I understand how to reference a single cell, but how do you reference an entire table easily without having to go to each cell.
    Thanks
    Matt
    Matt,
    Select the first cell by clicking once on it, such that the border is highlighted. Then grab the little circle in the lower right corner of the border and drag it to the end of your table, either right or down. You can use this method to fill down or to the right. Sometimes it can be fussy, and if it refuses to behave, then you can use the alternate method, Copy and Paste. Click once on the first cell and Command-C. Shift-click the last cell and Command-V.
    Jerry

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • How to get selection screen elements and its table reference of a report ?

    halo experts
    How can I get selection screen elements and its table reference of a report ? . I tried rs_refresh_from_select_options. But I am unable to get the table and field it is referring to
    For eg if my selection screen 1000 is
    parameters: p_carrid type spfli-carrid,
    select-options :s-_connid type sflight-connid.
    is there any Fm or method which gives me what are the screen elements( p_carrid and s_connid ) and what table( splfi and sflight ) and field ( carrid and conid )it is referring to ?

    The following code is an example of how you might dynamically determine all your PARAMETERS and SELECT-OPTIONS variables at run time.  The PARAMETERS and SELECT-OPTIONS only point to a dictionary element--not a specific table.  Even though you may say "spfli-carrid" or "sflight-connid", the data type really references the dictionary type and not a specific table/structure.
    REPORT  ZTEST_PROG.
    TABLES sflight.
    DATA:
           screen_tab TYPE STANDARD TABLE OF screen,
           wa_screen TYPE screen,
           scrn_nm TYPE string,
           scrn_leftover TYPE string,
           l_type TYPE REF TO cl_abap_typedescr,
           typ_nm TYPE string,
           typ_pre TYPE string.
    FIELD-SYMBOLS <fs_data> TYPE ANY.
    PARAMETERS p_carrid TYPE spfli-carrid.
    SELECT-OPTIONS s_connid FOR sflight-connid.
    INITIALIZATION.
      LOOP AT SCREEN.
        IF screen-group3 = 'PAR'
          OR screen-group3 = 'LOW'.
            APPEND screen TO screen_tab.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION.
      LOOP AT screen_tab INTO wa_screen.
        ASSIGN (wa_screen-name) TO <fs_data>.
        l_type = cl_abap_typedescr=>describe_by_data( <fs_data> ).
        IF wa_screen-group3 = 'LOW'.
          SPLIT wa_screen-name AT '-' INTO scrn_nm scrn_leftover.
          TRANSLATE scrn_nm TO UPPER CASE.
        ELSE.
          scrn_nm = wa_screen-name.
        ENDIF.
        SPLIT l_type->absolute_name AT '=' INTO typ_pre typ_nm.
        WRITE:
                 / 'Screen Name:  ', scrn_nm,
                 / 'DDIC Type:    ', typ_nm.
      ENDLOOP.
    When you get into defining internal tables you can determine those at run time with cl_abap_structdescr.  The following is an example of how you might do that.  You can loop through the "components_table" and evaluate each field of the structure in this way.
    DATA: structure_reference TYPE REF TO cl_abap_structdescr,
          components_table TYPE abap_compdescr_tab,
          components_structure LIKE LINE OF components_table.
    structure_reference ?= cl_abap_structdescr=>describe_by_data( any_structure ).
    components_table = structure_reference->components.
    I don't know if this answers any of your questions but I hope that some of it is useful.

  • REG: How to add elements onto htmlb table cell.. URGENT PLZ HELP

    Hi all,
    I have created a htmlb table. And the jsp code is as follows
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <jsp:useBean id="myBean" scope="application" class="com.linde.myaccounts.util.TableBean" />
    <hbj:content id="myContext">
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
       <hbj:tableView id="myTableView1"
                          model="myBean.model"
                          design="ALTERNATING"
                          headerVisible="false"
                          footerVisible="false"
                          fillUpEmptyRows="true"
                          visibleFirstRow="1"
                          visibleRowCount="5"
    </hbj:form>
      </hbj:page>
    </hbj:content>
                          width="500 px" >
    </hbj:tableView>
    I have used a table bean by which I am getting the column header names. I have 5 columns, I have to add input field in the first column, checkbox in the second column, leave the third column blank, checkbox in the fourth column and again a input field in the fifth column. I am not understanding on how to add this elements onto the table. Will I add it from the JSP using <hbj:tableViewColumns> tag or I have add them in the bean or in the dynpage. Kindly someone give me the code for this...
    This is very urgent..Kindly help...
    Thanks in advance,
    Priyanka

    Hi,
    Have you tried looking at the examples that come with the PDK for all of the HTMLB elements?  From memory, there should be a small table example or 2 that have different types of columns shown similar to what you want - they have the full source code with them for you to look at.
    If you are working in a portal, go to the Java Developer tab and I "think" there should be a tab linking to HTMLB documentation and examples - sorry I can't be more specific but I don't have access to a portal at the moment so am trying to remember.
    Gareth.

  • Read elements of a table

    HI all,
             I have a table with about 100 rows and 6 columns. I want to read each and every element of the table for implementing some checks and using each of them individually further. Could you please help me, how to do so.
    Cheers Umang

    Hi,
    use the following code choose one of them based on your requirement
    code is based on the node called "Orders" and its Elements so you need to change this according to yours
    for(int x=0; x<wdContext.nodeOrders().size(); x++)
                //Generic Approach
                IWDNodeElement element = wdContext.nodeOrders().getElementAt(x);
                Object obj = element.getAttributeValue("<Your Attribute Name>");
                //Typed Approach
                IOrdersElement element2 = wdContext.nodeOrders().getOrdersElementAt(x);
                String type = element2.getOrderType();
    Regards
    Ayyapparaj

  • LinkToUrl Element in a Table SP10

    Hy All,
    i have an LinkToUrl-Element in a Table (Cell).
    After the click on the link (or symbol) the next step (navigation to another view) was triggered. This works fine.
    After installation of SP10 this is not working. If the link was pressed, no action is fired. All properties for me are ok.
    I don't know, what can i do ?
    Any idea's ?
    Regards
    Jürgen

    Hy Armin,
    the URL is ok !
    If i click the right mouse button, Open Link or open link in a new window, the url is opened correctly. All is fine!
    the LinkToURL UI-Element is enabled.
    I hava a service function on that element, and checked (logged) the status of that property.
    Regards
    Jürgen

  • Pb for printing elements values

    This modified sample code for printing elements values doesn't seems to work ?
    an idea ? VALUE is always empty !
    -- prints elements in a document
    procedure printElements(doc xmldom.DOMDocument) is
    nl xmldom.DOMNodeList;
    len number;
    n xmldom.DOMNode;
    begin
    -- get all elements
    nl := xmldom.getElementsByTagName(doc, '*');
    len := xmldom.getLength(nl);
    -- loop through elements
    for i in 0..len-1 loop
    n := xmldom.item(nl, i);
    dbms_output.put_line('TAG ' &#0124; &#0124; xmldom.getNodeName(n));
    dbms_output.put_line('VALUE ' &#0124; &#0124; xmldom.getNodeValue(n)); -- Added line
    end loop;
    dbms_output.put_line('');
    end printElements;
    null

    getNodeValue() for elements will always be null since elements do not have a node value.
    Attribute nodes have a value <foo attr="yes"/>
    Text nodes have a value.
    Comment nodes have a value.
    PI nodes have a value.
    So, where you are asking for the
    value of an element, you likely
    intend to be getting the
    value of the Text node child
    of that element as in:
    <foo>Some Value</foo>
    The <foo> element has no value, but
    it has a Text-Node child with
    a value of "Some Value"

Maybe you are looking for