SlideShare a Scribd company logo
1 of 19
Generating reports with
the Forena module
Session topics

Intro

The Forena module itself

RCN2: project to create reports for

Real life samples

Q&A
Introducton

Forena: one of hidden gems

Could be an alternative for Views

Version 7.x

Session outcome for visitors
The Forena Reports module

Allows to generate reports when you have SQL to get data
from DB;

Actually, this might be not only Drupal DB;

… and even not only database;

Report consists from 2 parts — SQL and kind of extended
HTML;

Included nice sample reports in the package;

Have a several video screencasts in English;

About ¾ of potentially custom reports can be done with
Forena
Sample report
Data
SQL
Format
Sample report
Data
SQL
Format
--ACCESS=access demo reports
select * from states
ORDER BY name
Data
SQL
Data
SQL
Data
SQL
Format
<body>
<div frx:block="sampledb/states" id="forena-1">
<table>
<thead>
<tr>
<th>code</th>
<th>name</th>
</tr>
</thead>
<tbody>
<tr frx:foreach="*" id="forena-2" class="test {code}">
<td>{code}</td>
<td>{name}</td>
</tr>
</tbody>
</table>
</div>
</body>
Need more?
1) Field modifiers:
<frx:field id="date"
format="iso_date"
format-string="Y-m-d"/>
<frx:field id="total_cost"
format="php"
format-string="return
RcnFormats::currency_format($value);"/>
2) Parameters;
3) Formatters
Need more?
1) Field modifiers;
2) Parameters in SQL:
... WHERE j.job_id_pk = :job_id
3) Formatters
Need more?
1) Field modifiers;
2) Parameters in SQL;
3) Formatters:
natively provided export to popular formats like
CSV, XML, … :
<frx:docgen>
<frx:doc type="..."/>
</frx:docgen>
RCN2: a few words about the
applied project

Intranet ERP system;

Complex business logic;

Shared database with a few other systems;

Reporting is one of crucial parts;
RCN2: Postgres related info

Datasets aren't huge but diversed — there's
many specialized heavily linked tables;

Active usage of Postgres-specific features;
Solution

Views/Custom pages/Forena reports —
approximately 20% - 20% - 60%;

About 80 *.frx files on production website;
Real life report SQLs – 1/3
Your SQL can be complicated: i.e. some kinky WITH()
--ACCESS=can access reports
WITH base_model_info as (
SELECT m.model_desc base_model
,m.model_id_pk estimate_model_id
,mc.model_component_id_pk model_component_id_pk
FROM model_components mc JOIN models m
ON(mc.model_id_fk = m.model_id_pk)
WHERE model_component_type = 'Base'
)
SELECT
c.composite_id_pk Composite_ID
,c.composite_desc Composite_Description
,bmi.base_model Base_Model
...
Real life report SQLs – 2/3
Mighty WHEN-THEN-ELSE, JOINS and GROUP BY's
... FROM v_job_latest_status
INNER JOIN v_jobs_no_contract_value j ON v_job_latest_status.job_id_fk =
j.job_id_pk
LEFT JOIN v_jobmst jm ON j.rdms_job_number = jm.job_number
LEFT JOIN (
SELECT job_id,
SUM(
COALESCE(amount, 0) *
CASE
WHEN amount_key_name = 'debit_nett_amount' OR
amount_key_name = 'amount_excl_gst'
THEN 1
WHEN amount_key_name = 'credit_nett_amount' OR
amount_key_name = 'credit_net_amount' THEN -1
ELSE 0
END
) AS expenditure
FROM v_job_order_expenditure
GROUP BY job_id
) AS e ON e.job_id = j.job_id_pk
LEFT JOIN ( ...
Real life report SQLs – 3/3
Brutal UNION and all that jazz together
... from v_cost_report
where group_id = :gl_group
union
select cast(category_id as text) as ordering , 'header' as
rowtype, null as job_number, null as supplier_name,
null as invoice_number, null as invoice_date, category_name as
transaction_description, cast(null as numeric) as amount
from v_cost_report
where group_id = :gl_group
and effective_date > :from_date
and effective_date < :to_date
union
select category_id||'-z' as ordering , 'cat total' as
rowtype,null as job_number, null as supplier_name, ...
Hints and links

http://drupal.org/project/forena

7.x-3.4 is out, we've spoken about 7.x-2.x
(supporting SVGGraph, etc)

Could be a good step from 7.x to 8.x
About me

Area of interests and expertise:

Backend programming;

Drupal as a CMF;

Aegir, Mediamosa;

Troubleshooting.
Questions?
dennis.povshedny@gmail.com
+38 096 2323 346
http://drupal.org/user/117896
www.slideshare.net/workingday
www.linkedin.com/in/1dennis1

More Related Content

Similar to Drupal CMS: generating reports with the Forena module.

]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & Dashboards]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & DashboardsKlaus Hofeditz
 
