Appnitro Software Forums » MachForm

Excel on the fly

(6 posts)
  • Started 2 months ago by jlenting
  • Latest reply from jlenting

  1. jlenting
    Member

    Hi,

    I installed the software and I just love it. It works superb. I was only wondering if the following is possible and how I should make it:

    When a person now full-in a form and press send he comes on a thank you page. I whould love if that thank you page calls the excel script and made an excel document from the input that the person did and saved that file on server or as attachment in an email.

    Its like you go to the admin section: Entries --> selected 1 entry --> press Excel File. Then you get a excel file aswell from only one entry, but I would love to have this on the fly after the thank you page.

    Is this possible? And does anyone know how to make this easly ?

    Posted 2 months ago #
  2. jlenting
    Member

    anyone?

    Posted 2 months ago #
  3. Sorry, I'm afraid this one would require pretty much custom code.

    Posted 2 months ago #
  4. jlenting
    Member

    Hi Yuniar,

    Tnx for your reply. Just one more question, do you know where to edit the script that he saves the excel and not send it to the screen?

    (when you know press export he sends the exceldocument to the screen so you can download, i want to remove that he doesnt send the file but just saves it on the server)

    Posted 2 months ago #
  5. Hi,

    You can edit "export_entries.php" file. For example, I assume you will create "excel" folder on machform folder to hold the excel files. Try to do the following changes :

    1. Edit between line 140 ~ 147

    // Creating a workbook
    $workbook = new Spreadsheet_Excel_Writer();
    
    $workbook->setTempDir(DATA_DIR);
    
    // sending HTTP headers
    $clean_form_name = ereg_replace("[^a-zA-Z0-9_-]", "",$form_name);
    $workbook->send("{$clean_form_name}.xls");

    replace with this code

    // Creating a workbook
    $clean_form_name = ereg_replace("[^a-zA-Z0-9_-]", "",$form_name);
    $workbook = new Spreadsheet_Excel_Writer("./excel/{$clean_form_name}.xls");
    
    $workbook->setTempDir(DATA_DIR);
    
    // sending HTTP headers
    //$workbook->send("{$clean_form_name}.xls");

    2. On line 382 you will find these code :

    $workbook->close();

    add this code :

    header("location:manage_entries.php?id=$form_id");
    Posted 2 months ago #
  6. jlenting
    Member

    Hi Redityo,

    Tnx so much for you reply. I changed the code like you said and it works superb!! I now made it so that when they fill-out the forum that the script mails me the excel document.

    Thanks again for your help!

    Kind regards,
    Jasper

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.