The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Export Manager: Custom Table View - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16)
+--- Thread: Export Manager: Custom Table View (/showthread.php?tid=1839)



Export Manager: Custom Table View - heywood7 - Dec 29th, 2011

My goal: To create a HTML/Print view with a custom table, similar to how I can customize the email body. I have an employment application that is very long. When properly formatted in html, I can display the questions and answers in a manner that resembles your typical application.

My problem: Smarty templates. I simply don't understand the logic enough to customize the templates.

Can someone point me in the right direction, or even provide an example of a custom smarty template? Any help is greatly appreciated.

Oh, and Ben... This tool rocks!


RE: Export Manager: Custom Table View - Ben - Dec 31st, 2011

Hi Heywood,

Thanks! The script is coming along... and boy, once the Form Builder module is released (soon next month), I think it'll go a looooong way to simplifying things for people. We're pretty excited about that on our ends.

So... Smarty templates. Yeah, it takes a little work to make sense of how they work.

Do any of the existing HTML/Printer-friendly options somewhat resemble what you're trying to do? That would be a good place to start: make a copy of one of the Export Types and start playing around with that.

Also, is is the style, or the formatting of the content that you're trying to change, exactly?

- Ben


RE: Export Manager: Custom Table View - heywood7 - Jan 2nd, 2012

(Dec 31st, 2011, 12:24 PM)Ben Wrote: Do any of the existing HTML/Printer-friendly options somewhat resemble what you're trying to do? That would be a good place to start: make a copy of one of the Export Types and start playing around with that.

The One-by-one option is the closest, formatting-wise.
[attachment=165]

However, this screenshot of the email I receive has the ideal formatting. I would like to replicate this look.
[attachment=166]



RE: Export Manager: Custom Table View - Ben - Jan 8th, 2012

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.

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


RE: Export Manager: Custom Table View - ttuhsc-library-user - Jul 16th, 2012

Ben - this post was most helpful and I was able to modify it to fit my similar needs.

However, my problem is that although the view/report looks perfect in the popup window, my inline CSS in my table is discarded when I print. Any way to prevent this?

UPDATE - this was solved by simply setting a fixed height for the table. Changed from 100% to 400px


RE: Export Manager: Custom Table View - dedy - Sep 10th, 2012

thankyou mr. Ben, this is also solve my problem, but how if we want put image (view), in that export layout? because it is just appear the link, and if i put <img src=...> there is a hyperlink code inside..

sorry for may bad English, would you can solve my problem


RE: Export Manager: Custom Table View - jgold723 - Mar 27th, 2014

(Sep 10th, 2012, 2:55 PM)dedy Wrote: thankyou mr. Ben, this is also solve my problem, but how if we want put image (view), in that export layout? because it is just appear the link, and if i put <img src=...> there is a hyperlink code inside..

sorry for may bad English, would you can solve my problem

Hi Same question here -- how do I override the automatic linking of files (the addition of the <a href="") so that I can display an image?


RE: Export Manager: Custom Table View - ttuhsc-library-user - May 10th, 2018

(Jan 8th, 2012, 1:33 PM)Ben Wrote: 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.

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

Ben this has stopped working when I updated to FormTools 3.0.1 and Export Manager 3.0.5.  Are there any plans to update the script?

Thanks!

Paul


RE: Export Manager: Custom Table View - icehell - Jan 24th, 2021

I have the same problem, I will be happy if someone can help.