Creating a File in local system

Hi Experts,
I want to convert a table content to a  Excel file and store it in the local harddisk.The harddisk locatication must be choosed by the user at runtime through filedalog. Please help me out in this issue as soon as possible
Regards
Noel,

Hi,
For this, Use FileDownload UI Element. and bind the URL of the file to the
Resource property of it.
For Writing to excel file  From Data in Table
File f=new File("table.xls");
FileOutputStrean fos=new FileOutputStream(f);
for(int i=0;i<wdContext.node<TableNode>().size();i++)
byte []b=wdContext.node<TableNode>().get<TableNode>ElementAt(i).get<Field1>().getBytes();
fos.write(b);
fos.write("\t".getBytes());
[]b=wdContext.node<TableNode>().get<TableNode>ElementAt(i).get<Field2>().getBytes();
fos.write(b);
fos.write("\t".getBytes());
fos.write("\n".getBytes());
For generating URL Use
FileInputStream fis = new FileInputStream(f);
FileChannel fc = fis.getChannel();
byte[] data = new byte[(int)(fc.size())];
ByteBuffer bb = ByteBuffer.wrap(data);
fc.read(bb);
IWDCachedWebResource objCachedWebResource = null;
if (data != null)
objCachedWebResource = WDWebResource.getWebResource(data,WDWebResourceType.XLS);
objCachedWebResource.setResourceName(f.getName());
wdContext.currentContextElement().setResource(objCachedWebResource.getAbsoluteURL());
wdContext.currentContextElement().setBehaviour(WDFileDownloadBehaviour.ALLOW_SAVE);// this property will be in 2004s only 
Regards
LakshmiNarayana

