Embed SQL Results Output
You can run report output without having to create a report. Just set the reportico project that relates to the database you want to run against (using the initial_project parameter) and use the initial_sql parameter to provide the SQL query. Note you cannot use the SELECT * notation in Reportico, you have to specify report columns.
Notice how column aliases in the SQL are used to set column titles.
$engine = App::make("getReporticoEngine"); $engine->initial_execute_mode = "EXECUTE"; $engine->access_mode = "ONEREPORT"; $engine->initial_sql = "SELECT CustomerID AS Id, companyname as company, contactname as contact_name FROM northwind_customers"; $engine->initial_project = "northwind"; $engine->initial_project_password = "password"; // If project password required $engine->set_attribute("ReportTitle","Customer List"); $engine->clear_reportico_session = true; $engine->execute();
Note the use of the set_attribute function to set the report title. You can hide the report title instead using the call :-
$engine->output_template_parameters["show_hide_report_output_title"] = "hide";
Customer List
Id | Company | Contact Name |
---|---|---|
ALFAA | Alfreds Futterkiste | Maria Anders |
ANATR | Ana Trujillo Emparedados y helados | Ana Trujillo |
ANTON | Antonio Moreno Taquería | Antonio Moreno |
AROUT | Around the Horn | Thomas Hardy |
BERGS | Berglunds snabbköp | Christina Berglund |
BLAUS | Blauer See Delikatessen | Hanna Moos |
BLONP | Blondel père et fils | Frédérique Citeaux |
BOLID | Bólido Comidas preparadas | Martín Sommer |
BONAP | Bon app' | Laurence Lebihan |
BOTTM | Bottom-Dollar Markets | Elizabeth Lincoln |
BSBEV | B's Beverages | Victoria Ashworth |
CACTU | Cactus Comidas para llevar | Patricio Simpson |
CENTC | Centro comercial Moctezuma | Francisco Chang |
CHOPS | Chop-suey Chinese | Yang Wang |
COMMI | Comércio Mineiro | Pedro Afonso |
CONSH | Consolidated Holdings | Elizabeth Brown |
DRACD | Drachenblut Delikatessen | Sven Ottlieb |
DUMON | Du monde entier | Janine Labrune |
EASTC | Eastern Connection | Ann Devon |
ERNSH | Ernst Handel | Roland Mendel |
FAMIA | Familia Arquibaldo | Aria Cruz |
FISSA | FISSA Fabrica Inter. Salchichas S.A. | Diego Roel |
FOLIG | Folies gourmandes | Martine Rancé |
FOLKO | Folk och fä HB | Maria Larsson |
FRANK | Frankenversand | Peter Franken |
FRANR | France restauration | Carine Schmitt |
FRANS | Franchi S.p.A. | Paolo Accorti |
FURIB | Furia Bacalhau e Frutos do Mar | Lino Rodriguez |
GALED | Galería del gastrónomo | Eduardo Saavedra |
GODOS | Godos Cocina Típica | José Pedro Freyre |
GOURL | Gourmet Lanchonetes | André Fonseca |
GREAL | Great Lakes Food Market | Howard Snyder |
GROSR | GROSELLA-Restaurante | Manuel Pereira |
HANAR | Hanari Carnes | Mario Pontes |
HILAA | HILARIÓN-Abastos | Carlos Hernández |
HUNGC | Hungry Coyote Import Store | Yoshi Latimer |
HUNGO | Hungry Owl All-Night Grocers | Patricia McKenna |
ISLAT | Island Trading | Helen Bennett |
KOENE | Königlich Essen | Philip Cramer |
LACOR | La corne d'abondance | Daniel Tonini |
LAMAI | La maison d'Asie | Annette Roulet |
LAUGB | Laughing Bacchus Wine Cellars | Yoshi Tannamuri |
LAZYK | Lazy K Kountry Store | John Steel |
LEHMS | Lehmanns Marktstand | Renate Messner |
LETSS | Let's Stop N Shop | Jaime Yorres |
LILAS | LILA-Supermercado | Carlos González |
LINOD | LINO-Delicateses | Felipe Izquierdo |
LONEP | Lonesome Pine Restaurant | Fran Wilson |
MAGAA | Magazzini Alimentari Riuniti | Giovanni Rovelli |
MAISD | Maison Dewey | Catherine Dewey |
MEREP | Mère Paillarde | Jean Fresnière |
MORGK | Morgenstern Gesundkost | Alexander Feuer |
NORTS | North/South | Simon Crowther |
OCEAN | Océano Atlántico Ltda. | Yvonne Moncada |
OLDWO | Old World Delicatessen | Rene Phillips |
OTTIK | Ottilies Käseladen | Henriette Pfalzheim |
PARIS | Paris spécialités | Marie Bertrand |
PERIC | Pericles Comidas clásicas | Guillermo Fernández |
PICCO | Piccolo und mehr | Georg Pipps |
PRINI | Princesa Isabel Vinhos | Isabel de Castro |
QUEDE | Que Delícia | Bernardo Batista |
QUEEN | Queen Cozinha | Lúcia Carvalho |
QUICK | QUICK-Stop | Horst Kloss |
RANCH | Rancho grande | Sergio Gutiérrez |
RATTC | Rattlesnake Canyon Grocery | Paula Wilson |
REGGC | Reggiani Caseifici | Maurizio Moroni |
RICAR | Ricardo Adocicados | Janete Limeira |
RICSU | Richter Supermarkt | Michael Holz |
ROMEY | Romero y tomillo | Alejandra Camino |
SANTG | Santé Gourmet | Jonas Bergulfsen |
SAVEA | Save-a-lot Markets | Jose Pavarotti |
SEVES | Seven Seas Imports | Hari Kumar |
SIMOB | Simons bistro | Jytte Petersen |
SPECD | Spécialités du monde | Dominique Perrier |
SPLIR | Split Rail Beer & Ale | Art Braunschweiger |
SUPRD | Suprêmes délices | Pascale Cartrain |
THEBI | The Big Cheese | Liz Nixon |
THECR | The Cracker Box | Liu Wong |
TOMSP | Toms Spezialitäten | Karin Josephs |
TORTU | Tortuga Restaurante | Miguel Angel Paolino |
TRADH | Tradição Hipermercados | Anabela Domingues |
TRAIH | Trail's Head Gourmet Provisioners | Helvetius Nagy |
VAFFE | Vaffeljernet | Palle Ibsen |
VICTE | Victuailles en stock | Mary Saveley |
VINET | Vins et alcools Chevalier | Paul Henriot |
WANDK | Die Wandernde Kuh | Rita Müller |
WARTH | Wartian Herkku | Pirkko Koskitalo |
WELLI | Wellington Importadora | Paula Parente |
WHITC | White Clover Markets | Karl Jablonski |
WILMK | Wilman Kala | Matti Karttunen |
WOLZA | Wolski Zajazd | Zbyszek Piestrzeniewicz |