SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
Building a reporting system with
BREW



Xavi Guardiola
Chief Technology Officer
Simpple - Xarxa Sanitària i Social de Santa Tecla


xavier.guardiola@simpple.com
    @xguardi
Enterprise report generation

  Datawharehouse


   Data analysis

                        Report template wizards:
  Report template       Jasper Reports, BIRT, etc.

         Report

                        Report distribution:
   Rep    Rep     Rep   Web, email.
                        Dynamic reports
Enterprise reporting design shortcomings

Poor in-report logic.
Not a best practice but most of the times inevitable!



Ugly defaults.
Please, check out Tufte books.


Simple plots.
Sometimes you need statistical or more complex plots.




Regular users should be able to create their own reports. Really?
Brew The dumbest example

            example.brew
             <% x <- 2 %>
             Good morning.
             Today the kilo oranges
             is priced at <%= x %> euros.




            R> brew(“example.brew”, “example.txt”)


            example.txt
             Good morning.
             Today the kilo oranges
             is priced at 2 euros.
Brew Precomputing things before

              example.R
               x <- 2
               save(x, file= “data.Rdata”)


              example.brew
               <% load(“data.Rdata”) %>
               Good morning.
               Today the kilo oranges
               is priced at <%= x %> euros.


              R> brew(“example.brew”, “example.txt”)

              example.txt
               Good morning.
               Today the kilo oranges
               is priced at 2 euros.
Brew Smart templates
             example.R
              x <- 2
              save(x, file= “data.Rdata”)


             example.brew
              <% load(“data.Rdata”)   %>
              Good morning.
              Today the kilo oranges
              is priced at <%= x %> euros.
              <% if x > 1 %>
              That’s f***ing expensive!
              <% end %>



             R> brew(“example.brew”, “example.txt”)

             example.txt
              Good morning.
              Today the kilo oranges
              is priced at 2 euros.
              That’s f***ing expensive!
Brew + latex
      example.brew
       begin{document}
       Today the kilo oranges $rightarrow$ <%= x %> euros.
       end{document}


      R> brew(“example.brew”, “example.tex”)

      example.tex
       begin{document}
       Today the kilo oranges $rightarrow$ 2 euros.
       end{document}




      R> texi2dvi(“example.tex”, pdf=TRUE)

      example.pdf

        Today the kilo oranges   !   2 euros.
The alternative stack

                                                R selects DB data
  Datawharehouse        Datawharehouse          RJDBC, RMySQL, etc.


                                                R computes results and
   Data analysis               R script         plots.

                                                Latex brew template loads
  Report template       Brew latex template     results and plots and
                                                generate template file

                                                PDF report is generated
         Report                Report           from the tex file



   Rep    Rep     Rep    Rep     Rep      Rep
