Code Monkey home page Code Monkey logo

module-export_manager's Introduction

Export Manager module

The Export Manager module provides Form Tools with one of its more important features: the ability to view and export your form submission data in any way you wish. Since it's such a fundamental feature, this module comes pre-installed with all (pre-bundled) Form Tools installations, letting you get to work without any additional configuration required. The screenshot to the right is of the 2.0.0 version of this module, but the functionality has remained largely the same since its first release.

In new installations, the module provides two ways to download / view your form submissions: as an Excel spreadsheet or in an HTML printer-friendly format, which has three sub-options: table format, one-by-one and one submission per page. There are also two other export methods, hidden by default: CSV (comma separated values) and XML. Depending on your needs, these can be enabled by the click of a button. But most significantly, once you learn how the module works, you can construct whatever other formats you need.

The Export Manager, used in conjunction with the Core Views feature, acts as a fully fledged Report Builder, letting you view and export whatever subset of the form data you require. You also have the option to only show the export formats for particular clients, particular subsets of your data, and particular forms and Views (version 2.0.0 of the module and later only). It's VERY powerful!

For more information, read the documentation.

Documentation

Other Links

module-export_manager's People

Contributors

benkeen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

module-export_manager's Issues

[FIX] function.smart_display_field.php

Hi Benkeen, may I propose these changes to .php in the subject? This fix csv output if there are textarea fields:

function smarty_function_smart_display_field($params, &$smarty)
{
    $value = FieldTypes::generateViewableField($params);

    // additional code for CSV encoding
    if (isset($params["escape"])) {
        if ($params["escape"] == "csv") {
			// Check if we need to enclose field between double quotas
			$needQuote = (strstr($value, ",") || strstr($value, "\n"));
			// trim spaces and other useless char
			$value = trim($value);
			$value = preg_replace("/\"/", "\"\"", $value);
			// replace inner "\n" or "\r" with '|' character, otherwhise csv will be corrupted.
			$value = str_replace(array("\n","\r"), '|', $value);
			// add double quotas if required
			if ($needQuote)
				{
				$value = "\"$value\"";
				}
        }
        if ($params["escape"] == "excel") {
            $value = preg_replace("/(\n\r|\n)/", "<br style=\"mso-data-placement:same-cell;\" />", $value);
        }
    }

    echo $value;
}

Export data as pdf template

Hi,

Currently the Data is exported as multiple format. For pdf i take it as a save as pdf, For this i need the field name and other details should be in Template like arrangement. Any Idea and direction ?

Option List Exports Display Text NOT Field Value

FT 3.01 / Windows Localhost install

  1. Create Option List & Assign Field Values and Display Text
    olist01

  2. Link Option List to to Field1/Col_1 in DB - displays as expected
    olist02

  3. Add record

  4. Display record using HTML /Printer Friendly Format - Display Text is shown NOT value
    olist03

  5. Export as XML - <col_1> shows Display text
    olist04

  6. Check database in phpMyAdmin - displays correct field value from Option List
    olist05

  7. Scratch head - I am missing something obvious - Option list export value should be exported?
    Option List display text should only appear in For Tools UI (internal form page)?

Trying this with external form - data saved OK in db but when exported as XML for round trip to another system incorrect option list value is exported.

Can workaround by making display and value exactly the same but...

  1. Lies down

Thanks. Apologies if I have completely lost it

T

Smarty template custom export type

Hi guys, I've a problem with Smarty Template. What I'm doing right now is to export groups of data from an online tool called Formtools (www.formtools.org) via Smarty template. I've got a script who export data by colums, but I need to group some of that fields into another one completely different. How can I select all the columns I need and put them into another field?

This is the script:

[code]
{strip}

<export_datetime>{$datetime}</export_datetime>
<export_unixtime>{$U}</export_unixtime>
<form_info>
<form_id>{$form_id}</form_id>
<form_name></form_name>
<form_url>{$form_url}</form_url>
</form_info>
<view_info>
<view_id>$view_id</view_id>
<view_name>Dati preliminari</view_name>
</view_info>

{foreach from=$submissions item=submission name=row}

{foreach from=$display_fields item=field_info name=col_row}
{assign var=col_name value=$field_info.col_name}
{assign var=value value=$submission.$col_name}
<{$col_name}></{$col_name}>
</{$message}>
{/foreach}

{/foreach}


{/strip}[/code]

Export when option list is modified

I have a need to change values of Option List every week. If the value is not present this week, it won't be present at export, despite it existence in database. Yes, there is a workaround to change every time before the export to the list with all possible values but , except for the needless complexity, the main problem is in role management -- i have to modify the client account to administrator, change its menu to add administration links. Yes it's of inconvenience of actual role-based management system, but it's a bit odd way to perform such a simple action. Of course i can (and possibly will) write an python script, accessing directly to the DB, but i wish to see a proper way to do this simple thing by the correct means.
Best regards

Exporting a CSV on a form with a textarea that contains a line break makes the CSV go to a new row

When you have a form that contains a textarea there's an issue with the CSV exporter if a submission includes a line break (return/enter) in the textarea. It causes the submission to go to a new row at the line break.
I'm not sure if CSV supports a line break, so the best possible solution that I can think of is to update this module to convert a line break into a space before serving up the file.

Steps to reproduce:

  1. Create a form with a textarea
  2. Enter a submission, and have the textarea contain multiple lines (using enter/return to go to a new line)
  3. Export submissions as a CSV