Similar Messages

  • How  applet write file in local system by URL instead of FileOutputStream()

    hi,
    how can applet write a file in local system through URL instead of FileOupStream()
    plz.....plz.....plz......
    URL url = new URL(" file://c:/temp.txt");
    in this url how applet can write
    plz....

    URL uses http to cummunicate, this means you can send and receive data using the http
    protocol.
    The OS doesn't do anything with this, you need a http server to interpret these messages
    and take appropriate action (with server side script or CGI).
    So if the client has a http server installed and has server side script thad does
    something with your http request (that's what a url does) than it is possible.
    Since both having a http server , server side script and or CGI have nothing to do with
    signed applets I will not answer your question here.
    But the mail reason I won't answer it is because it makes no sence to use a URL to write
    to the local file system.

  • How to download file to local system when report is run in background?

    Hello all,
    Can anybody tell me how can we donwload file into local machin when the program is running in background?
    thanks

    Hi,
    We can't communicate with presentation server while processing in background.
    if needed we can do this by creating RFC destination and doing some setting in Desktop system.
    [Reference document|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2]
    Regards,
    Amal

  • Program/T-Code to load files from local system to XI system's tmp folder

    Dear all,
    Do we have any program or transaction to load files from our local system to the usr/tmp folder of XI system.
    Please share the info, if anyone has already faced the similar requirement.
    regards,
    Younus

    1) goto SXDA_TOOLS Transaction code
    2) Provide the Following details
    Object Type : DXPROJECT
    Program Type: BAPI
    Program/Method: CREATE
    3) Click on Copy Button
    4) Select the Source as Presentation Server
    a) Select the File where you saved in your Local machine
    5) Select the Target as Application server
    a) Check the check box Remote Server
    b) Select the File type as Physical
    c) In File name give /usr/sap/SSD/DVEBMGS00/work\Your file name (This the Server path
    Where the file is going to save)
    6) Click on Continue
    Go to AL11 and check whether the File has been create in the following path /usr/sap/SSD/DVEBMGS00/work
    Provide this path in the Communication channel path when you select the Transport Protocol as NFS and you place the file in AL11 directory.

  • Importing text file on local system

    I am trying to import data from a text file into a dynamic
    text box. When I
    play the movie on my local system, should the dynamic text
    appear or does it
    only work on a remote server?
    Thanks

    it should work locally. Testing from inside the IDE ignores
    security rules...I think...if your testing outside the IDE, check
    your publish settings to make sure you allow access to local files.
    Good luck!

  • Cannot Retrieve referenced URL in wscript file from Local System Account, but not other accounts on the computer.

    Hello,
    I have a WScript File that includes an external resource (js file).
    It works on one computer and it does not work on another computer.
    If I run this file from a normal admin command prompt everything runs fine on both computers.
    If I run this file from the Local System account using PsExec it runs fine on one of the computers and throws an error "Cannot Retrieve referenced URL" on the other computer.
    The reason I want it to run from the Local System account is that it is executed from a Windows Service.
    Is there some setting or some way for the IE cache to get corrupt on the Local System account or something like that?

    JRV,
    You are by far the worst 'support' person I've ever seen. If you aren't going to be thoughtful in providing support, don't pretend. If you're going to pretend, leave your condescension on the shelf. You have provided no thoughtfulness whatsoever to his issue,
    and have in no way improved the discourse. You are arrogant and condescending without exhibiting any intelligence whatsoever. I'm impressed Matt kept calm through your demeaning, counterproductive diatribes.
    Matt,
    First I'd check UAC settings, because I believe that can change how elevation works substantially.
    Second, I would check the versions of wscript.exe on both machines, both in System32 and SysWow, and I'd check for updates bypassing WSUS to make sure there's not something silly going on there (totally a shot in the dark, catch-all theory).
    Have you made any headway in the last few weeks?
    -John
    This is not a support forum and it is not for assistance in fixing broken configurations.  It is a scripting forum. The OP proved that the issue is not the script but the environment it is running in.  You should not get mad just because you are
    not getting satisfaction.
    ¯\_(ツ)_/¯

  • Creating flat file in local machine

    Gurus,
    My database is OLAP database, i need to extract the data into flat file (.csv/.txt/.xls) in to client machine (Local machine, or End user PC) not in to Oracle DB Server.
    Is it possible to achieve the same without using UTL_FILE?
    If so please help me in this regard.
    Thanks in advance.
    Karthik.K

    What client are you running on the PC to connect to the database
    If sqlplus you can spool the output
    Re: Create a file in a local PC.
    Other options some of which write to the client.
    http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyteflat.html

  • Need PL/SQL procedure for file transfer local system to server location

    Hi Experts,
    The requirement is one file ex: text file,excel file is there in Local system suppose c:newfolder/test.txt.
    once run the concurrent program for this particular file in the local system should transfer into server location for the mentioned path.
    is it possible to do in PL/SQL or shell script.
    can you please share the code.
    Thanks
    Meher

    Meher Irk wrote:
    The requirement is one file ex: text file,excel file is there in Local system suppose c:newfolder/test.txt.
    once run the concurrent program for this particular file in the local system should transfer into server location for the mentioned path.Why do you want to copy a local file from the local client file system, via the Oracle database server, to a remote directory on the server?
    Why is the Oracle database server to be used? For what purpose?
    There are standard secure methods for a client to copy a file to a server. Such as sftp and scp. No complex Oracle database server layer needed in-between.
    So why do you want to use the Oracle database to act as the copy mechanism for you?
    It will only make sense if the local file is copied into the database (as a LOB or securefile) and managed by the database. I fail to see why Oracle should be acting as the go-between for the client file system copy process to the server file system. This introduces another moving part in the copy process. Adds more security issues. Adds more authentication issues. And what for?

  • Copy file from local system to Azure VM using powershell

    Hi
    Is there a simple powershell command to copy a small file from local computer to Azure VM. Point to Site is not an option for me.
    I am hoping for something simple like
    Copy-Item C:\Wabash\Logfiles\trasfer.txt -Destination C:\Presentation -ConnectionUri $uri -Credential $credential
    similar to Invoke-Command
    The only other option i have seen is 
    http://www.mattwrock.com/blog/copy-files-from-local-computer-to-an-azure-vm
    which i fell for my purpose is over kill.

    Hi,
    I will mark Ed's post as answer, if you fount that doesn't give you help, please feel free unmark it and follow up with more information.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot Upload a file from local system

    Hi,
    I am trying to send an email with an attachment from an JSP form using javamail in a STRUTS action class.
    I uploaded the JSP form and action class to my web server (Unix with JBOSS) and now the email is not sent and I receive the following error
    javax.mail.MessagingException: IOException while sending message;
    nested exception is:
    java.io.FileNotFoundException: testFile.txt (No such file or directory)
    I am assuming that there is something different about the way my web server handles file attachments but I can't find any information about how to fix the problem. When i sent a blank msg without any attachment it is working fine.
    Any help is greatly appreciated.
    Following is the code that i wrote in Action class to upload an attachment
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(dataFile.toString());
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(dataFile.getFileName());
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    Transport transport = session.getTransport("smtp");
    transport.connect("host", port,"null","null");
    if(transport.isConnected())
    transport.sendMessage(msg, new Address[] {new InternetAddress(from));
    }Thanks
    Dinesh.

    DrClap is right about using the correct pathname to the file, but...
    At any
    rate, rather than leaving this to chance, just give
    the complete path name of the file to the data
    handler:messageBodyPart.setFileName(dataFile.getAbsolutePath());
    Don't do this. The absolute path to the file on your system will mean nothing
    on the system that receives this message.
    What you need to do is give the correct, perhaps full, pathname to FileDataSource
    that names the file on your server.

  • How to create Excel file in client system...

    please tell me,
    how to create a excel file in the client system. in my application i am displaying the report from database. my requirement is to create that report in excel format that should be stored in client machine...

    http://jakarta.apache.org/poi/
    One of the best solution.....

  • Error while importing PAR file from local system.

    Hi Experts,
    While importing PAR file into my NWDS, I am encountered by some strange error.
    Please refer below screenshot for your reference.
    After clicking on "OK" button of the above error popup, another popup emerge with different error, please find below the screenshot for this error.
    Please let me know the reason and resolution of this error. It will be very helpful for me.
    Thanks in advance.
    Thanks and Regards,
    sarvesh Agarwal

    Hi ,
    Are u trying to import with .bak extension ? If so please rename the file and remove .bak extension and try.
    x.par is enough to import not x.par.bak.
    Thanks,

  • Creating file in remote system - Urgent

    Hi all
    We have a requirment like creating a file in remote sytem 'c:\' drive through abap program.
    Pls give valuable suggestion as soon as possible.

    HI babu
    Thanks for reply.
    I need to create a file in remote system not in local system.

  • Problem in creating file on local machine

    Hello everbody...
    i m using forms and reports 6i
    i m creating file out_file := Text_IO.Fopen(:filepath || '.csv', 'a'); using this command in before_report trigger. And closing file in after_report trigger.
    here filepath is = \\IP address of local machine\d$\file name
    now problem is that if i m giving IP address of local machine then its giving error ORA-39856.
    And if i m giving IP address of server machine then it is going to create file on server machine from local machine.
    Why its not creating file on client machine?
    i think there r problems related to rights
    can anyone has solution then please tell me

    yes in report there is report output and with that it also creating file in coding by
    out_file := Text_IO.Fopen(:filepath || '.csv', 'w');
    this open stmt is written in before report trigger
    Below lines r written for each row thats fetch by report main query.
    str := rpad(:apt_bil_no,8,' ') || ',' || lpad(:apt_bil_dt,10,' ') || ',"' ||
                   rpad(:supl_name,30,' ') || '",' || rpad(:supl_tin_no,11,' ') || ',' ||
                   rpad(:aptvat_hsn_no,10,' ') || ',' ||
                   lpad(ltrim(to_char((apt_amt2 - apt_vat_amt2),'999999990.00')),12,' ') || ',' ||
                   lpad(apt_vat_amt2,12,' ') || ',' ||
                   lpad(ltrim(to_char(apt_amt2,'999999990.00')),12,' ');
    Text_IO.Put(out_file, str);
    Text_IO.New_Line(out_file);
    file is closing in after report trigger.
    text_io.fclose(out_file);
    now i wants to create this file on local machine.
    yes using report server and its started window service.
    can u have any idea?

  • Urgent: DBrefresh error 354 while creating control file, oracle9i, SAP R3

    Hi experts,
    I have created trace file in Source system and moved the same to target system and edited and then while executing the trace file to create control file the following eeror is coming
    my trace file is like this. . .
    STARTUP NOMOUNT
    CREATE CONTROLFILE SET DATABASE "P47" RESETLOGS ARCHIVELOG
    --  SET STANDBY TO MAXIMIZE PERFORMANCE
        MAXLOGFILES 255
        MAXLOGMEMBERS 3
        MAXDATAFILES 336
        MAXINSTANCES 50
        MAXLOGHISTORY 8168
      '/oracle/P47/sapdata9/btabd_63/btabd.data63',
      '/oracle/P47/sapdata9/stabi_27/stabi.data27',
      '/oracle/P47/sapdata9/btabi_122/btabi.data122',
      '/oracle/P47/sapdata9/stabd_28/stabd.data28',
      '/oracle/P47/sapdata9/btabi_123/btabi.data123',
      '/oracle/P47/sapdata9/btabd_64/btabd.data64',
      '/oracle/P47/sapdata9/btabi_124/btabi.data124'
    CHARACTER SET WE8DEC
    i run command like this:
    SQL> @/oracle/P47/saptrace/usertrace/control.sql
    ORACLE instance started.
    Total System Global Area          1249618992 bytes
    Fixed Size                                     732208 bytes
    Variable Size                             788529152 bytes 
    Database Buffers                       459022446 bytes
    Redo Buffers                                1335296 bytes
    <b>354</b>
    when I press 'enter' again SQL prompt is comming
    Please help
    rgds

    Hi markus,
    thanks for reply . .
    control files are not created. . . .
    alertSID logs shows as follows
    orap47> tail -f alert_P47.log
    ARCH shutting down
    Thu Dec 13 13:01:51 2007
    ARC0: Archival stopped
    Thu Dec 13 13:01:51 2007
    ARC1: Archival stopped
    Thu Dec 13 13:01:54 2007
    ARCH: Archiving is disabled
    Shutting down archive processes
    Archiving is disabled
    Archive process shutdown avoided: 0 active
    <b>When @/oracle/saptrace/usertrace/control.sql command given in sepearate SQL window</b>
    Thu Dec 13 13:03:37 2007
    Starting ORACLE instance (normal)
    Disable cache advisory with old cache parameters
    Thu Dec 13 13:03:37 2007
    WARNING: EINVAL creating segment of size 0x000000004b800000
    fix shm parameters in /etc/system or equivalent
    LICENSE_MAX_SESSION = 0
    LICENSE_SESSIONS_WARNING = 0
    SCN scheme 3
    LICENSE_MAX_USERS = 0
    SYS auditing is disabled
    Starting up ORACLE RDBMS Version: 9.2.0.4.0.
    System parameters with non-default values:
      processes                = 80
      sessions                 = 96
      timed_statistics         = TRUE
      shared_pool_size         = 704643072
      enqueue_resources        = 8000
      control_files            = /oracle/P47/sapdata1/cntrl/cntrlP47.dbf, /oracle/P47/sapdata2/cntrl/cntrlP47.dbf, /oracle/P47/sapdata3/cntrl/cntrlP47.dbf
      db_block_buffers         = 56033
      db_block_checksum        = FALSE
      db_block_size            = 8192
      compatible               = 9.2.0
      log_archive_start        = TRUE
      log_archive_dest         = /oracle/P47/saparch/P47arch
      log_buffer               = 1048576
      log_checkpoint_interval  = 0
      db_files                 = 354
      db_file_multiblock_read_count= 8
      log_checkpoints_to_alert = TRUE
      control_file_record_keep_time= 30
      dml_locks                = 2500
      row_locking              = always
      replication_dependency_tracking= FALSE
      transactions_per_rollback_segment= 20
      rollback_segments        = PRS_0, PRS_1, PRS_10, PRS_11, PRS_12, PRS_13, PRS_14, PRS_2, PRS_3, PRS_4, PRS_5, PRS_6, PRS_7, PRS_8, PRS_9
      transaction_auditing     = FALSE
      remote_os_authent        = TRUE
      db_domain                = world
      parallel_max_servers     = 20
      hash_join_enabled        = FALSE
      background_dump_dest     = /oracle/P47/saptrace/background
      user_dump_dest           = /oracle/P47/saptrace/usertrace
      core_dump_dest           = /oracle/P47/saptrace/background
      optimizer_features_enable= 9.2.0
      sort_area_size           = 2097152
      sort_area_retained_size  = 0
      db_name                  = P47
      open_cursors             = 800
      optimizer_mode           = choose
      btree_bitmap_plans     = FALSE
      pushjoin_predicate     = FALSE
      optimizer_index_cost_adj = 10
      newinitial_join_orders = FALSE
      optimpeek_user_binds   = FALSE
    PMON started with pid=2
    DBW0 started with pid=3
    LGWR started with pid=4
    CKPT started with pid=5
    SMON started with pid=6
    RECO started with pid=7
    Thu Dec 13 13:03:39 2007
    ARCH: STARTING ARCH PROCESSES
    ARC0 started with pid=8
    ARC0: Archival started
    ARC1 started with pid=9
    Thu Dec 13 13:03:39 2007
    ARCH: STARTING ARCH PROCESSES COMPLETE
    Thu Dec 13 13:03:39 2007
    ARC0: Thread not mounted
    Thu Dec 13 13:03:39 2007
    ARC1: Archival started
    ARC1: Thread not mounted
    rgds

