function run($show_details = true, $height = 0, $table_element = '', $objectid = 0, $preview = -1, $force_list_mode = false)
 {
     global $conf;
     $PDOdb =& $this->pdodb;
     $this->show_details = $show_details;
     if ($preview !== -1) {
         $this->preview = $preview;
     }
     if (empty($this->nb_result_max)) {
         $this->nb_result_max = empty($conf->global->ABRICOT_NB_MAX_RESULT_SQL) ? 2000 : $conf->global->ABRICOT_NB_MAX_RESULT_SQL;
     }
     if ($this->preview) {
         $this->nb_result_max = 10;
     }
     if (!empty($height)) {
         $this->height = $height;
     }
     if ($force_list_mode) {
         $list = load_fiche_titre($this->title) . $this->runList($PDOdb, '', $table_element, $objectid);
     } else {
         if ($this->type == 'CHART') {
             $list = $this->runChart($PDOdb, 'ColumnChart', $table_element, $objectid);
         } else {
             if ($this->type == 'LINE') {
                 $list = $this->runChart($PDOdb, 'LineChart', $table_element, $objectid);
             } else {
                 if ($this->type == 'PIE') {
                     $list = $this->runChart($PDOdb, 'PieChart', $table_element, $objectid);
                 } else {
                     if ($this->type == 'AREA') {
                         $list = $this->runChart($PDOdb, 'AreaChart', $table_element, $objectid);
                     } else {
                         if ($this->type == 'RAW') {
                             return $this->runRAW($PDOdb, $table_element, $objectid);
                         } else {
                             if ($this->type == 'SIMPLELIST' || $this->preview) {
                                 $list = load_fiche_titre($this->title) . $this->runList($PDOdb, dol_buildpath('/query/tpl/html.simplelist.tbs.html'), $table_element, $objectid);
                             } else {
                                 $list = load_fiche_titre($this->title) . $this->runList($PDOdb, '', $table_element, $objectid);
                             }
                         }
                     }
                 }
             }
         }
     }
     $form = new TFormCore();
     $html .= $form->begin_form('auto', 'formQuery' . $this->getId(), 'get');
     $action = GETPOST('action') != '' ? GETPOST('action') : 'run';
     $html .= $form->hidden('action', $action);
     $html .= $form->hidden('id', GETPOST('id') ? GETPOST('id') : $this->getId());
     $html .= $list;
     $html .= $form->end();
     return $html;
 }