Print object name

Hi all,
I am new to Java learning, I would like to print the object name in below program.
Output should look like
bike1 Cadence :40 speed :12 Gear :1
bike2 Cadence :50 speed :60 Gear :2
What are the changes I need to do to get the desired output.
* To change this template, choose Tools | Templates
* and open the template in the editor.
package abbhilash;
* @author admin
class Bicycle {
    int cadence = 0;
    int speed   = 0;
    int gear    = 1;
    void changeCadence(int newValue)
        cadence = newValue;
    void changeGear(int newValue)
        gear =newValue;
     void increaseSpeed(int increment)
        speed = speed + increment;
      void decreaseSpeed(int decrement)
        speed = speed - decrement;
      void printStatus()
          System.out.println("Cadence :" + cadence + " speed :" + speed
                  + " Gear :" + gear);
class BicycleDemo {
     public static void main(String[] args)
         //create two bicylce objects
         Bicycle bike1 = new Bicycle();
         Bicycle bike2 = new Bicycle();
         bike1.changeCadence(40);
         bike1.changeGear(1);
         bike1.increaseSpeed(12);
         bike1.printStatus();     
         bike2.changeCadence(50);
         bike2.changeGear(2);
         bike2.increaseSpeed(60);
         bike2.printStatus();
}Thanks
Raghu

Hi Raghu,
Here you already have the object, so you have the object name as well. All you need is to print the name. So you can pass the name of object as parameter to printStatus() method and you are done. Code changes are below:
void printStatus(String name)// here String parameter is added
          System.out.println(name + " Cadence :" + cadence + " speed :" + speed
                  + " Gear :" + gear);
      }And inside the main method call the printStatus() method with object name.
bike2.printStatus("bike1 ");      // calling with the name of object
bike2.printStatus("bike2 ");Amit