Maybe you are looking for

  • DisplayPort causing system crash

    I have a T520 with a DisplayPort out.  I use a DP to HDMI adapter and run an HDMI cable between the adapter and my television.  I usually leave it disconnected from the laptop, but I plug it in when I want to use the TV as a monitor.  I've been doing

  • Preview - No Table of Contents

    I have an ebook in pdf form, that displays the Table of Contents fine using Fox-It Reader and Acrobat Reader (on windows box at work), but when I view using Preview it just displays the Title of the book. Anyone have any information on this or a reso

  • Concatenate in WHERE clause

    Im trying to Concatenate the name columns and used them in a WHERE clause, but its not liking it. select * from my_table where Title+' '+CFirstName+' '+CSurname = 'Mr James Khan' Thus returning the following error message. Implicit conversion of varc

  • How to transfer iTunes library to Macbook Pro

    I have been syncing my iTunes library on my phone with an older HP laptop. I have a new MacBook Pro that I would like to transfer my iTunes library to. What is the best way to do that? If I just plug my phone into the new MacBook, will it copy librar

  • Looking at videos in iPhoto

    I would like to look only at videos in iPhoto.  I searched this question and found an answer that I should make a smart album and use the keyword "movie" which I guess videos get automatically tagged with.  This got me my videos through July 2012 but