MSBI Online Training in Hyderabad
MSBI Online Training in HyderabadMSBI Online Training in Hyderabad
MSBI Online Training in Hyderabadunited global soft
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and MonitoringMark Leith
 
web programming using html,css, JavaScript ,php etc
web programming using html,css, JavaScript ,php etcweb programming using html,css, JavaScript ,php etc
web programming using html,css, JavaScript ,php etcalbinjamestpra
 
Evolutionary db development
Evolutionary db development Evolutionary db development
Evolutionary db development Open Party
 
Raybiztech Guide To Backbone Javascript Library
Raybiztech Guide To Backbone Javascript LibraryRaybiztech Guide To Backbone Javascript Library
Raybiztech Guide To Backbone Javascript Libraryray biztech
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Euclid Data Model 101 - Episode 01: Overview
Euclid Data Model 101 - Episode 01: OverviewEuclid Data Model 101 - Episode 01: Overview
Euclid Data Model 101 - Episode 01: Overvieweuc-dm-test
 
Generating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerGenerating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerRob van den Berg
 
Data Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseData Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseMichael Rosenblum
 
Workload Management with MicroStrategy Software and IBM DB2 9.5
Workload Management with MicroStrategy Software and IBM DB2 9.5Workload Management with MicroStrategy Software and IBM DB2 9.5
Workload Management with MicroStrategy Software and IBM DB2 9.5BiBoard.Org
 
Analysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptxAnalysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptxBrendan Furey
 
Database Foundation Training
Database Foundation TrainingDatabase Foundation Training
Database Foundation TrainingFranky Lao
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructuredAmi Mahloof
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules RestructuredDoiT International
 
Top Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and TricksTop Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and TricksDMC, Inc.
 

Similar to Drupal CMS: generating reports with the Forena module. (20)