Report example
Report example
Report example
Brew vs Sweave
example.brew                        example.Rnw

 begin{document}                    begin{document}

 begin{table}                       <<Table1, echo=F,results=tex>>=
 <% for (i in 1:nrow(data)) { -%>    print(xtable(data))
   <%= data$name[i] %> &             @
   <%= data$value[i] %> 
 end{table}                         Price is Sexpr{x}

 Price is <%= x %>                   <<plot1, echo=F, fig=T>>==
                                     print(plot1)
 begin{figure}                      @
   includegraphics{...}
 end{figure}                        end{document}

 end{document}
Thanks!

Contenu connexe

En vedette

Business Model_Innovation_JMA_6Jul2015
Business Model_Innovation_JMA_6Jul2015Business Model_Innovation_JMA_6Jul2015
Business Model_Innovation_JMA_6Jul2015
Shin Yamamoto
 
Service Concept & scenario
Service Concept & scenarioService Concept & scenario
Service Concept & scenario
Yves Pigneur
 
Disruptive Business Model
Disruptive Business ModelDisruptive Business Model
Disruptive Business Model
Yves Pigneur
 
Performance measure
Performance measurePerformance measure
Performance measure
Yves Pigneur
 

En vedette (10)

Business Model_Innovation_JMA_6Jul2015
Business Model_Innovation_JMA_6Jul2015Business Model_Innovation_JMA_6Jul2015
Business Model_Innovation_JMA_6Jul2015
 
Service Concept & scenario
Service Concept & scenarioService Concept & scenario
Service Concept & scenario
 
Disruptive Business Model
Disruptive Business ModelDisruptive Business Model
Disruptive Business Model
 
Performance measure
Performance measurePerformance measure
Performance measure
 
Business Model Innovation
Business Model Innovation Business Model Innovation
Business Model Innovation
 
Business Model Innovation and Design at Todai
Business Model Innovation and Design at TodaiBusiness Model Innovation and Design at Todai
Business Model Innovation and Design at Todai
 
独自のビジネスモデルと顧客価値を創造する方法
独自のビジネスモデルと顧客価値を創造する方法独自のビジネスモデルと顧客価値を創造する方法
独自のビジネスモデルと顧客価値を創造する方法
 
Service Design
Service DesignService Design
Service Design
 
Value Proposition Canvas (explained)
Value Proposition Canvas (explained)Value Proposition Canvas (explained)
Value Proposition Canvas (explained)
 
Value Proposition Design
Value Proposition DesignValue Proposition Design
Value Proposition Design
 

Similaire à Building a reporting sytem with BREW

Modern Architecture
Modern ArchitectureModern Architecture
Modern Architecture
ryandotsmith
 
PHP and MySQL with snapshots
 PHP and MySQL with snapshots PHP and MySQL with snapshots
PHP and MySQL with snapshots
richambra
 
Defensive Programming 2013-03-18
Defensive Programming 2013-03-18Defensive Programming 2013-03-18
Defensive Programming 2013-03-18
Laura A Schild
 
Capacity Management for Web Operations
Capacity Management for Web OperationsCapacity Management for Web Operations
Capacity Management for Web Operations
John Allspaw
 

Similaire à Building a reporting sytem with BREW (20)

Principals, Practices, and Habits
Principals, Practices, and HabitsPrincipals, Practices, and Habits
Principals, Practices, and Habits
 
Next Generation Programming in R
Next Generation Programming in RNext Generation Programming in R
Next Generation Programming in R
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive Statistics
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQuery
 
A Multiformat Document Workflow With Docutils
A Multiformat Document Workflow With DocutilsA Multiformat Document Workflow With Docutils
A Multiformat Document Workflow With Docutils
 
Modern Architecture
Modern ArchitectureModern Architecture
Modern Architecture
 
Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel
 
JRuby on Rails, Flying Saucer
JRuby on Rails, Flying SaucerJRuby on Rails, Flying Saucer
JRuby on Rails, Flying Saucer
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oop
 
PHP and MySQL with snapshots
 PHP and MySQL with snapshots PHP and MySQL with snapshots
PHP and MySQL with snapshots
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with R
 
PyRate for fun and research
PyRate for fun and researchPyRate for fun and research
PyRate for fun and research
 
Client Side rendering Not so Easy
Client Side rendering Not so EasyClient Side rendering Not so Easy
Client Side rendering Not so Easy
 
Defensive Programming 2013-03-18
Defensive Programming 2013-03-18Defensive Programming 2013-03-18
Defensive Programming 2013-03-18
 
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
Distributed, Incremental Dataflow Processing on AWS with GRAIL's Reflow (CMP3...
 
Capacity Management for Web Operations
Capacity Management for Web OperationsCapacity Management for Web Operations
Capacity Management for Web Operations
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
Php + my sql
Php + my sqlPhp + my sql
Php + my sql
 
Rmarkdown cheatsheet-2.0
Rmarkdown cheatsheet-2.0Rmarkdown cheatsheet-2.0
Rmarkdown cheatsheet-2.0
 

Dernier

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 

Building a reporting sytem with BREW

  • 1. Building a reporting system with BREW Xavi Guardiola Chief Technology Officer Simpple - Xarxa Sanitària i Social de Santa Tecla xavier.guardiola@simpple.com @xguardi
  • 2. Enterprise report generation Datawharehouse Data analysis Report template wizards: Report template Jasper Reports, BIRT, etc. Report Report distribution: Rep Rep Rep Web, email. Dynamic reports
  • 3. Enterprise reporting design shortcomings Poor in-report logic. Not a best practice but most of the times inevitable! Ugly defaults. Please, check out Tufte books. Simple plots. Sometimes you need statistical or more complex plots. Regular users should be able to create their own reports. Really?
  • 4. Brew The dumbest example example.brew <% x <- 2 %> Good morning. Today the kilo oranges is priced at <%= x %> euros. R> brew(“example.brew”, “example.txt”) example.txt Good morning. Today the kilo oranges is priced at 2 euros.
  • 5. Brew Precomputing things before example.R x <- 2 save(x, file= “data.Rdata”) example.brew <% load(“data.Rdata”) %> Good morning. Today the kilo oranges is priced at <%= x %> euros. R> brew(“example.brew”, “example.txt”) example.txt Good morning. Today the kilo oranges is priced at 2 euros.
  • 6. Brew Smart templates example.R x <- 2 save(x, file= “data.Rdata”) example.brew <% load(“data.Rdata”) %> Good morning. Today the kilo oranges is priced at <%= x %> euros. <% if x > 1 %> That’s f***ing expensive! <% end %> R> brew(“example.brew”, “example.txt”) example.txt Good morning. Today the kilo oranges is priced at 2 euros. That’s f***ing expensive!
  • 7. Brew + latex example.brew begin{document} Today the kilo oranges $rightarrow$ <%= x %> euros. end{document} R> brew(“example.brew”, “example.tex”) example.tex begin{document} Today the kilo oranges $rightarrow$ 2 euros. end{document} R> texi2dvi(“example.tex”, pdf=TRUE) example.pdf Today the kilo oranges ! 2 euros.
  • 8. The alternative stack R selects DB data Datawharehouse Datawharehouse RJDBC, RMySQL, etc. R computes results and Data analysis R script plots. Latex brew template loads Report template Brew latex template results and plots and generate template file PDF report is generated Report Report from the tex file Rep Rep Rep Rep Rep Rep
  • 12. Brew vs Sweave example.brew example.Rnw begin{document} begin{document} begin{table} <<Table1, echo=F,results=tex>>= <% for (i in 1:nrow(data)) { -%> print(xtable(data)) <%= data$name[i] %> & @ <%= data$value[i] %> end{table} Price is Sexpr{x} Price is <%= x %> <<plot1, echo=F, fig=T>>== print(plot1) begin{figure} @ includegraphics{...} end{figure} end{document} end{document}