Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:58:25+00:00 2026-06-12T07:58:25+00:00

I have a table of data and i wanted an export function, this application

  • 0

I have a table of data and i wanted an export function, this application run on web so i want to create a csv file and then offer (open or save as option) usual download options. Im using CSV writer at the moment.
The line in question here is Runtime.getRuntime().exec("export.csv"); give error listed at bottom
How would i do this?

Here is the action tied to a button

Action exportData = new Action() {
    private static final long serialVersionUID = -7803023178172634837L;

    @Override   
    public void execute(UIContext uic, ActionEvent event) {

        try{       
            CSVWriter writer = new CSVWriter(new FileWriter("export.csv"), '\t');
            int i = 0;
            while (i < forExport.getTotalCount()){
                String[] entries = {
                    forExport.getSearchResults().get(i).getName().getGivenNames() + forExport.getSearchResults().get(i).getName().getSurname(),
                    forExport.getSearchResults().get(i).getId()
                };
                writer.writeNext(entries);
                i++;
            }  
            writer.close();
            Runtime.getRuntime().exec("export.csv");  
        }catch(Exception e){
            system.out.print(e);
        }
    }
};

getting error java.io.IOException: Cannot run program "export.csv": CreateProcess error=193, %1 is not a valid Win32 applicationDEBUG

NOTE: i do not want it to automatically open in excel, i want the option to save or open.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:58:26+00:00Added an answer on June 12, 2026 at 7:58 am

    I don’t understand why you are exec-ing anything whatsoever. This is server code. You don’t want to exec Excel at the server at all. You want to write the file back to the browser, along with a content-disposition header.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table one which looks like this. And I want to get data
My table have data structure like this cate_id task_id date_start date_end other 34 14
I have a table of data with survey results, and I want to do
I have a table of data which has posts, then I have a separate
I have a table that looks like this: CREATE TABLE [Test].[dbo].[MyTest] ( [Id] INT
I have a table of ordered data like this ID ORDER 12 1 13
I have this table I created manually, and I want to use a gridview
I have table of data that is sorted as follows: Item | Sample |
I have table in data base name train delay, with columns train number(int), DelayTime(int),
I do have a table data as shown below: <td> <label for=title>Title : </label>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.