This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Excel on the fly


  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 16 years ago #
  2. jlenting
    Member

    anyone?

    Posted 16 years ago #
  3. yuniar

    Sorry, I'm afraid this one would require pretty much custom code.


    MachForm Founder

    Posted 16 years 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 16 years ago #
  5. redityo

    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");

    MachForm Support

    Posted 16 years 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 16 years ago #
  7. dennisouellette
    Member

    Jasper and/or Yuniar,

    Would you share the script that emails the document to you? What I need to do is to have the system send me an email either once a day or once a week with the compiled entries of the day or week. Is that possible?

    Thanks so much...

    Dennis

    Posted 15 years ago #
  8. redityo

    Hi Dennis,

    I think it not possible to make machform send you an email daily or weekly, since it need Cron Job to do that. But it's still possible to send an excel/csv file everytime an user do a submission to your form.
    I do not know if this modification meet your requirement or not. However since it need a lot of modification to some files, please send email to :

    customer.service [at] appnitro.com

    To allow me send those files.


    MachForm Support

    Posted 15 years ago #

RSS feed for this topic

Reply