Similar Messages

  • How to print object name

    Could anyone please guide me. I am passing an object to another class and then I want to print this object name in that class. when I try to print it either by giving the object in print method or after converting it with tostring and print, it always prints the object memory location but it doesn't print its name.

    That memory location you're seeing is the output of the toString method defined in Object. If you want something better, override that method. Overriding toString is often (even usually, maybe always) a good thing to do.
    You have to define what "name" means though. You can't print the name of the variable that points to an object, because many variables can and that kind of information is often compiled away anyway. Furthermore, information about an object should be encapsulated within the object, generally.
    So the most typical and probably best approach is to create a "name" attribute in the object.

  • Find object Names in a file and print all those objects Names

    Hi All,
    I am new to this forum.
    I want to know how to read only objects names in txt file. In the text file i have sql queries, package names, Function Name. I need to read all the objects and display out put. The file contains around 20000 Lines.
    Please suggest me.
    Thanks & Regards
    Suresh.

    Gurram wrote:
    want to read .rex File. The file contains combination of SQL code with table Names, Packages,Functions,There are three basic ways to read an external file.
    You can use UTL_FILE and use standard/basic file I/O calls like fread() and fwrite() - common amongst most (if not all) programming languages.
    You can define an external table for the file, and SQL*Load the contents of the file dynamically via a SQL SELECT statement.
    You can load the file into a CLOB using DBMS_LOB and then process it - quite useful if the text file is XML as the XMLTYPE supports parsing a a CLOB containing XML.
    I want to pick Each object name put in a separate file line by line.That in turn will need to use UTL_FILE to create an external file.
    Keep in mind though that your in a database environment with PL/SQL. The very best place for data is inside the database in SQL tables. Not outside as external files. Thus you need to ask yourself whether dealing this way with external files is the best solution, and a robust and scalable one.
    Granted, many times from the database side we need to deal with external files. The optimal method usually is to load that file's data into a database table as structured data - data that can be accessed via SQL and sorted, filtered, aggregated and analysed.
    To provide a "file" as output - this should ideally be done directly from structured data (SQL tables). And can be done using HTTP (via a web enabled PL/SQL procedure that supplies the file content as a http Mime stream), using FTP (via <i>UTL_TCP</i>) or as a CLOB via a PL/SQL call interface. Using UTL_FILE is not necessarily the only option.

  • Printing the Name and State of Servers

    Hi,
    Please can somebody help in executing the below mentioned code which will print the name and state of the servers.
    Below Java file taken from the following location : http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/core/index.html
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.Hashtable;
    import javax.management.MBeanServerConnection;
    import javax.management.MalformedObjectNameException;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    public class PrintServerState {
    private static MBeanServerConnection connection;
    private static JMXConnector connector;
    private static final ObjectName service;
    // Initializing the object name for DomainRuntimeServiceMBean
    // so it can be used throughout the class.
    static {
    try {
    service = new ObjectName(
    "com.bea:Name=DomainRuntimeService,Type=weblogic.management.
    mbeanservers.domainruntime.DomainRuntimeServiceMBean");
    }catch (MalformedObjectNameException e) {
    throw new AssertionError(e.getMessage());
    * Initialize connection to the Domain Runtime MBean Server
    public static void initConnection(String hostname, String portString,
    String username, String password) throws IOException,
    MalformedURLException {
    String protocol = "t3";
    Integer portInteger = Integer.valueOf(portString);
    int port = portInteger.intValue();
    String jndiroot = "/jndi/";
    String mserver = "weblogic.management.mbeanservers.domainruntime";
    JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
    port, jndiroot + mserver);
    Hashtable h = new Hashtable();
    h.put(Context.SECURITY_PRINCIPAL, username);
    h.put(Context.SECURITY_CREDENTIALS, password);
    h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote");
    connector = JMXConnectorFactory.connect(serviceURL, h);
    connection = connector.getMBeanServerConnection();
    * Print an array of ServerRuntimeMBeans.
    * This MBean is the root of the runtime MBean hierarchy, and
    * each server in the domain hosts its own instance.
    public static ObjectName[] getServerRuntimes() throws Exception {
    return (ObjectName[]) connection.getAttribute(service,
    "ServerRuntimes");
    * Iterate through ServerRuntimeMBeans and get the name and state
    public void printNameAndState() throws Exception {
    ObjectName[] serverRT = getServerRuntimes();
    System.out.println("got server runtimes");
    int length = (int) serverRT.length;
    for (int i = 0; i < length; i++) {
    String name = (String) connection.getAttribute(serverRT,
    "Name");
    String state = (String) connection.getAttribute(serverRT[i],
    "State");
    System.out.println("Server name: " + name + ". Server state: "
    + state);
    public static void main(String[] args) throws Exception {
    String hostname = args[0];
    String portString = args[1];
    String username = args[2];
    String password = args[3];
    PrintServerState s = new PrintServerState();
    initConnection(hostname, portString, username, password);
    s.printNameAndState();
    connector.close();
    When executing the above mentioned code getting the following error
    Exception in thread "main" java.net.MalformedURLException: Bad IPv6 address: t3:
    //localhost
    at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
    at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
    at javax.management.remote.JMXServiceURL.validate(Unknown Source)
    at javax.management.remote.JMXServiceURL.<init>(Unknown Source)
    at PrintServerState.initConnection(PrintServerState.java:39)
    at PrintServerState.main(PrintServerState.java:84)
    Caused by: java.net.UnknownHostException: t3://localhost
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
    at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getAllByName(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    ... 6 more

    Hi,
    Copy the below code and save it as PrintServerState.java,
    I also have copied the code from
    http://docs.oracle.com/cd/E21764_01/web.1111/e13728/accesswls.htm#i1116377
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.Hashtable;
    import javax.management.MBeanServerConnection;
    import javax.management.MalformedObjectNameException;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    import java.lang.*;
    public class PrintServerState {
    private static MBeanServerConnection connection;
    private static JMXConnector connector;
    private static final ObjectName service;
    // Initializing the object name for DomainRuntimeServiceMBean
    // so it can be used throughout the class.
    static {
    try {
    service = new ObjectName(
    "com.bea:Name=DomainRuntimeService,Type=weblogic.management.
    mbeanservers.domainruntime.DomainRuntimeServiceMBean");
    }catch (MalformedObjectNameException e) {
    throw new AssertionError(e.getMessage());
    * Initialize connection to the Domain Runtime MBean Server
    public static void initConnection(String hostname, String portString,
    String username, String password) throws IOException,
    MalformedURLException {
    String protocol = "t3";
    Integer portInteger = Integer.valueOf(portString);
    int port = portInteger.intValue();
    String jndiroot = "/jndi/";
    String mserver = "weblogic.management.mbeanservers.domainruntime";
    JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
    port, jndiroot + mserver);
    Hashtable h = new Hashtable();
    h.put(Context.SECURITY_PRINCIPAL, username);
    h.put(Context.SECURITY_CREDENTIALS, password);
    h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
    "weblogic.management.remote");
    connector = JMXConnectorFactory.connect(serviceURL, h);
    connection = connector.getMBeanServerConnection();
    * Print an array of ServerRuntimeMBeans.
    * This MBean is the root of the runtime MBean hierarchy, and
    * each server in the domain hosts its own instance.
    public static ObjectName[] getServerRuntimes() throws Exception {
    return (ObjectName[]) connection.getAttribute(service,
    "ServerRuntimes");
    * Iterate through ServerRuntimeMBeans and get the name and state
    public void printNameAndState() throws Exception {
    ObjectName[] serverRT = getServerRuntimes();
    System.out.println("got server runtimes");
    int length = (int) serverRT.length;
    for (int i = 0; i < length; i++) {
    String name = (String) connection.getAttribute(serverRT,
    "Name");
    String state = (String) connection.getAttribute(serverRT[i],
    "State");
    System.out.println("Server name: " + name + ". Server state: "
    + state);
    public static void main(String[] args) throws Exception {
    String hostname = args[0];
    String portString = args[1];
    String username = args[2];
    String password = args[3];
    PrintServerState s = new PrintServerState();
    initConnection(hostname, portString, username, password);
    s.printNameAndState();
    connector.close();
    Now compile it as javac -d . PrintServerState.java
    Then Execute WL_HOME/weblogic92/server/bin/setWLSEnv.sh
    Now Execute ur class file generated as
    java -classpath .:WL_HOME/weblogic92/server/lib/wljmxclient.jar PrintServerState ipaddress port username password
    The output will be as follows
    Server name: Server3.   Server state: RUNNING
    Server name: Server2.   Server state: RUNNING
    Server name: Server1.   Server state: RUNNING
    Server name: Server4.   Server state: RUNNING
    Regards
    Fabian

  • Change Print Job Name

    I have a VB.NET Windows program that load a Report file with rpt.Load(ReporFile) and after send to printer with rpt.PrintToPrinter(NumberofCopy, False, 0, 0).  I want to change the print job title. I see another  post: How to set  the CR print job name that displayed in Printer job queue? with this solution:
    CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions prnOpts;
    prnOpts.JobTitle = "hello world";
    but I don't know how to get PrintReportOptions from my ReportClientdocument. The only I know it's rdc.PrintOutputController.GetPrintOptions but this retunrn a PrintOptions object that don't have JobTitle property.
    Can someone help me ?
    thanks Filippo

    You will need to create this object and set its properties.
    The majority of properties are not ones that you will read out of the report's printoptions anyways (ie number of copies, Jobtitle, page ranges etc)
    so simply use something like:
    PrintReportOptions prOpts = new PrintReportOptions();
    prOpts.JobTitle = "Hello World";
    prOpts.AddPrinterPageRange(1,1);
    rcd.PrintOutputController.PrintReport(prOpts);

  • Problem when printing objective settings

    Hello all,
    I'm facing a problem with the printing of the objective setting. The smartform that a get displays wrong characters : '#' instead of ' ' '.
    ex: people#s instead of people's.
    It's not a smartform problem. This one receives text with '#'.
    I checked the text with tr phap-catalog and it's stored correctly.
    I don't know where I have to investigate.
    Could anyone help me?
    thanks a lot
    Karim

    Hi,
    refere this OSS note matter. May resolve your issue.
    OSSNote:960341
    Symptom
    In some device types (e.g HPLJ4, HPLJ5) you experience non-uniform character spacing in the PDF document after the PDF conversion of SAPscript or Smart Forms documents, using HELVE or TIMES fonts. You want to know the reason.
    Other terms
    CONVERT_OTF, SAPscript, Smart Forms
    Reason and Prerequisites
    The problem is not due to an error in the PDF converter but due to the fact, that the printer font, underlying the device type (e.g. Univers or CG Times in PCL-5 device types), is not available for the PDF converter and is either not available in Adobe Reader. The PDF converter has to try to simulate the layout of the printer font by means of a font which is predefined in Adobe Reader. This is done by assigning the letter widths of the printer font to the font used in Adobe Reader.
    The PDF file contains a table with letter widths, used by Adobe Reader in the output of text, for each used printer font (except PostScript fonts).
    Example:
    %Charwidth values from HP4300 HELVE 060 normal
    /Widths
    [ 278 333 500 633 633 1000 758 333 333 333 633...
    Adobe reader converts this width table, by modifying the space between each character, so that the specified letter width (= space between the current and the next letter) is kept.
    This 'Simulation' of printer fonts results in the sometimes visible irregular spaces in PDF.
    The PDF converter always uses the Helvetica Adobe PostScript font for the display of HELVE and the Times Roman Adobe PostScript font for the display of TIMES. However, for these Adobe PostScript fonts, Adobe Reader often uses a Windows TrueType font, which differs slightly from the original PostScript font.
    Solution
    Workaround: Use the POST2 PostScript device type or the PDF1 PDF device type for the PDF conversion of documents in the Latin-1 character set. They both use the Adobe PostScript fonts Helvetica or Times Roman for the HELVE/TIMES printer fonts.
    Header Data
    Release Status: Released for Customer
    Released on: 30.06.2006  12:44:06
    Priority: Recommendations/additional info
    Category: Consulting
    Primary Component: BC-CCM-PRN Print and Output Management
    Secondary Components: BC-SRV-SCR SAPscript
    OSS Note: 776507
    Symptom
    Documents printed via SAPscript or SmartForms do not print with correct special characters, e.g. ### prints instead of Japanese or Russian characters. What to do?
    Other terms
    SAPscript, SmartForms, printing, device types, OTF
    Reason and Prerequisites
    Help required to choose proper fonts in a SAPscript or SmartForm
    Solution
    When using SAPscript or SmartForms to print (or email or fax) a form from a business application, many factors influence the outcome of the actual text within the form. All these factors must be checked in order to ensure a correct printout:
    1) The language version of the form used to produce the printout.
    Example: If you want to print a French invoice, you need to have a FR version of your SAPscript or SmartForms invoice form RVINVOICE01. And the application program must specify the corresponding language key (FR) when calling the SAPscript or SmartForms API.
    2) The font selections specified in the form (possibly also in a SAPscript style or SmartStyle used in a form).
    Example: In a SAPscript form or a SmartStyle you need to specify HELVE if you want to print German text in Helvetica (or similar) font. If you want to print Japanese text, HELVE is not a valid choice but you need to specify a Japanese font like JPMINCHO in your Japanese form.
    3) The output character set of the device type
    Every printer in transaction SPAD has a "device type" assigned. Device types used by the spooler for printing support only one single specific output character set. All text from the form has to be converted (using SAP's built-in character conversion mechanism) to this output character set.
    A character set can typically support either a single language (e.g. Shift-JIS which supports only Japanese) or a set of languages (e.g. ISO 8859-1, which supports Western-European languages). It is possible that a given language (such as German) can be supported by several output character sets, e.g. you may use either ISO 8895-1 (Latin-1) or ISO 8859-2 (Latin-2) to represent German text. This is so because both character sets contain the special characters used in German.
    Example: HPLJ4000 is a HP LaserJet device type supporting the ISO 8859-1 (Latin-1) character set. ISO 8859-1 can be used to represent e.g. Dutch, English, French, German, Spanish, Swedish but NOT Russian or Japanese.
    As a consequence, it is ok to use HPLJ4000 to print English, German French etc. but not for Japanese or Russian.
    4) The set of available printer fonts for a given device type
    When formatting a document, SAPscript and SmartForms perform an automatic mapping of the font definitions in the form (e.g. "HELVE 14 point bold") and the available printer fonts of the device type. A replacement printer font is chosen, should the specified font selection not be available in the device type. Now this replacement can be problematic if a language-specific font, such as Chinese CNSONG, is specified in a form and it gets replaced by a font which does not support this language, e.g. COURIER.
    To solve this problem, font families in SE73 have language attribute assigned, e.g. some fonts are characterized as being suitable only for certain languages. And when a replacement has to be chosen because the original font from the form is not available in the device type, a replacement font is chosen which has the same language attributes.
    If no fonts for the language in question exist in the device type, the resulting font will not be able to print the special characters and you will see "wrong" output characters in the printout.
    Note on SAPscript/SmartForms Print Preview:
    The OTF Print Preview available in Windows GUI (e.g. from transaction SP01) will sometimes not show the "wrong" characters which appear on the final printout. Here is the reason: since the Print Preview runs in Windows environment, it will use Windows fonts to represent the actual printer fonts. A Windows font typically has more available characters (i.e. covers more character sets) than are actually available in a printer's resident font.
    A typical example where the Print Preview will differ from the printout is here: if you have a Chinese PCL5 printer such as CNHPLJ4 and use the Western Latin font COURIER in your document, the print preview will show you Chinese characters if you (by accident) tried to format Chinese characters in COURIER font. This is because Windows will automatically choose a font that can output Chinese characters (which is actually not Courier). But when you print the job on an actual PCL5 printer with resident Western and Chinese fonts, the Courier font will not print any Chinese characters but Western special characters instead, because the printer's resident Courier font does not include Chinese characters.
    Rule of thumb: all Asian device types (e.g. CNHPLJ4, JPHPLJ4, JPPOST, KPHPLJ4) support not only Asian fonts but also COURIER, HELVE and TIMES fonts. But these Latin fonts can only be used to print English text, not Chinese/Japanese/Korean characters.
    Which fonts are suitable for a given language?
    Language(s):            Font family to use in a form:
    Latin-1 (Western Europe/Americas) *******
    DE,EN,FR,ES,NL,SV       COURIER, HELVE, TIMES
                            (LETGOTH, LNPRINT)
    Latin-2 (Central Europe) ****************
    PL, CZ                  COURIER, HELVE, TIMES
    ISO 8859-4 (Baltic) *********************
    ET, LT, LV              COURIER, HELVE, TIMES
    ISO 8859-5 (Cyrillic) *******************
    BG, RU, SR, UK          COURCYR, HELVCYR, TIMECYR
    ISO 8859-7 (Greek) **********************
    EL                      COUR_I7, HELV_I7, TIME_I7
    ISO 8859-8 (Hebrew) *********************
    HE                      COURIER, HELVE, TIMES
    ISO 8859-9 (Turkish) ********************
    TR                      COURIER, HELVE, TIMES
    Simplified Chinese **********************
    ZH                      CNHEI, CNKAI, CNSONG
    Japanese ********************************
    JA                      JPMINCHO, DBMINCHO, DBGOTHIC
    Korean **********************************
    KP                      KPBATANG, KPDODUM, KPGULIM
                            KPGUNGSE, KPSAMMUL
    Traditional Chinese *********************
    ZF                      TWDPHEI, TWMING, TWSONG
    Thai ************************************
    TH                      THANGSAN, THDRAFT, THVIJIT
    Arabic (Unicode systems only) ***********
    AR                      ANDALE_J
    Verify your output by examining the OTF data
    When analysing printing problems of this type, be sure to check the OTF data which gets produced by SAPscript or SmartForms. OTF or "Output Text Format" is the intermediate page-description format generated from SAPscript or SmartForms. OTF will contain the final printer font names and character set/language identifiers which help to solve the problem. OTF will even name the form and the language of the form used to create the output.
    The easiest way to do this is to create a spool request from your application, run transaction SP01, use menu
    Goto->Display Requests->Settings
    and choose
    Display Mode: Raw
    Now display your spool request. If this is a SAPscript or SmartForms spool request, you will see OTF data. Each line represents one OTF command, every command starts with a 2-character cmd identifier and possibly some cmd parameters follow.
    Here is an excerpt from a sample OTF file where we highlight the most interesting commands:
    //XHPLJ8000    0700 00000000001
    IN04EALEXTEST_ZEBRA
    IN05%PAGE1
    OPDINA4  P 144  240 1683811906000010000100001
    IN06%WINDOW2
    MT0024401289
    CP11000000E
    FCHELVE  120  00109XSF100SF101110000067E X
    UL +0000000000000
    SW00067
    CT00000000
    ST0453037Dieses SF hat Stil ALEXTEST_ZEBRA mit
    The 1st line with the // (Control) command reveals the device type usedto print: HPLJ8000
    //XHPLJ8000    0700 00000000001
    The 2nd line (IN = Info command) shows the name and (internal 1-char)language key of the form:
    IN04EALEXTEST_ZEBRA
    In this case it is the English (E = EN) SmartForm ALEXTEST_ZEBRA
    The OP-line (OP = Open Page) gives the page format used in the form, it is DINA4 Portrait orientation:
    OPDINA4  P 144  240 1683811906000010000100001
    The CP (CodePage) cmd shows the SAP system codepage used to code the text and the active language. In our case it is codepage 1100 and language E = EN = English.
    CP11000000E
    Finally, the FC-cmd (Font Call) lists a printer font selected within SmartForms. Please note that every SmartForm has a designated default SmartStyle under "Form Attributes->Output Options". In addition, every text node can have a SmartStyle attached (which will override the definitions from the default style for the text). In our case the resulting printer font that was selected is HELVE 12.0 pt bold-off, italic-off.
    FCHELVE   120  00109XSF100SF101110000067E X
    Header Data
    Release Status: Released for Customer
    Released on: 22.08.2005  09:57:20
    Priority: Recommendations/additional info
    Category: Customizing
    Primary Component: BC-CCM-PRN Print and Output Management
    Secondary Components: BC-SRV-SCR SAPscript
    BC-SRV-SSF Smart Forms
    reward if useful
    regards,
    ANJI

  • How to add an variable to the object name of the arraylist

    Greetings,
    i will like to create an object for arraylist with it name concat with a variable. This is what i mean as show below.
    for i=1; i <8; i++)
    ArrayList list = new ArrayList();
    What i want when it loops, the arrayliost will auto create list1, list 2, list3 and so on until the for loops end. How do i add the variable i to the object name list?
    Thanks

    Do anyone of u mind if let me know hows the code look like?This isn't intended to be an alternative to the previous reply: in fact it's worthless unless you read the information in the link given.
    import java.util.ArrayList;
    import java.util.InputMismatchException;
    import java.util.List;
    import java.util.Random;
    import java.util.Scanner;
    public class ListListEg {
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
            Random random = new Random();
                // create the mainList outside the for loop
            List<List<Integer>> mainList = new ArrayList<List<Integer>>();
            System.out.print("How many lists would you like? ");
            try {
                int num = in.nextInt();
                if(num <= 0) {
                    System.out.println("Smartass!");
                    System.exit(1);
                    // populate the main list inside the loop
                for(int i = 0; i < num; i++) {
                    mainList.add(new ArrayList<Integer>());
            } catch(InputMismatchException ime) {
                System.out.println("Idiot!");
                System.exit(1);
                // later do stuff with the lists, which you access with get()
            for(int i = 0; i < mainList.size(); i++) {
                for(int times = 0; times < 3; times++) {
                    mainList.get(i).add(random.nextInt());
            System.out.println("The first list is " + mainList.get(0));
            if(mainList.size() > 1) {
                System.out.println("The second list is " + mainList.get(1));
            System.out.println("The last list is " + mainList.get(mainList.size() - 1));
    }(In reality all the action would not take place in one method like this, and the exception handling would be more useful and polite.)

  • Duplicate Object Name Error When Publishing Crystal Reports from BW to BOE

    Hi,
    We recently upgraded our systems (all client and server) to SP2.7 in order to solve a problem with saving Crystal Reports to BW.  Now we are experiencing a new error when trying to publish a Crystal Report from BW to BOE (either all in one step from Crystal Reports application or directly from within BW).
    Upon trying to publish a Crystal Report from BW to BOE, we get the following error:
    "An error occurred while saving and / or publishing.  The return code 1 was returned from the server.  Logon to Crystal Enterprise failed.  Unable to commit the changes to Enterprise.  Reason: Failed to commit objects to server : Duplicate object name in the same folder."
    We have repeated this issue numerous time with different reports, users and logon credentials and have verified that there are NOT any duplicate object names.
    Additionally, in some cases, the report ultimately publishes to BOE, but with the above error interruption along the way.
    Any ideas?
    Thanks,
    Josh
    Edited by: Josh Crawford on May 10, 2010 9:46 AM

    Ingo,
    Apologies for the delayed response.  We've spent a few days poking around with this issue, and had even opened a customer message for it (13641).
    In the end, it seems that the problem was somehow associated with the "Prepare this report for translation." flag in the "Save to BW Options" dialog box of Crystal Reports.  If we try to Save & Publish with the Translation flag selected, we get the duplicate entry error.  If we Save & Publish without the Translation flag selected, everything is fine.
    There are still some details we need to look into, but for the time being it looks like we don't have an issue anymore(assuming we ever did) as we're not concerned with Translation capabilities.
    If we come across the problem again, I'll post again.
    Thanks,
    Josh

  • Create directory / object name must NOT be case sensitive

    SQL Dev. 2.1 - the wizard, chosen from the left side navigator, submits a wrong create statement in which the object name becomes case-sensitive. This should not be so! Even if you write the new object name in small letters , the object name must end up in the data dictionary with capitals. kind regards Inger ([email protected])

    Which wizard? If I use a create table wizard, for example, and enter the table in lower case, this is indeed stored in the DB as upper case, as you require.
    Please provide more detail for your problem.
    Sue

  • Receivables - ARDLP Report Not Printing Country Name

    AR Report ARDLP for concurrent program Dunning Letter Generate is not printing Country Name on send to and remit to part of the letter. Though the package 'arp_addr_label_pkg.format_address' is giving the output with the country name(when I ran the package in SQL Developer) but when I run the report it is not giving the country name. What could be the reason?
    Thanks,
    Sravanthi

    Thankyou very much Nagamohan. It is printing the country now on the dunning letters. I think it was because of settings in system options though the default country was set, print home country was unchecked. When I reran the process it printed the country.
    The Statement print program also had the same issue. Now after the changing the system options, it is printing the country in the send to address but not in the remit to address if the countries are same for both send to and remit to. If they are different it is printing in both the places. Eg. If it is United Kingdom in both send to and remit to, its printing only in send to. If its united states in send to and united kingdom in remit to then its printing in the remit to area. Any idea on this?
    Thanks,
    Sravanthi

  • Print program name for the dunning form F150_FR_DUNN_01 in sapscript

    Hi,
          I am not getting the exact print program name for the dunning form F150_FR_DUNN_01 in sapscript. After an extensive search I have come across few names of print program like SAPF150D2 and SAPLF150. But still I am not understanding which one to use for the form and also how to use it. I am unable to understand which include I should use to write my code.
    Kindly help me.
    Thanking you.
    Pujarini Patra

    Hi,
    Yes, you should be able to assign F150_FR_DUNN_01 in Dunning Forms customizing:
    and yes, I too would absolutely try to go for either a Smartform or even a PDF Form (if i'd have all the necessary setup for them, like Adobe Document Services, in the system already). I have Basis 702 SP  0011and FINBASIS 600 SP 0021, so all the following technicalities refer to those releases:
    The corresponding SAP sample Forms are:
    - F150_DUNN_SF for Smartform; and
    - F150_DUNN_SF for pdf Form (don't let the name confuse you )
    I'm not entirely sure if it's a good idea to try to convert/migrate Sapscript to Smartform and the Smartform to PDF Form - have never done that  myself and don't know how good/usable the migration result is. I just take the interface of Smartform from SAP and do the rest from scratch or by copying over the common parts of our existing custom forms.
    There are the SAP Standard wrapper FMs for SF and PDF forms already in the System:
    - FI_PRINT_DUNNING_NOTICE_SMARTF calling PRINT_DUNNING_NOTICE_SF and
    - FI_PRINT_DUNNING_NOTICE_PDF calling PRINT_DUNNING_NOTICE_PDF.
    So, theoretically, all you had to do to replace SapScripts (or even to enable all three form types) is to assign a custom BTE Event handler FM to event 1720 (for correct Application), which could detect, what type of form is assigned in Customizing and call the corresponding wrapper FM.
    As a sample for coding PDF form wrapper call one could take FI_PSO_EVENT_00001720_PDF (if you have IS-PS) in the system. I'd take out the IS-PS specific "business logic" like posting dunning charges (if it does not apply to my solution) and add the logic to decide, which wrapper to call.
    The confusing part about the customizing (Table T047E) to me is that there seems to be no form type defined anywhere in there... just the FORNR field for form name, which should apparently take the names of all three form types... I'd  try to extend that table with custom Form type field and try to regenerate Table Maintenance dialog for  view Cluster VC_T047_F... That would save the whole effort to try to detect the type for  form assigned...
    Another tip, in case you didn't know it already: you should be able to see all the Customizing paths, where T047E is involved, when you enter table name in SM30 and press "Customizing" and then "Continue w/o Specifying Project":
    The selected entry is the one you are looking for to assing your custom forms, I believe.
    cheers
    Janis

  • Print group name on a page of Report

    I have sorted my data on my report, printing a group on each page of my report.
    On each page, i would like to print the name of the current group (easy) but also the name of the previous page group. How can i do that ?
    Using GroupName()...?

    duplicate - please do not post multiple times

  • Print PDF document with printer's name and date/time of print

    Hi,
    I'm pretty new to this...
    I have a PDF document and when I print it, I want the printer's name and the date/time of print to be showed on the printer's output.
    I have several printers (some local and some on network) and don't necessarly use the default one. I would like the name of the printer used, to be printed on the document.
    With var h = this.getField("Printer"); h.value = app.printerNames; I'm able to get the list of all printers available but I just need the one used.
    For the date/time, using var f = this.getField("Today"); f.value = util.printd("mmm/d/yyyy", new Date()); gives me the date/time of when the document is open, not when the document is printed. (or maybe I'm missing something?)
    I guess the date/time issue is not the major one as there is usually not much difference between the time you open the document and the time you print it.
    I'm more interested in the printer's name.
    I use Acrobat Pro 9 to edit my PDF document.
    Can anyone help me please?
    Thanks!

    This project was left aside for a while... but it's now finished!
    Thank you for the answers. It was helpful.
    Here is a step-by-step of what I did (using Adobe Acrobat 9.5.1):
    Open PDF document in Acrobat
    Select Forms -> Add or Edit Fields
    Add two text fields: one called "Today" for the date and one called "Printer" for the printer name
    Close the form editing
    Select Advanced -> Document Processing -> Set Document Actions...
    Then select Document Will Print and Edit
    Paste the following code:
    var f = this.getField("Today"); f.value = util.printd("dd mmm yyyy - HH:MM", new Date());
    var pp = this.getPrintParams();
    this.getField("Printer").value = pp.printerName;
    Save your PDF
    Enjoy!
    The date and printer name field will be automatically updated when you print the document!

  • Labview 5.1, I don't succeed to print a report (error 41002) using the full printer path name. Could you provide me examples? Thanks

    I already tried the tips given by the Document ID: 1VNE8JR5, but without any success.
    When I don't provide a printer name (or path), the Report is printed on the default printer. This printing works fine under Win98, but it doesn't work on WinNT or WinXP.

    Hello Randy,
    Thank you for your answer.
    My network printer name is "R&DHP4000TN" and the printer server name is: "SERVEUR_BDC".
    So I think the full path of the printer should be:
    "\\SERVEUR_BDC\R&DHP4000TN"
    Maybe, the printer name is too long, or the "&" is not correctly interpreted?
    What's your opinion about this ?
    Thanks
    Kind Regards
    Denis

  • Exporting a PDF so that non-printing objects show but don't print?

    I've just spent a couple hours trying to find an answer to this in the forums, but can't. (The most frustrating was one thread where the original poster said, "I found the answer here," and gave a link that went right back to the main page of the forum. Argh.)
    Okay, anyway ... what I need to do?
    I've got a document with graphics that I want to show up on the pdf when I export it, but that--if a reader prints it--don't print.
    The document looks like a 3-ring binder with "tabs" for each section--just like the real thing. But the rings and tabs go right up to the edge and look terrible when printed, and whose printer can print right at the edge of the paper, anyway? But the tabs work as navigational links while looking a the pdf, and the rings just make it look cool, so I WANT them in the pdf.
    I've tried:
    Turning the entire layer into a non-printing layer (one that "shows" but does not "print"). But when I export it to a pdf, it doesn't show up on the pdf to look at OR to print. So that doesn't work.
    Using the Attribute option to turn each object into a non-printing object, but so far as I can tell, that doesn't do a thing, because they still print from the pdf.
    Exporting with the "create pdf layers" turned on and off. Exporting with the "include non-printing items" turned on and off.
    Basically, I've pretty much tried everything. I gather, from browsing the forums, that this is POSSIBLE, but can't for the life of me figure out what to do to make it happen. (Short of hiding the tabs' layer and creating an entirely separate PDF and calling it "Print version" which is not exactly what I want to do!)
    Is there maybe some magical combination of ons and offs I need to select to make this whole thing work?
    (And, seriously, am I the only person who thinks the supporting documentation is just dreadful? I can't find anything in any of the Help screens that even mentions this, much less explains how to do it.)
    Any help is appreciated!!
    --Deb

    Partial progress...
    The button option (and, I'm using CS3, by the way--I should have said that originally) does work in terms of showing on the pdf but not printing.
    The problem is that it messes up the way the document looks.
    I said it's designed to look like a 3-ring binder with tab-dividers between each section, and each tab has a hyperlink to take you to that section.
    Now, when you've got a paper binder in front of you, the tabs stay in the same sequence, and often overlap a bit (which mine do). The problem I'm having, having turned all of them into buttons, is that when you click on any of them, it "jumps" to the front of the row, so that they don't "flow" in the correct sequence.
    Am I explaining this well? You know, the top-most tab is at the top of the pile, the next one is always below it and above the third one, and so on ... you never see the second tab on TOP of the first one. I'm trying to get the document to act as close to a hard-copy binder as I can, and it did ... except the buttons keep jostling each other for attention...
    I'm going to go play around with this some more now, but ... any suggestions? (Other than restructuring my tabs so that they don't overlap at all?)

Maybe you are looking for

  • Transfering Playlists from iPhone back to iTunes

    Is there a way to transfer my Playlists from my iPhone back to my iTunes account? I had to re-download iTunes and have recovered everything except for my 40+ Playlists. Thanks!

  • Creation Dynamic session name using BDC session Method

    Hi All, I have one typical BDC problem. If the number of records in file are crossing 80,my bdc is giving problem .So I need to split total records into sets of 80 and submit them. So I need to create the session name dynamically, pass the data dynam

  • "RESTRICTIONS PASSCODE AUTOLOCK"

    How do you either find or remove a restrictions passcode which DON,t involve restoring or wiping your ipad as ive tried both using itunes, ibackupbot, diskaid and iexplorer so far with no luck...i havent tried since ios 8 though so is there anything

  • Deleted iTunes - pleassseee help!

    Due to a virus, my computer had to be completely wiped out. Unfortunately, I was unable to back-up iTunes or do anything before having it fixed but I do still have everything on my iPod. How can I get all of my stuff off of my iPod on back onto a bla

  • ITunes error when trying to Sync iPod?

    Whenever I try to Sync my iPod to my iTunes, I get an error saying "Attempting to copt to the disk "Swing's iPod" failed. An Unknown error occurred (-53)" Now I thought it was my iPod, so I restored it and tried again. Nothing happened. Then I though