Forums

Issue with XSL Export.

superdmon 27 Jul, 2016
Hi there,

I've been having some issues exporting XSL data for my form.

I have it so that it's writing to an xsl file successfully with each submit, however after each test submission, it's simply over writing the xsl file when I want to save each submission made.

Can someone point me in the right direction as to what I need to do?

The DB Save currently has this, which I wrote based off information I've found here in the forums:

<?php

$form->data["xlsData"][1]["title"] = $form->data["title"];
$form->data["xlsData"][1]["firstname"] = $form->data["firstname"];
$form->data["xlsData"][1]["lastname"] = $form->data["lastname"];
$form->data["xlsData"][1]["gender"] = $form->data["gender"];
$form->data["xlsData"][1]["address"] = $form->data["address"];
$form->data["xlsData"][1]["city"] = $form->data["city"];
$form->data["xlsData"][1]["state"] = $form->data["state"];
$form->data["xlsData"][1]["zip"] = $form->data["zip"];
$form->data["xlsData"][1]["phone"] = $form->data["phone"];
$form->data["xlsData"][1]["email"] = $form->data["email"];
$form->data["xlsData"][1]["cashcheck"] = $form->data["cashcheck"];
$form->data["xlsData"][1]["card"] = $form->data["card"];

?>
GreyHead 27 Jul, 2016
Hi superdmon,

I'm afraid that I don't understand what you are trying to do here? If you export single records then You'd have to import them into your existing spreadsheet - there will only be one record in each exported file.

What do you actually need to do?

Bob
superdmon 27 Jul, 2016
Sorry for the confusion.

What I'm trying to do is that upon each successful submission from a user, a new record (or row) is output to one single xls file.

Currently what is happening is with each submission, the new entry is outputting an entirely new file and overwriting the old one that was created previously.

I don't have any need to email it or do anything too complicated, I just need each entry stored server side in one file for later use.
GreyHead 27 Jul, 2016
Answer
Hi superdmon,

There are a few ways to do this.

The best is probably to use the GSheet export and save the data in a Google Sheet - that will automatically add each new entry as a new row.

You can use with the CSV Export or the XLS export to export a single record but then you have to re-import that into the existing spreadsheet as a new row - there is no way that the exporter can do that. (I guess it might be possible with the MS Cloud services but I've never tried and I haven't seen that any other user has).

You can set up a separate form to export all of the saved records - or some sub-set (i.e. all since the last export) if that helps. Again this would either replace or need to be imported into the existing sheet.

Lastly, there is a MySQL plug-in for Excel that lets you link Excel directly with a database table if the database allows remote access. That might also work.

Bob
superdmon 28 Jul, 2016
After reading your response, I've concluded the GSheet export route is the best one for my situation.

However, I've run into another wall. I've followed the guide here-> https://www.chronoengine.com/faqs/70-cfv5/5233-how-do-i-use-the-google-spreadsheet-save-action.html

However, I've gotten the following error:
Array
(
    [59] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                        )

                )

        )

    [GSheet Save [GH]] => Array
        (
            [0] => No data found to save
            [1] => No data found to save
        )

)


That lead me to finding this thread: https://www.chronoengine.com/forums/posts/f2/t100376.html

However, when I entered the solution there as custom code (with it modified with my own fields of course), I get a server 500 error. Do you have any idea what I am doing wrong?
superdmon 28 Jul, 2016
1 Likes
Actually, nevermind! It appears I had uploaded a folder to the wrong directory. Oops! Thanks for your help. I got it working using the information I linked above.
This topic is locked and no more replies can be posted.