Sql Nexus
Sql NexusSql Nexus
Sql Nexus
 
]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & Dashboards]po[ Developers: Reporting, Indicators & Dashboards
]po[ Developers: Reporting, Indicators & Dashboards
 
MSBI Online Training in India
MSBI Online Training in IndiaMSBI Online Training in India
MSBI Online Training in India
 
MSBI Online Training in Hyderabad
MSBI Online Training in HyderabadMSBI Online Training in Hyderabad
MSBI Online Training in Hyderabad
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and Monitoring
 
web programming using html,css, JavaScript ,php etc
web programming using html,css, JavaScript ,php etcweb programming using html,css, JavaScript ,php etc
web programming using html,css, JavaScript ,php etc
 
Evolutionary db development
Evolutionary db development Evolutionary db development
Evolutionary db development
 
Raybiztech Guide To Backbone Javascript Library
Raybiztech Guide To Backbone Javascript LibraryRaybiztech Guide To Backbone Javascript Library
Raybiztech Guide To Backbone Javascript Library
 
Create Components in TomatoCMS
Create Components in TomatoCMSCreate Components in TomatoCMS
Create Components in TomatoCMS
 
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu   (obscure) tools of the trade for tuning oracle sq lsTony Jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony Jambu (obscure) tools of the trade for tuning oracle sq ls
 
Euclid Data Model 101 - Episode 01: Overview
Euclid Data Model 101 - Episode 01: OverviewEuclid Data Model 101 - Episode 01: Overview
Euclid Data Model 101 - Episode 01: Overview
 
Generating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data ModelerGenerating Code with Oracle SQL Developer Data Modeler
Generating Code with Oracle SQL Developer Data Modeler
 
Data Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your DatabaseData Tracking: On the Hunt for Information about Your Database
Data Tracking: On the Hunt for Information about Your Database
 
Workload Management with MicroStrategy Software and IBM DB2 9.5
Workload Management with MicroStrategy Software and IBM DB2 9.5Workload Management with MicroStrategy Software and IBM DB2 9.5
Workload Management with MicroStrategy Software and IBM DB2 9.5
 
A
AA
A
 
Analysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptxAnalysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptx
 
Database Foundation Training
Database Foundation TrainingDatabase Foundation Training
Database Foundation Training
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules Restructured
 
Top Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and TricksTop Ten Siemens S7 Tips and Tricks
Top Ten Siemens S7 Tips and Tricks
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Drupal CMS: generating reports with the Forena module.

  • 2. Session topics  Intro  The Forena module itself  RCN2: project to create reports for  Real life samples  Q&A
  • 3. Introducton  Forena: one of hidden gems  Could be an alternative for Views  Version 7.x  Session outcome for visitors
  • 4. The Forena Reports module  Allows to generate reports when you have SQL to get data from DB;  Actually, this might be not only Drupal DB;  … and even not only database;  Report consists from 2 parts — SQL and kind of extended HTML;  Included nice sample reports in the package;  Have a several video screencasts in English;  About ¾ of potentially custom reports can be done with Forena
  • 6. Sample report Data SQL Format --ACCESS=access demo reports select * from states ORDER BY name Data SQL Data SQL
  • 7. Data SQL Format <body> <div frx:block="sampledb/states" id="forena-1"> <table> <thead> <tr> <th>code</th> <th>name</th> </tr> </thead> <tbody> <tr frx:foreach="*" id="forena-2" class="test {code}"> <td>{code}</td> <td>{name}</td> </tr> </tbody> </table> </div> </body>
  • 8. Need more? 1) Field modifiers: <frx:field id="date" format="iso_date" format-string="Y-m-d"/> <frx:field id="total_cost" format="php" format-string="return RcnFormats::currency_format($value);"/> 2) Parameters; 3) Formatters
  • 9. Need more? 1) Field modifiers; 2) Parameters in SQL: ... WHERE j.job_id_pk = :job_id 3) Formatters
  • 10. Need more? 1) Field modifiers; 2) Parameters in SQL; 3) Formatters: natively provided export to popular formats like CSV, XML, … : <frx:docgen> <frx:doc type="..."/> </frx:docgen>
  • 11. RCN2: a few words about the applied project  Intranet ERP system;  Complex business logic;  Shared database with a few other systems;  Reporting is one of crucial parts;
  • 12. RCN2: Postgres related info  Datasets aren't huge but diversed — there's many specialized heavily linked tables;  Active usage of Postgres-specific features;
  • 13. Solution  Views/Custom pages/Forena reports — approximately 20% - 20% - 60%;  About 80 *.frx files on production website;
  • 14. Real life report SQLs – 1/3 Your SQL can be complicated: i.e. some kinky WITH() --ACCESS=can access reports WITH base_model_info as ( SELECT m.model_desc base_model ,m.model_id_pk estimate_model_id ,mc.model_component_id_pk model_component_id_pk FROM model_components mc JOIN models m ON(mc.model_id_fk = m.model_id_pk) WHERE model_component_type = 'Base' ) SELECT c.composite_id_pk Composite_ID ,c.composite_desc Composite_Description ,bmi.base_model Base_Model ...
  • 15. Real life report SQLs – 2/3 Mighty WHEN-THEN-ELSE, JOINS and GROUP BY's ... FROM v_job_latest_status INNER JOIN v_jobs_no_contract_value j ON v_job_latest_status.job_id_fk = j.job_id_pk LEFT JOIN v_jobmst jm ON j.rdms_job_number = jm.job_number LEFT JOIN ( SELECT job_id, SUM( COALESCE(amount, 0) * CASE WHEN amount_key_name = 'debit_nett_amount' OR amount_key_name = 'amount_excl_gst' THEN 1 WHEN amount_key_name = 'credit_nett_amount' OR amount_key_name = 'credit_net_amount' THEN -1 ELSE 0 END ) AS expenditure FROM v_job_order_expenditure GROUP BY job_id ) AS e ON e.job_id = j.job_id_pk LEFT JOIN ( ...
  • 16. Real life report SQLs – 3/3 Brutal UNION and all that jazz together ... from v_cost_report where group_id = :gl_group union select cast(category_id as text) as ordering , 'header' as rowtype, null as job_number, null as supplier_name, null as invoice_number, null as invoice_date, category_name as transaction_description, cast(null as numeric) as amount from v_cost_report where group_id = :gl_group and effective_date > :from_date and effective_date < :to_date union select category_id||'-z' as ordering , 'cat total' as rowtype,null as job_number, null as supplier_name, ...
  • 17. Hints and links  http://drupal.org/project/forena  7.x-3.4 is out, we've spoken about 7.x-2.x (supporting SVGGraph, etc)  Could be a good step from 7.x to 8.x
  • 18. About me  Area of interests and expertise:  Backend programming;  Drupal as a CMF;  Aegir, Mediamosa;  Troubleshooting.
  • 19. Questions? dennis.povshedny@gmail.com +38 096 2323 346 http://drupal.org/user/117896 www.slideshare.net/workingday www.linkedin.com/in/1dennis1