I'm so sorry for the long response time. I'm just trying to wrap up some work before I leave the country at the end of this month, and everything else is falling by the wayside.
When I first read your post I thought "no problem!" but when I just tried putting together a working example today, I was surprised how tricky it was - not just tricky, actually: downright complicated! The default Smarty content in the Export Manager code is really too complex by half. I'll have to simplify it in future versions.
So what I ended up doing was writing a helper Smarty function that *significantly* simplifies the job for us. I'll include this in the next version of the module for anyone in a similar situation.
Anyway, here's how to get it all done.
First off, since you need such a specific format, start by piecing together the HTML that you need for a *single* outputted submission. Just leave blank spaces where you want the values to be outputted from the database. Your HTML would just contain the main table layout and labels. When I look at your desired output, it'll clearly take some fiddling just to get the markup right with all the appropriate rowspans / colspans etc.
Once that's ready, it's a matter of putting it into the Smarty template and pasting in the appropriate variable into each spot in the field.
Download the attached file and upload it to your [form tools]/modules/export_manager/smarty/ folder. After it's been added there, it will be available to be used in your own Export Types Smarty content that you enter in the Export Manager module.
Here's a simple example of how it works. Instead of the loop-within-loop that the default HTML / Printer-Friendly "Table Format" Export Type smarty content uses (which is complicated, but fast), this works differently. It loops through each submission, but display explicit field values based on their column names. So, you just pass in the unique database column name for the field, and it will output the appropriate value for the current submission at the spot.
In my case, I have a field called "Field #1", which has a column name of "col_1".
What you need to do is copy your markup into the Smarty Export Type content field and replace the <table> in the example above. Then, any place you want a value outputted for a field, just call the function, specifying the field you want:
{display_field_by_colname col_name="XXXXXX"}
And that's pretty much it!
Let me know how it goes.
- Ben
When I first read your post I thought "no problem!" but when I just tried putting together a working example today, I was surprised how tricky it was - not just tricky, actually: downright complicated! The default Smarty content in the Export Manager code is really too complex by half. I'll have to simplify it in future versions.
So what I ended up doing was writing a helper Smarty function that *significantly* simplifies the job for us. I'll include this in the next version of the module for anyone in a similar situation.
Anyway, here's how to get it all done.
First off, since you need such a specific format, start by piecing together the HTML that you need for a *single* outputted submission. Just leave blank spaces where you want the values to be outputted from the database. Your HTML would just contain the main table layout and labels. When I look at your desired output, it'll clearly take some fiddling just to get the markup right with all the appropriate rowspans / colspans etc.
Once that's ready, it's a matter of putting it into the Smarty template and pasting in the appropriate variable into each spot in the field.
Download the attached file and upload it to your [form tools]/modules/export_manager/smarty/ folder. After it's been added there, it will be available to be used in your own Export Types Smarty content that you enter in the Export Manager module.
Here's a simple example of how it works. Instead of the loop-within-loop that the default HTML / Printer-Friendly "Table Format" Export Type smarty content uses (which is complicated, but fast), this works differently. It loops through each submission, but display explicit field values based on their column names. So, you just pass in the unique database column name for the field, and it will output the appropriate value for the current submission at the spot.
Code:
{foreach from=$submissions item=submission}
<table>
<tr>
<th>Submission ID:</th>
<td>{display_field_by_colname col_name="submission_id"}</td>
<th>Field #1</th>
<td>{display_field_by_colname col_name="col_1"}</td>
</tr>
</table>
<br />
{/foreach}
In my case, I have a field called "Field #1", which has a column name of "col_1".
What you need to do is copy your markup into the Smarty Export Type content field and replace the <table> in the example above. Then, any place you want a value outputted for a field, just call the function, specifying the field you want:
{display_field_by_colname col_name="XXXXXX"}
And that's pretty much it!
Let me know how it goes.
- Ben