Feature request: Export file on submission

File exports on submission would be awesome. as xml, csv, plain text. To local folder - or - to an ftp might be asking too much, but would also be awesome.

I can't tell you how excited I was to see this app get updated! Awesome job so far.

[Request] csv column separator configuration

I want to give you a suggestion about .csv export. You should add separator configuration and number decimal format. This because if region is set, for example to Italy, standard csv separator is ";" and not "," and numbers decimal separator is "," not "."
Now I know that I can fix by myself modifying the template, but may be generally useful have these options in module's "settings" page.
Best regards
Marco
(sorry for the large amount of messages from me, I'm studying your code so maybe soon I can help instead of requesting ;) )

PHP code in Smarty 3

Hello!
In the previous version of Formtools (and Smarty) I was able to include {php} code in Smarty in order to create custom export templates. Now, this is not possible anymore.
I need to create an export template in which I call a php query with a INNER JOIN between Formtools tables and assign the array to a Smarty variable in order to show the results.
What can I do?

Field_value vs Col_name in CSV, XML,.. exports

Is it possible adjust export to CSV etc. Field Values (from Option Lists) instead of Displayed Text?
e.g. if Options are set: Field Value "1" Displayed Text "Yes", Field Value "0" Displayed Text "No".

According to Smarty Template in Export Types
{assign var=value value=$submission.col_name}
are exported "Displayed Text" values (e.g. "Yes").

How to adjust the Smarty Template to get the Field Value (e.g. "1" when answered "Yes") for exports?
The reason is that I need to work with codes of the answers not with displayed texts. Am I missing something if I guess the field values in Option Lists are there exactly for that purpose?

I have tried just blindly {assign var=value value=$submission.field_value}, but with no effect.
Many thanks for help!

Form Tools 3.0.15, Export Manager 3.1.0

Default file upload URLs and dirs aren't passed as Smarty vars for use in templates

You SHOULD be able to access the file upload URL and folder for each field through the following variables:

{foreach from=$submissions item=submission name=row}
{foreach from=$display_fields item=field name=col_row}

{$field.field_info.settings.file_upload_url}
{$field.field_info.settings.file_upload_dir}

{/foreach}
{/foreach}

But right now they only get passed if the values have been expressly overridden for that field. Those values should ALWAYS be passed.

As a temporary workaround, people can manually override the default "File Upload folder" settings for each file field. Once this is fixed, they can safely delete that setting.

Attched file no loger displayed as link

Hi!

The pop-up showing exported data no longer displays uploaded file name as a link. So, to download/see that file you have to go back to the form view screen, enter entry details and download/see file from there.

Display All displays blank popup

When displaying ALL records with the "HTML/Printer Friendly" display button, the popup is blank, but when displaying SELECTED records with the "HTML/Printer Friendly" display button, the popup displays the selected records just fine.

View uploaded pictures in HTML / Printer Friendly Export

Please help me to display the uploaded image files in the Printer Friendly format Dispay ether Table or One by One format

FEPAI

Please help me to display the uploaded image files in this code

ASSOCIAÇÃO FILIADA: {$form_name} - {$view_name}

{strip}
{foreach from=$submissions item=submission}
{assign var=submission_id value=$submission.submission_id}

{foreach from=$display_fields item=field_info} {assign var=col_name value=$field_info.col_name} {assign var=value value=$submission.$col_name} {/foreach}
{$field_info.field_title}

{smart_display_field form_id=$form_id view_id=$view_id submission_id=$submission_id field_info=$field_info
field_types=$field_types settings=$settings value=$value}

{/foreach}
{/strip}

CSV and Excel Exports sometimes corrupted by data

Not sure exactly how to explain this, but some fields (usually the large comment field) allows user entered data to mess up the system of comma/quote separation of fields, so that when data is exported and opened in Excel or Open Office Calc, some of the rows are messed up. It also looks like sometimes my comment field has quotations around it, but sometimes it does not. Perhaps a problem with \out chars like single or double quotes? I can supply an exported example if necessary, though it contains data I would not want publicly visible.


Just an update. This bug seems to be slightly different in latest versions (ft 2.1.5 and export manager 2.1).

When I export an Excel version, the file opens fine in Excel, but when I export a csv file, a textarea data field seems to break the line and thus mess up the csv file. Also, if I save the exported Excel version as a csv file, the new csv file also has the broken line problem, even though the Excel file displays ok in Excel (i.e. no broken line.)

Seems like textarea fields are carrying along a carriage return, perhaps? I tried adding wrap=virtual and deleting all the spaces in the textarea html, but that doesn't seem to make a difference.


.ID,Last Name,First Name,Email,Phone,Org,Category,Address,City,State,Province,Country,Zip,DL Interest,Find Us,Support nit removal?,Prevention Program,Failed Treatment,Caused Illness,Comments,Date,Last modified,IP Address
24203,Moore,Andy,[email protected],phone,Moorezilla,Education,5 Linden,Peabody,Massachusetts,,United States of America,01960,"No Nit Policy, Other",Internet Search,yes,no,yes,n/a, test
,2011-10-27 12:28 PM,2011-10-27 12:46 PM,71.233.45.129

Not sure if this will translate right. Problem seems to occur right before date field... right after textarea field for Comments.

CSV export data template

Hi, I tried to export some data from my form tool accounts into a CSV, but I need a particular one. How could modify the export template in an easy way?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.