Need step-by-step help on how to set up javabean on form6i

I create a form to be run on the web,winnt server, database 8.1.7 on sun.
I need to set up a javabean on forms6i to allow users to output their file (delimited text file) to their local pc. I used TEXT_IO it works ok but the output file is saved on the server site not on the client pc. I've completed created a javabean program called TextPJC.jar and included it on ARCHIVE tag on formsweb.cfg file when I run my form it's ok.
On my form I have a field V_FILE_NAME (combo Box/List Item) to allow user to enter the file name, then press the button to create the file(on user's PC).this is my by WWHEN-BUTTON_PRESSED coding:
DECLARE
v_line VARCHAR2(2000);
button NUMBER;
button2 NUMBER;
v_file_name VARCHAR2(255);
v_prompt TEXT_IO.FILE_TYPE;
C_EIN_NMBR C.test6.CASE_PENPLN_EIN_NMBR%TYPE;
v_ein_count NUMBER;
ex_ein_notmatch EXCEPTION;
ALERT_FILE_GENERATED NUMBER;
CURSOR cur_test IS
SELECT
to_char(C_EIN_NMBR)| |'!'| |
to_char(C_OPEN_DATE)| |'!'| |
to_char(C_CLOSE_DATE)| |'+++'
FROM C.test
WHERE C_EIN_NMBR = :STPROMPT.EIN;
BEGIN
-- checking if output file name field is null or not
IF :STPROMPT.V_FILE_NAME IS NULL
THEN button := SHOW_ALERT('ALERT_MISSING_PATH');
IF BUTTON = ALERT_BUTTON1
THEN SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
GO_item(':stprompt.V_FILE_NAME');
END IF;
ELSIF :STPROMPT.EIN IS NULL
THEN button := SHOW_ALERT('ALERT_NO_EIN');
ELSIF :STPROMPT.EIN IS NOT NULL
THEN
BEGIN
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'BUSY');
SELECT COUNT(DISTINCT(C_EIN_NMBR))
INTO v_ein_count
FROM C.STPROMPT
WHERE C_EIN_NMBR C_EIN_NMBR = :STPROMPT.EIN;
IF v_ein_count = 0
THEN RAISE ex_ein_notmatch;
ELSE
v_file_name := :STPROMPT.V_FILE_NAME;
v_prompt := TEXT_IO.FOPEN(v_file_name, 'W');
TEXT_IO.PUT_LINE(v_prompt,
to_char(P_EIN_NMBR)| |'!'| |
to_char(P_OPEN_DATE)| |'!'| |
to_char(P_CLOSE_DATE)| |'+++'
OPEN cur_testl6;
LOOP
FETCH cur_testl6
INTO v_line;
EXIT WHEN cur_testl6%NOTFOUND;
TEXT_IO.PUT_LINE(v_prompt, v_line);
END LOOP;
CLOSE cur_testl6;
TEXT_IO.FCLOSE(v_prompt);
SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
-- Confirms when textfile is created.
ALERT_FILE_GENERATED := SHOW_ALERT('TEXTFILE_GENERATED');
IF ALERT_FILE_GENERATED = ALERT_BUTTON1
THEN GO_BLOCK('stprompt');
END IF;
END IF;
END;
END IF;
EXCEPTION
WHEN ex_ein_notmatch
THEN SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
button2 := SHOW_ALERT('ALERT_NO_EIN_EXIST');
IF button2 = ALERT_BUTTON1
THEN go_block('stprompt');
END IF;
-- takes care of other exceptions such as misspelled/non-existing output file directories/path
WHEN others
THEN SET_APPLICATION_PROPERTY(CURSOR_STYLE, 'DEFAULT');
button := SHOW_ALERT('ALERT_TYPO');
IF button = ALERT_BUTTON1
THEN go_block('stprompt');
END IF;
END;
Now I want to know how to setup javabean on forms so that I can make my form work it way it should work. Please help.

you can get samples of using javabeans in forms in the form section of the otn.
but let me suggest something that might be simpler.
create the file on the server and then use:
web.show_document('url of file on server');
this will cause the file to download to the client.

Similar Messages

  • How to Change the Default SSH Port from Terminal ? now showing default SSH Port 22 i need change it pls help me how can do

    How to Change the Default SSH Port from Terminal ?
    now showing default SSH Port 22 i need change it pls help me how can do

    How to Change the Default SSH Port from Terminal ?
    now showing default SSH Port 22 i need change it pls help me how can do

  • TS2755 Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help of how to set up messages on each

    Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks

    search google for "iphone remove picture from contact"

  • Help me how to set charset UTF-8 in SQL Server 2000

    Hello guys,
    Pls anyone help me out from "how to set the charset UTF-8" in SQL Server 2000.
    How do i find the default charset in that?

    SQL Server 2000 uses UCS-2/UTF-16 encoding.
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/intlfeaturesinsqlserver2000.asp

  • Help on how to Set a page length and width.

    Hi guys I'm kind a new to java JDBC and Jasper.
    I'm currently creating my senior project, developing a POS system using Java JDBC, MySql and JasperReport.
    I'm now on the finally stage of my project polishing stage.
    Now here is my problem.
    My adviser wanted my to print sale Invoice using and ordinary Printer let say Espon LX 300 which is available on our Cmpter Lab. He want me to print Sale Invoice using continues paper and try to simulate an actual thing. But I don't know on how to set up a custom paper size in Java or trying to select printer from your system or in your network.
    here is the sample of the code:
    void PrintInvoice(String databaseName,String userName,String password,String reportFile,String Invoice_Reprint)
            HashMap hm = new HashMap();
            hm.put("REPORT_DATE", saledate_tbox.getText());      
            hm.put("REPORT_VAT", vat_tbox.getText());
            hm.put("REPORT_SUBTOTAL", subtotal_tbox.getText());
            hm.put("REPORT_TOTALPAYMENT", total_tbox.getText());
            hm.put("REPORT_CASH", cash_tbox.getText());
            hm.put("REPORT_CHANGE", change_tbox.getText());
            hm.put("REPORT_POS",POS);       
            hm.put("REPRINT", "REPRINT");
            Connection connection = null;
            ResultSet resultSet = null;
            Statement statement = null;
            try{
            Class.forName(JDBC_DRIVER);     
            String query1 = "select invoice.idinvoice as 'Invoice No'" +
                    ",CONCAT(customer.firstname,' ',customer.lastname) as 'Customer'" +
                    ",invoice.date as 'Date-Time'" +
                    ",item.description as 'Description'" +
                    ",sum(invoice_items.quantity) as 'Quantity'" +
                    ",Format(item.regular_price,2) as 'Unit Price'" +
                    ",Concat((invoice_items.discount*100),'%') as 'Whl Disc'" +
                    ",Format(invoice_items.price,2) as 'Price'" +
                    ",employee.username as 'Employee'" +
                    ",Format(invoice.totaltax,2) as 'Vat'" +
                    ",Format(invoice.total,2) as 'Total'" +             
                    ",Format(invoice.cash,2) as 'Cash'" +
                    ",Format((invoice.total-invoice.totaltax),2) as 'Subtotal'" +               
                    ",Format((invoice.cash-invoice.total),2) as 'Change'" +
                    " from invoice,item, invoice_items,customer,employee " +
                    "where invoice.IDINVOICE = invoice_items.IDINVOICE " +
                    "AND invoice_items.UPC_CODE = item.UPC_CODE " +
                    "and invoice.idcustomer = customer.customerid " +
                    "and invoice.idemployee = employee.idemployee " +
                    "AND invoice.idinvoice = (select idinvoice from invoice " +
                    "where idemployee = (select idemployee from employee where username = '"+soldby_tbox.getText()+"') " +
                    "AND idinvoice = '"+Invoice_Reprint+"' ) GROUP BY item.DESCRIPTION";
            connection = (Connection) DriverManager.getConnection(databaseName,userName,password);
            statement = (Statement) connection.createStatement();
            resultSet = statement.executeQuery(query1);
            JasperDesign jasperDesign = JRXmlLoader.load(reportFile);
            JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);        
            JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, hm, new   JRResultSetDataSource(resultSet));        
            JasperExportManager.exportReportToPdfFile(jasperPrint, PDFEXPORT);        
            JasperViewer.viewReport(jasperPrint);
            JasperPrintManager.printReport(jasperPrint, false);       
          }catch(Exception ex) {
             String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
             System.out.println(connectMsg);
          finally{
            try                                                       
                  statement.close();                                     
                  connection.close();                                    
               } // end try                                              
               catch ( Exception exception )                             
                  exception.printStackTrace();                           
               } // end catch    
        }My code print the report on the default printer and default printer setting.
    I hope someone out there can help me thx alot. by the way I uses Ubuntu as my OS.
    The theme of my Senior Project: POS System Using Open Source.
    Hey can someone suggest a project tag line or a better theme cause I believe in the ideals of Open Source,
    Thx

    Try to define ENTER this way & try
    class cl_abap_char_utilities definition load.
    DATA : BEGIN OF enter,
    x type c value cl_abap_char_utilities=>cr_lf,
    END OF enter.
    PS : I am not 100% sure about this.

  • Plsss help me: how to set default values in html:file and html:radio

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • Help on how to set value on LinkButton type column

    Hello,
    Can I programmatically set a value on Item No. in matrix on Sales Quotation which is of type SAPbouiCOM.LinkedButton?
    This code helped me set values to an edittext type column
    Dim et As SAPbouiCOM.EditText = oMatrix.Columns.Item(matrixColumnID).Cells.Item(rowNumber).Specific
    et.Value = value
    Dim et As SAPbouiCOM.LinkedButton = oMatrix.Columns.Item(matrixColumnID).Cells.Item(rowNumber).Specific
    How can set value for the Item No.?
    Thanks and Regards,
    Sheetal

    Just treat the Item No. column as an EditText for purposes of setting its value.
        Dim sboEdit As SAPbouiCOM.EditText
        Set sboEdit = sboMatrix.Columns("1").Cells(lngRow).Specific
        sboEdit.Value = "XXXXXX"
    John.

  • Help! how to set Unicoe for TableheaderColumn

    Please tell me how to set the unicode on column header
    final Object[][] rowData = new Object[entries.length][3];
    for(int i=0;i<rowData.length;i++)
    rowData[0] = new Integer(entries[i].getTimesUsed());
    rowData[i][1] = entries[i].getName();
    rowData[i][2] = entries[i].getText();
    String label = "\u2122"; //down arrow symbol
    *** I CAN NOT GET THIS WORK... but
    I tried a copyright symbol String label = "\u00A9" and it work!!!, it's weird.
    does anyone know why and how to get an down-arrow display
    on column header ? thanks a million.
    final String[] columnNames = {label,"Name","Text"};

    In your child query you can do like this
    select cust_id, customer_name from customer
    union
    select cust_id, 'No Customer' from transactions
    where cust_id not in (select cust_id from customer)
    or you can use this
    select
    a.custorder, decode(b.custname, null,' No Customer',b.custname) custname
    from transactions a, customer b
    where a.custid = b.custid(+)

  • Plz help me how to set values in js from form

    hi alll.......
    i have a problem in my jsp..........i had given hyperlink for second action in jsp, user will select an id from combo...and insert values in text box when they click on button i need to insert these values in database.......
    problem here is all values are passing null value........i am setting through form..i ma not getting the values from anywhere.
    i don't know the problem will u plz help me out in this.........
    thanks in advance.......]chintu

    Your question and the way you type doesn't make much sense to me. Could you be specific about the problem - maybe with code snippets.

  • Please help me :How to set the width and height for my View page "test.htm"

    Hi,
        I have controller class. When i call the view[test.htm]from this controller class ,i am getting the view with output tableview..it is fine.
    My requirement:
                 the output view window is showing full browser window. I want the view output like showModeldialog. I want to set the width and height for the output view window. How is possible?
                 or
    i want to call the test.view in the window.showModelDialog..
    Please help me .. Urgent requirement.

    Yes you can set the width & Height of the view as follows..
    <div style="width:580px; height:750px; margin-top:15px; overflow:auto;">
    <htmb:form......>
    </htmlb:form>
    </div>
    <i>*Reward each useful answer</i>
    Raja T

  • Help Please: how to set JDBC properties for data encryption in BC4J

    Hello,
    I am trying to implement JDBC Thin Driver Support for Data Encryption and Integrity.
    With java.sql.Connection and java.util.Properties, one would do something like the following code:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Properties props = new Properties();
    int level = AnoServices.REQUIRED;
    props.put("oracle.net.encryption_client", Service.getLevelString(level));
    props.put("oracle.net.encryption_types_client", "( RC4_40 )");
    props.put("oracle.net.crypto_checksum_client",Service.getLevelString(level));
    props.put("oracle.net.crypto_checksum_types_client", "( MD5 )");
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:main", props);
    But, how can we do this with BC4J objects? Can we set this properties via EnvInfoProvider class? Please help. Thank you very much in advance.
    Zhirong

    Hi,
    Try adding the code in the PBO part of your custom program used for the custom screen which you have created and added inside the BADI.
    Regards,
    Harish

  • Help please - how to set an alarm with time?

    Hi guys,
    I have got a task here, basically it required me " to displays the time and can set an alarm, which sounds at the right time." (when match it)
    Well, I have created 2 edit boxes, and a button and a radio box. When I typed both the equal string into the edit box, the string will say match! However,I couldn't show the time that run by thread code...
    any guess?
    here is the code:
    import java.awt.*;
    import java.applet.*;
    import java.awt.Graphics;
    import java.util.Date;
    public class j27 extends Applet {
    AudioClip audClip;
    String Msg1=null;
    String Msg2=null;
    Label info;
    TextField box1Text;
    TextField box2Text;
    Checkbox charTrue;
    int myVar1=0, myVar2=1;
    Font theFont=new Font("TimesRoman", Font.BOLD, 24); //
    Date theDate; //
    Thread runner; //
    public void init() {
    info = new Label ("string and integer demo j27.java");
    add (info);
    box1Text=new TextField("12");
    add (box1Text);
    box2Text=new TextField("34");
    add (box2Text);
    Button load=new Button("process");
    add (load);
    charTrue=new Checkbox ("treat input as text");
    add (charTrue);
    public boolean action (Event event, Object object) {
    if(event.target instanceof Button) {
    Msg1=box1Text.getText();
    Msg2=box2Text.getText();
    if (charTrue.getState() !=true) {                    //test for text or integer input
    myVar1 = Integer.parseInt (Msg1); //if integer input convert string
    myVar2 = Integer.parseInt (Msg2); }
    repaint(); }
    return(true);
    public void start()
    if (runner == null)
    runner = new Thread (this); //new thread
    runner.start();
    public void stop() {
    if(runner!=null) {
    runner.stop(); //kill thread
    runner = null; }}
    public void run()
    while(true)
    theDate = new Date();
    repaint();
    try {Thread.sleep(1000);} //thread sleeping 1 second
    catch (InterruptedException e) {}
    public void paint (Graphics g) {
    g.setFont(theFont);
    g.drawString(theDate.toString(),10,50);
    if (Msg1 !=null) g.drawString( "box1=" + Msg1, 30, 140);
    if (Msg2 !=null) g.drawString( "box2=" + Msg2, 30, 150);
    if (charTrue.getState()==true) {                               //text for text or string
    if (Msg1.compareTo(Msg2)==0) g.drawString ("strings match!", 30, 160); }
    else
    if (myVar1 == myVar2) g.drawString ("integers match!", 30, 170);
    else
    audClip = getAudioClip(getCodeBase(),"loop.au");
    audClip.loop();
    }

    Please use:
    &#91code]
    //my code here&#91/code]
    when posting code

  • Help with how to set application access on nokia e...

    Please i tried using my e71 to dowqnload files but could not,i tried setting the access but couldnt

    If what you mean is setting the access Points.. are you trying manual settings ? Best way is to request the Operator to send the settings. These will be sent thru' SMS. Open and select SAVE..and you are done.. 

  • How to set execution time of the step with business days in the workflow

    As we know, we can set how many days later the step should be execuated after previous step. now, the problem is how to set the business days (days except sunday and sataurday) for it. any one has good solution on it.

    Hi Nick,
    In order to find the Next working day you need to check for the Factory calendar days for eg, if a workitem has invoked today and if the Approver doesn't release the workitme for which u want to send a mail/reminder to the approver after say next 5or 6 working days, you need to create a function module.
    For eg: In case of Purchase order, if the approver doesn't release the PO .
    Create a Method saying "Next working day" , in which you will be passing the import parameters : PO, Factory calendar day and the sy-datum
    and export parameter : date.
    Create Input date and No of days as container elements of the Task and in the method create a Function module
    In case of PO, consider the Factory calendar key from the T001W  by joining the table EKPO there by passing the PO.
    then pass the date, No of days(say 5 days) and the Factory calendar key  to the "WDKAL_DATE_ADD_FKDAYS" , you will get the next working day of the employee.
    Don't forget to check the Binding properly.
    Do implement this logic and check the same.
    Regards
    Sharief

  • Step by Step guide please

    Hi everyone,
    Would someone be kind enough to give me a detailed step by stpe guide of how to set up my hotmail accoutn to work with mail, many attempts have failed, things like the address i need etc, would be great if someone could, easy to follow but detailed please!
    Thanks
    Danny

    Danny,
    Searching is a powerful way to use the Discussions. Searching with the argument "hotmail setup" will return many hits, two of which are:
    http://discussions.apple.com/thread.jspa?messageID=1871785
    and
    http://discussions.apple.com/thread.jspa?messageID=2399233&#2399233

Maybe you are looking for

  • Enhanced podcast photos don't show...only timeline

    I created an enhanced podcast for the podcast I do...but it won't play on my new iPod. It plays fine in iTunes...the photos change when it hits the chapter markers...but on the iPod all I see in the window is a timeline with little segments...represe

  • Replacing iMac SuperDrive

    My iMac G4 SuperDrive has been not been working for over a month now and it seems Apple have nothing to say on the subject, despite all the posts (see CDs/DVDs Not Reading At All http://discussions.info.apple.com/.689df994/103 - I'm in there somewher

  • Invoice and correction invoice

    Hi Experts 1. Could You help me with one problem how to do invoice for studnet and then correction vat invoice.? What is different between transaction FMCAM2 - "Generate Invoices" and FKKINV_MA "Create invoice" 2. In FI-CA documnet header there is a

  • Unexpected & Unnecessary Popup "do you want to save changes to 'x' before closing ?"

    Hi Im running a code that is opening a pdf doc and reading some stuff from it (not editing it). avDoc = CreateObject("AcroExch.AVDoc") avDoc.Open(FileBox.FileName, "x") accroApp = CreateObject("AcroExch.App") accroApp.Show() accroApp.Hide() accroApp.

  • Handoff dosen't work between Macbook pro Retina Mid 2012 & iPhone 6

    My Macbook Pro Retina Mid 2012 dosen't work in handoff with my iPhone 6 or my new iMac late 2012, Handoff option in the system preferences is allowed and i log in with the same iCloud in all my devices , and its only work with the phone calls and mes