Index: core/ReportRenderer/Pdf.php
===================================================================
--- core/ReportRenderer/Pdf.php	(revision 5397)
+++ core/ReportRenderer/Pdf.php	(revision )
@@ -49,10 +49,11 @@
 	private $rowTopBottomBorder = array(231, 231, 231);
 	private $report;
 	private $reportMetadata;
+	private $displayGraph;
+	private $displayTable;
 	private $reportColumns;
 	private $reportRowsMetadata;
 	private $currentPage = 0;
-	private $lastTableIsSmallReport = false;
 	private $reportFont = Piwik_ReportRenderer::DEFAULT_REPORT_FONT;
 	private $TCPDF;
 
@@ -151,23 +152,48 @@
 	 */
 	private function paintReportHeader()
 	{
-		$currentTableIsSmallReport = count($this->reportColumns) == 2;
+		$isAggregateReport = Piwik_PDFReports_API::isAggregateReport($this->reportMetadata);
+
+		// Graph-only report
+		static $graphOnlyReportCount = 0;
+		$graphOnlyReport = $isAggregateReport && $this->displayGraph && !$this->displayTable;
+
+		// Table-only 2-column report
+		static $tableOnly2ColumnReportCount = 0;
+		$tableOnly2ColumnReport = $isAggregateReport
+								  && !$this->displayGraph
+								  && $this->displayTable
+								  && count($this->reportColumns) == 2;
+
 		$reportHasData = $this->reportHasData();
 		// Only a page break before if the current report has some data
-		if (($reportHasData
-			 // or if it is the first report
-			 || $this->currentPage == 0)
-			&& !($this->lastTableIsSmallReport
-				 && $currentTableIsSmallReport)) {
+		if ($reportHasData &&
+			// and
+			(
+				// it is the first report
+				$this->currentPage == 0
+				// or, it is a graph-only report and it is the first of a series of 3
+				|| ($graphOnlyReport && $graphOnlyReportCount == 0)
+				// or, it is a table-only 2-column report and it is the first of a series of 2
+				|| ($tableOnly2ColumnReport && $tableOnly2ColumnReportCount == 0)
+				// or it is not a graph-only report and not a table-only 2-column report
+				||	!$graphOnlyReport && !$tableOnly2ColumnReport
+			)
+		)
+		{
 			$this->currentPage++;
 			$columnCount = count($this->reportColumns);
 			$this->TCPDF->AddPage();
-			// Pages without data are always Portrait
+			// Pages without data and graph-only pages are always Portrait
 			if ($reportHasData) {
-				$this->TCPDF->setPageOrientation($columnCount > $this->maxColumnCountPortraitOrientation ? 'L' : 'P', '', $this->bottomMargin);
+				$pageOrientation = $graphOnlyReport ? 'P' : ($columnCount > $this->maxColumnCountPortraitOrientation ? 'L' : 'P');
+				$this->TCPDF->setPageOrientation($pageOrientation, '', $this->bottomMargin);
 			}
 		}
-		$this->lastTableIsSmallReport = $currentTableIsSmallReport;
+
+		$graphOnlyReportCount = ($graphOnlyReport && $reportHasData) ? ($graphOnlyReportCount + 1) % 3 : 0;
+		$tableOnly2ColumnReportCount = ($tableOnly2ColumnReport && $reportHasData) ? ($tableOnly2ColumnReportCount + 1) % 2 : 0;
+
 		$title = $this->formatText($this->reportMetadata['name']);
 		$this->TCPDF->SetFont($this->reportFont, $this->reportFontStyle, $this->reportHeaderFontSize);
 		$this->TCPDF->SetTextColor($this->headerTextColor[0], $this->headerTextColor[1], $this->headerTextColor[2]);
@@ -192,6 +218,8 @@
 	{
 		$this->reportMetadata = $processedReport['metadata'];
 		$this->reportRowsMetadata = $processedReport['reportMetadata'];
+		$this->displayGraph = $processedReport['displayGraph'];
+		$this->displayTable = $processedReport['displayTable'];
 		list($this->report, $this->reportColumns) = self::processTableFormat($this->reportMetadata, $processedReport['reportData'], $processedReport['columns']);
 
 		$this->paintReportHeader();
@@ -201,9 +229,22 @@
 			return;
 		}
 
+		if($this->displayGraph)
+		{
+			$this->paintGraph($processedReport['generatedImageGraph']);
+		}
+
+		if($this->displayGraph && $this->displayTable)
+		{
+			$this->TCPDF->Ln();
+		}
+
+		if($this->displayTable)
+		{
-		$this->paintReportTableHeader();
-		$this->paintReportTable();
-	}
+			$this->paintReportTableHeader();
+			$this->paintReportTable();
+		}
+	}
 
 	private function formatText($text)
 	{
@@ -294,7 +335,33 @@
 			$fill = !$fill;
 		}
 	}
+	private function paintGraph($imageGraph)
+	{
+		$this->TCPDF->Image(
+			'@'.$imageGraph,
+			$x = '',
+			$y = '',
+			$w = 0,
+			$h = 0,
+			$type = '',
+			$link = '',
+			$align = 'N',
+			$resize = false,
+			$dpi = 72,
+			$palign = '',
+			$ismask = false,
+			$imgmask = false,
+			$order = 0,
+			$fitbox = false,
+			$hidden = false,
+			$fitonpage = true,
+			$alt = false,
+			$altimgs = array()
+		);
 
+		unset($imageGraph);
+	}
+
 	/**
 	 * Draw the table header (first row)
 	 */
Index: core/ReportRenderer/Html.php
===================================================================
--- core/ReportRenderer/Html.php	(revision 5397)
+++ core/ReportRenderer/Html.php	(revision )
@@ -103,17 +103,34 @@
 		$this->assignCommonParameters($smarty);
 
 		$reportMetadata = $processedReport['metadata'];
-		$smarty->assign("reportName", $reportMetadata['name']);
-		$smarty->assign("reportId", $reportMetadata['uniqueId']);
-
 		$reportData = $processedReport['reportData'];
 		$columns = $processedReport['columns'];
 		list($reportData, $columns) = self::processTableFormat($reportMetadata, $reportData, $columns);
 
+		$smarty->assign("reportName", $reportMetadata['name']);
+		$smarty->assign("reportId", $reportMetadata['uniqueId']);
 		$smarty->assign("reportColumns", $columns);
 		$smarty->assign("reportRows", $reportData->getRows());
 		$smarty->assign("reportRowsMetadata", $processedReport['reportMetadata']->getRows());
+		$smarty->assign("displayTable", $processedReport['displayTable']);
 
+		$displayGraph = $processedReport['displayGraph'];
+		$smarty->assign("displayGraph", $displayGraph);
+
+		if($displayGraph)
+		{
+			$smarty->assign("graphWidth", Piwik_ReportRenderer::IMAGE_GRAPH_WIDTH);
+			$smarty->assign("graphHeight", Piwik_ReportRenderer::IMAGE_GRAPH_HEIGHT);
+			$smarty->assign("renderImageInline", $this->renderImageInline);
+
+			if($this->renderImageInline)
+			{
+				$generatedImageGraph = $processedReport['generatedImageGraph'];
+				$smarty->assign("generatedImageGraph", base64_encode($generatedImageGraph));
+				unset($generatedImageGraph);
+			}
+		}
+
 		$this->rendering .= $smarty->fetch(self::prefixTemplatePath("html_report_body.tpl"));
 	}
 
Index: plugins/API/API.php
===================================================================
--- plugins/API/API.php	(revision 5397)
+++ plugins/API/API.php	(revision )
@@ -754,6 +754,7 @@
 		{
 			$order = array(
 				Piwik_Translate('VisitsSummary_VisitsSummary'),
+				Piwik_Translate('Goals_Ecommerce'),
 				Piwik_Translate('Actions_Actions'),
 				Piwik_Translate('Referers_Referers'),
 				Piwik_Translate('Goals_Goals'),
Index: plugins/ImageGraph/API.php
===================================================================
--- plugins/ImageGraph/API.php	(revision 5397)
+++ plugins/ImageGraph/API.php	(revision )
@@ -31,7 +31,9 @@
 	
 	const GRAPH_OUTPUT_INLINE		= 0;
 	const GRAPH_OUTPUT_FILE			= 1;
+	//@ Review is this the correct wording ?
+	const GRAPH_OUTPUT_PHP			= 2;
-	
+
 	private $GRAPH_COLOR_PIE_0			= "3C5A69";
 	private $GRAPH_COLOR_PIE_1			= "679BB5";
 	private $GRAPH_COLOR_PIE_2			= "695A3C";
@@ -76,6 +78,8 @@
 							$width = false, $height = false, $fontSize = false, $aliasedGraph = true, $colors = false
 	)
 	{
+		Piwik::checkUserHasViewAccess($idSite);
+
 		// Health check - should we also test for GD2 only?
 		$extensions = @get_loaded_extensions();
 		if (!in_array('gd', $extensions)
@@ -352,7 +356,12 @@
 						$typeName = "BasicLine";
 						break;
 				}
-				$fileName = $typeName."_".$apiModule."_".$apiAction." $date $idSite.png";
+				$idGoal = Piwik_Common::getRequestVar('idGoal', '', 'string');
+				if($idGoal != '')
+				{
+					$idGoal = '_' . $idGoal;
+				}
+				$fileName = $typeName."_".$apiModule."_".$apiAction.$idGoal." ".str_replace(',', '-', $date)." $idSite.png";
 				$fileName = str_replace(array(" ","/"), "_", $fileName);
 				if(!Piwik_Common::isValidFilename($fileName))
 				{
@@ -361,7 +370,10 @@
 				$path = PIWIK_INCLUDE_PATH."/tmp/".$fileName;
 				$graph->Render($path);
 				return $path;
-				
+
+			case self::GRAPH_OUTPUT_PHP:
+				return $graph->Picture;
+
 			case self::GRAPH_OUTPUT_INLINE:
 			default:
 				$graph->Stroke();
@@ -398,4 +410,4 @@
 		$count++;
 	}
 	
-}
\ No newline at end of file
+}
Index: core/Updates/1.7.php
===================================================================
--- core/Updates/1.7.php	(revision )
+++ core/Updates/1.7.php	(revision )
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ * @version $Id: 1.4-rc1.php 4609 2011-04-30 01:46:23Z matt $
+ *
+ * @category Piwik
+ * @package Updates
+ */
+
+/**
+ * @package Updates
+ */
+class Piwik_Updates_1_7 extends Piwik_Updates
+{
+	static function getSql($schema = 'Myisam')
+	{
+		return array(
+		    'ALTER TABLE `'. Piwik_Common::prefixTable('pdf') .'`
+		    	ADD COLUMN `aggregate_reports_format` TINYINT(1) NOT NULL AFTER `reports`' => false,
+		);
+	}
+
+	static function update()
+	{
+		try {
+			Piwik_Updater::updateDatabase(__FILE__, self::getSql());
+		}
+		catch(Exception $e){}
+	}
+}
Index: plugins/PDFReports/API.php
===================================================================
--- plugins/PDFReports/API.php	(revision 5397)
+++ plugins/PDFReports/API.php	(revision )
@@ -53,12 +53,13 @@
 	 * @param string $reports Comma separated list of reports
 	 * @return int idReport generated
 	 */
-	public function addReport( $idSite, $description, $period, $reportFormat, $reports, $emailMe = true, $additionalEmails = false)
+	public function addReport( $idSite, $description, $period, $reportFormat, $aggregateReportsFormat, $reports, $emailMe = true, $additionalEmails = false)
 	{
 		Piwik::checkUserIsNotAnonymous();
 		Piwik::checkUserHasViewAccess($idSite);
 		$this->checkPeriod($period);
 		$this->checkFormat($reportFormat);
+		$this->checkAggregateReportsFormat($aggregateReportsFormat);
 		$description = $this->checkDescription($description);
 		$currentUser = Piwik::getCurrentUserLogin();
 		$emailMe = (int)$emailMe;
@@ -83,6 +84,7 @@
 						'description' => $description,
 						'period' => $period,
 						'format' => $reportFormat,
+						'aggregate_reports_format' => $aggregateReportsFormat,
 						'email_me' => $emailMe,
 						'additional_emails' => $additionalEmails,
 						'reports' => $reports,
@@ -106,7 +108,7 @@
 	 * 
 	 * @see addReport()
 	 */
-	public function updateReport( $idReport, $idSite, $description, $period, $reportFormat, $reports, $emailMe = true, $additionalEmails = false)
+	public function updateReport( $idReport, $idSite, $description, $period, $reportFormat, $aggregateReportsFormat, $reports, $emailMe = true, $additionalEmails = false)
 	{
 		Piwik::checkUserHasViewAccess($idSite);
 		$pdfReports = $this->getReports($idSite, $periodSearch = false, $idReport);
@@ -115,6 +117,7 @@
 		
 		$this->checkPeriod($period);
 		$this->checkFormat($reportFormat);
+		$this->checkAggregateReportsFormat($aggregateReportsFormat);
 		$description = $this->checkDescription($description);
 		$currentUser = Piwik::getCurrentUserLogin();
 		$emailMe = (int)$emailMe;
@@ -130,6 +133,7 @@
 						'description' => $description,
 						'period' => $period,
 						'format' => $reportFormat,
+						'aggregate_reports_format' => $aggregateReportsFormat,
 						'email_me' => $emailMe,
 						'additional_emails' => $additionalEmails,
 						'reports' => $reports,
@@ -209,14 +213,14 @@
 		
 		// Joining with the site table to work around pre-1.3 where reports could still be linked to a deleted site
 		$reports = Piwik_FetchAll("SELECT * 
-    							FROM ".Piwik_Common::prefixTable('pdf')." 
-    								JOIN ".Piwik_Common::prefixTable('site')."
-    								USING (idsite)
-    							WHERE deleted = 0
-    								$sqlWhere", $bind);
-    	// When a specific report was requested and not found, throw an error
-    	if($idReport !== false
-    		&& empty($reports))
+								FROM ".Piwik_Common::prefixTable('pdf')."
+									JOIN ".Piwik_Common::prefixTable('site')."
+									USING (idsite)
+								WHERE deleted = 0
+									$sqlWhere", $bind);
+		// When a specific report was requested and not found, throw an error
+		if($idReport !== false
+			&& empty($reports))
 		{
 			throw new Exception("Requested report couldn't be found.");
 		}
@@ -237,23 +241,19 @@
 	 * @param int|false $outputType 1 = download report, 2 = save report to disk, defaults to download
 	 * @param string|false $period Defaults to 'day'. If not specified, will default to the report's period set when creating the report
 	 * @param string $reportFormat pdf, html
+	 * @param int|false $aggregateReportsFormat 0 = display only tables, 1 = display only graphs, 2 = display both
 	 */
-	public function generateReport($idReport, $date, $idSite = false, $language = false, $outputType = false, $period = false, $reportFormat = false)
+	public function generateReport($idReport, $date, $idSite = false, $language = false, $outputType = false, $period = false, $reportFormat = false, $aggregateReportsFormat = false)
 	{
 		// Load specified language
 		if(empty($language))
 		{
 			$language = Piwik_Translate::getInstance()->getLanguageDefault();
 		}
-    	Piwik_Translate::getInstance()->reloadLanguage($language);
-		
+		Piwik_Translate::getInstance()->reloadLanguage($language);
+
 		// Available reports
-		static $reportMetadata = null;
-		if(is_null($reportMetadata))
-		{
-			//TODO here should pass $period and $date for graphs to display in metadata and then in Email reports. 
-			$reportMetadata = Piwik_API_API::getInstance()->getReportMetadata($idSite);
+		$reportMetadata = Piwik_API_API::getInstance()->getReportMetadata($idSite);
-		}
 
 		// Test template: include all reports
 		if($idReport == 0)
@@ -266,6 +266,10 @@
 			{
 				$reportFormat = Piwik_PDFReports::DEFAULT_FORMAT;
 			}
+			if(empty($aggregateReportsFormat))
+			{
+				$aggregateReportsFormat = Piwik_PDFReports::DEFAULT_AGGREGATE_REPORTS_FORMAT;
+			}
 			$reports = $reportMetadata;
 			$description = Piwik_Translate('PDFReports_DefaultContainingAllReports');
 		}
@@ -275,20 +279,20 @@
 			$pdfReports = $this->getReports($idSite, $_period = false, $idReport);
 			$pdfReport = reset($pdfReports);
 			$reportUniqueIds = explode(',', $pdfReport['reports']);
-			
-    		$description = $pdfReport['description'];
-			
-    		// If period wasn't specified, we shall default to the report's period
-    		if(empty($period))
-    		{
-    			$period = 'day';
-    			if($pdfReport['period'] != 'never')
+
+			$description = $pdfReport['description'];
+
+			// If period wasn't specified, we shall default to the report's period
+			if(empty($period))
+			{
+				$period = 'day';
+				if($pdfReport['period'] != 'never')
 				{
 					$period = $pdfReport['period'];
 				}
-    		}
+			}
 
-    		// If format wasn't specified, defaults to the report's format
+			// If format wasn't specified, defaults to the report's format
 			if(empty($reportFormat))
 			{
 				$reportFormat = $pdfReport['format'];
@@ -299,75 +303,135 @@
 				}
 			}
 
+    		// If $aggregateReportsFormat wasn't specified, defaults to the report configuration
+			if(empty($aggregateReportsFormat))
+			{
+				$aggregateReportsFormat = $pdfReport['aggregate_reports_format'];
+			}
+
-    		// We need to lookup which reports metadata are registered in this report
-    		$reports = array();
-    		foreach($reportMetadata as $metadata)
-    		{
-    			if(in_array($metadata['uniqueId'], $reportUniqueIds))
-    			{
-    				$reports[] = $metadata;
-    			}
-    		}
+			// We need to lookup which reports metadata are registered in this report
+			$reports = array();
+			foreach($reportMetadata as $metadata)
+			{
+				if(in_array($metadata['uniqueId'], $reportUniqueIds))
+				{
+					$reports[] = $metadata;
+				}
+			}
 		}
 
 		$description = str_replace(array("\r", "\n"), ' ', $description);
 
 		// The report will be rendered with the first 30 rows and will aggregate other rows in a summary row
-    	$filterTruncateGET = Piwik_Common::getRequestVar('filter_truncate', false);
-    	$_GET['filter_truncate'] = 30;
+		$filterTruncateGET = Piwik_Common::getRequestVar('filter_truncate', false);
+		$_GET['filter_truncate'] = 30;
 
-    	$websiteName = $prettyDate = false;
-        $processedReports = array();
-        foreach ($reports as $action)
-        {
-        	$apiModule = $action['module'];
-        	$apiAction = $action['action'];
-        	$apiParameters = array();
-        	if(isset($action['parameters']))
-        	{
-        		$apiParameters = $action['parameters'];
-        	}
-        	$report = Piwik_API_API::getInstance()->getProcessedReport($idSite, $period, $date, $apiModule, $apiAction, $segment = false, $apiParameters, $idGoal = false, $language);
-        	$websiteName = $report['website'];
-        	$prettyDate = $report['prettyDate'];
+		$websiteName = $prettyDate = false;
+		$processedReports = array();
+		foreach ($reports as $action)
+		{
+			$apiModule = $action['module'];
+			$apiAction = $action['action'];
+			$apiParameters = array();
+			if(isset($action['parameters']))
+			{
+				$apiParameters = $action['parameters'];
+			}
+			$report = Piwik_API_API::getInstance()->getProcessedReport($idSite, $period, $date, $apiModule, $apiAction, $segment = false, $apiParameters, $idGoal = false, $language);
+			$websiteName = $report['website'];
+			$prettyDate = $report['prettyDate'];
+
+			$reportMetadata = $report['metadata'];
+			$isAggregateReport = self::isAggregateReport($reportMetadata);
+
+			$report['displayTable'] = 	!$isAggregateReport ||
+										$aggregateReportsFormat == Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_TABLES ||
+										$aggregateReportsFormat == Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_TABLES_GRAPHS;
+
+			$report['displayGraph'] = 	!$isAggregateReport ||
+										$aggregateReportsFormat == Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_GRAPHS ||
+										$aggregateReportsFormat == Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_TABLES_GRAPHS;
+
+			if ($report['displayGraph'])
+			{
+				$request = new Piwik_API_Request(
+					$reportMetadata['imageGraphUrl'] .
+					'&outputType='.Piwik_ImageGraph_API::GRAPH_OUTPUT_PHP.
+					'&format=original&serialize=0'.
+					'&height='.Piwik_ReportRenderer::IMAGE_GRAPH_HEIGHT.
+					'&width='.Piwik_ReportRenderer::IMAGE_GRAPH_WIDTH
+				);
+
+				try {
+					$imageGraph = $request->process();
+
+					// Get image data as string
+					ob_start();
+					imagepng($imageGraph);
+					$imageGraphData = ob_get_contents();
+					ob_end_clean();
+					imagedestroy($imageGraph);
+
+					$report['generatedImageGraph'] = $imageGraphData;
+
+				} catch(Exception $e) {
+					throw new Exception("ImageGraph API returned an error: ".$e->getMessage()."\n");
+				}
+			}
+
-        	$processedReports[] = $report;
-        }
-        
-        // Restore values
-        if($filterTruncateGET !== false)
-        {
-        	$_GET['filter_truncate'] = $filterTruncateGET;
-        }
+			$processedReports[] = $report;
+		}
+
+		// Restore values
+		if($filterTruncateGET !== false)
+		{
+			$_GET['filter_truncate'] = $filterTruncateGET;
+		}
 
-		if(empty($reportFormat))
-		{
-			$reportFormat = Piwik_PDFReports::DEFAULT_FORMAT;
-		}
-
 		// Generate the report
 		$reportRenderer = Piwik_ReportRenderer::factory($reportFormat);
 		$reportRenderer->setLocale($language);
+		$reportRenderer->setRenderImageInline($outputType == self::OUTPUT_DOWNLOAD ? true : false);
-        $reportRenderer->renderFrontPage($websiteName, $prettyDate, $description, $reports );
+		$reportRenderer->renderFrontPage($websiteName, $prettyDate, $description, $reports );
 		array_walk($processedReports, array($reportRenderer, 'renderReport'));
 
-        switch($outputType)
-        { 
-        	case self::OUTPUT_SAVE_ON_DISK:
+		switch($outputType)
+		{
+			case self::OUTPUT_SAVE_ON_DISK:
 				$outputFilename = 'Email Report - ' . $idReport . '.' . $date . '.' . $idSite . '.' . $language;
 				$outputFilename = $reportRenderer->sendToDisk($outputFilename);
 
+				$additionalFiles = array();
+				if($reportFormat == 'html')
+				{
+					foreach ($processedReports as &$report) {
+						if($report['displayGraph'])
+						{
+							$additionalFile = array();
+							$additionalFile['filename'] = $report['metadata']['name'].'.png';
+							$additionalFile['cid'] = $report['metadata']['uniqueId'];
+							$additionalFile['content'] = $report['generatedImageGraph'];
+							$additionalFile['mimeType'] = 'image/png';
+							$additionalFile['encoding'] = Zend_Mime::ENCODING_BASE64;
+
+							$additionalFiles[] = $additionalFile;
+						}
+					}
+				}
+
 				return array(	$outputFilename,
 								$prettyDate,
 								$websiteName,
-								$reportFormat
+								$reportFormat,
+								$additionalFiles,
 				);
-    		break;
+			break;
 
 			default:
 			case self::OUTPUT_DOWNLOAD:
 				$reportRenderer->sendToBrowserDownload("$websiteName - $prettyDate - $description");
 				break;
-        }
+		}
 	}
 
 	public function sendEmailReport($idReport, $idSite, $period = false, $date = false)
@@ -410,7 +474,7 @@
 			}
 		}
 		$language = Piwik_LanguagesManager_API::getInstance()->getLanguageForUser($report['login']);
-		list($outputFilename, $prettyDate, $websiteName, $reportFormat) =
+		list($outputFilename, $prettyDate, $websiteName, $reportFormat, $additionalFiles) =
 			$this->generateReport(
 					$idReport, 
 					$date,
@@ -420,10 +484,10 @@
 					$report['period']
 					);
 
-		$this->sendReportEmail($emails, $outputFilename, $prettyDate, $websiteName, $report, $reportFormat);
+		$this->sendReportEmail($emails, $outputFilename, $prettyDate, $websiteName, $report, $reportFormat, $additionalFiles);
 	}
 	
-	protected function sendReportEmail($emails, $outputFilename, $prettyDate, $websiteName, $report, $reportFormat)
+	protected function sendReportEmail($emails, $outputFilename, $prettyDate, $websiteName, $report, $reportFormat, $additionalFiles)
 	{
 		$periods = self::getPeriodToFrequency();
 		$message  = Piwik_Translate('PDFReports_EmailHello');
@@ -431,7 +495,7 @@
 
 		if(!file_exists($outputFilename))
 		{
-			throw new Exception("The PDF file wasn't found in $outputFilename");
+			throw new Exception("The report file wasn't found in $outputFilename");
 		}
 		$filename = basename($outputFilename);
 		$handle = fopen($outputFilename, "r");
@@ -448,6 +512,9 @@
 		switch ($reportFormat)
 		{
 			case 'html':
+
+				// Needed when using images as attachment with cid
+				$mail->setType(Zend_Mime::MULTIPART_RELATED);
 				$message .= "<br/>" . Piwik_Translate('PDFReports_PleaseFindBelow', array($periods[$report['period']], $websiteName));
 				$mail->setBodyHtml($message . "<br/><br/>". $contents);
 				break;
@@ -465,6 +532,21 @@
 				break;
 		}
 
+		foreach($additionalFiles as $additionalFile)
+		{
+			$fileContent = $additionalFile['content'];
+			$at = $mail->createAttachment(
+				$fileContent,
+				$additionalFile['mimeType'],
+				Zend_Mime::DISPOSITION_INLINE,
+				$additionalFile['encoding'],
+				$additionalFile['filename']
+			);
+			$at->id = $additionalFile['cid'];
+
+			unset($fileContent);
+		}
+
 		foreach ($emails as $email)
 		{
 			$mail->addTo($email);
@@ -478,7 +560,7 @@
 				{
 					throw new Exception("An error occured while sending '$filename' ".
 										" to ". implode(', ',$mail->getRecipients()). ".
-    								Error was '". $e->getMessage()."'");
+									Error was '". $e->getMessage()."'");
 				}
 			}
 			$mail->clearRecipients();
@@ -576,6 +658,20 @@
 		}
 	}
 
+	private function checkAggregateReportsFormat($format)
+	{
+		$availableAggregateReportsFormats = array_keys(Piwik_PDFReports_API::getAggregateReportsFormats());
+		if(!in_array($format, $availableAggregateReportsFormats))
+		{
+			throw new Exception(
+				Piwik_TranslateException(
+					'General_ExceptionInvalidAggregateReportsFormat',
+					array($format, implode(', ', $availableAggregateReportsFormats))
+				)
+			);
+		}
+	}
+
 	/**
 	 * @ignore
 	 */
@@ -588,4 +684,31 @@
 		);
 		return $periods;
 	}
+
+	/**
+	 * @ignore
+	 */
+	static public function getAggregateReportsFormats()
+	{
+		$periods = array(
+			Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_TABLES => Piwik_Translate('PDFReports_AggregateReportsFormat_TablesOnly'),
+			Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_GRAPHS => Piwik_Translate('PDFReports_AggregateReportsFormat_GraphsOnly'),
+			Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_TABLES_GRAPHS => Piwik_Translate('PDFReports_AggregateReportsFormat_TablesAndGraphs'),
+		);
+		return $periods;
-}
+	}
+
+	// @Review : Is this the right place ?
+	/**
+	 * Find out if a report is an aggregate report.
+	 *
+	 * @ignore
+	 * @static
+	 * @param  $reportMetadata
+	 * @return boolean true if $reportMetadata is aggregated (ie. with a dimension), false otherwise
+	 */
+	public static function isAggregateReport($reportMetadata)
+	{
+		return isset($reportMetadata['dimension']);
+	}
+}
Index: plugins/CoreHome/templates/html_report_body.tpl
===================================================================
--- plugins/CoreHome/templates/html_report_body.tpl	(revision 5397)
+++ plugins/CoreHome/templates/html_report_body.tpl	(revision )
@@ -6,6 +6,26 @@
 {if empty($reportRows)}
 	{'CoreHome_ThereIsNoDataForThisReport'|translate}
 {else}
+	{if $displayGraph}
+		{* @Review
+			Should we add an "alt" attribute ?
+		*}
+		<img
+			{if $renderImageInline}
+				src="data:image/png;base64,{$generatedImageGraph}"
+			{else}
+				src="cid:{$reportId}"
+			{/if}
+			height="{$graphHeight}"
+			width="{$graphWidth}" />
+	{/if}
+
+	{if $displayGraph && $displayTable}
+		<br/>
+		<br/>
+	{/if}
+
+	{if $displayTable}
 	<table style="border-collapse:collapse; margin-left: 5px">
 		<thead style="background-color: rgb({$tableHeaderBgColor}); color: rgb({$tableHeaderTextColor}); font-size: {$reportTableHeaderTextSize}pt;">
 			{foreach from=$reportColumns item=columnName}
@@ -54,8 +74,9 @@
 			{/foreach}
 		</tbody>
 	</table>
-{/if}
+	{/if}
+{/if}
 <br/>
 <a style="text-decoration:none; color: rgb({$reportTitleTextColor}); font-size: {$reportBackToTopTextSize}pt" href="#reportTop">
 	{'PDFReports_TopOfReport'|translate}
-</a>
\ No newline at end of file
+</a>
Index: plugins/PDFReports/templates/add.tpl
===================================================================
--- plugins/PDFReports/templates/add.tpl	(revision 5397)
+++ plugins/PDFReports/templates/add.tpl	(revision )
@@ -12,13 +12,13 @@
 	</thead>
 	<tbody>
 		<tr>
-            <td class="first">{'General_Website'|translate} </th>
+            <td class="first">{'General_Website'|translate} </td>
 			<td  style="width:650px">
 				{$siteName}
 			</td>
 		</tr>
 		<tr>
-            <td class="first">{'General_Description'|translate} </th>
+            <td class="first">{'General_Description'|translate} </td>
 			<td>
 			<textarea cols="30" rows="3" id="report_description" class="inp"></textarea>
 			<div class="entityInlineHelp">
@@ -54,7 +54,8 @@
 			</td>
 		</tr>
 		<tr>
-			<td class="first">{'PDFReports_ReportFormat'|translate}
+			<td class="first">
+				{'PDFReports_ReportFormat'|translate}
 			</td>
 			<td>
 				<select id="report_format">
@@ -65,6 +66,18 @@
 			</td>
 		</tr>
 		<tr>
+			<td class="first">
+				{'PDFReports_AggregateReportsFormat'|translate}&nbsp;*
+			</td>
+			<td>
+				<select id="aggregate_reports_format">
+				{foreach from=$aggregateReportsFormats key=formatValue item=formatLabel}
+					<option value="{$formatValue}">{$formatLabel}</option>
+				{/foreach}
+				</select>
+			</td>
+		</tr>
+		<tr>
 			<td class="first">{'PDFReports_ReportsIncluded'|translate}</td>
 			<td>
 			<div id='reportsList'>
@@ -77,7 +90,12 @@
 					{/if}
 					<div class='reportCategory'>{$category}</div><ul class='listReports'>
 					{foreach from=$reports item=report}
-						<li><input type="checkbox" id="{$report.uniqueId}" /><label for="{$report.uniqueId}">{$report.name|escape:"html"}</label></li>
+						<li>
+							<input type="checkbox" id="{$report.uniqueId}" />
+							<label for="{$report.uniqueId}">
+								{$report.name|escape:"html"}{if $report.isAggregate}&nbsp;*{/if}
+							</label>
+						</li>
 					{/foreach}
 					{assign var=countReports value=$countReports+1}
 					</ul>
Index: plugins/PDFReports/templates/pdf.js
===================================================================
--- plugins/PDFReports/templates/pdf.js	(revision 5397)
+++ plugins/PDFReports/templates/pdf.js	(revision )
@@ -21,6 +21,7 @@
 	$('#report_description').html(report.description);
 	$('#report_period option[value='+report.period+']').prop('selected', 'selected');
 	$('#report_format option[value='+report.format+']').prop('selected', 'selected');
+	$('#aggregate_reports_format option[value='+report.aggregate_reports_format+']').prop('selected', 'selected');
 	if(report.email_me == 1)
 	{
 		$('#report_email_me').prop('checked','checked');
@@ -64,6 +65,7 @@
 		parameters.description = $('#report_description').val();
 		parameters.period = $('#report_period option:selected').val();
 		parameters.reportFormat = $('#report_format option:selected').val();
+		parameters.aggregateReportsFormat = $('#aggregate_reports_format option:selected').val();
 		parameters.emailMe = $('#report_email_me').prop('checked') == true ? 1: 0;
 		additionalEmails = $('#report_additional_emails').val();
 		parameters.additionalEmails = piwikHelper.getApiFormatTextarea(additionalEmails);
Index: plugins/PDFReports/Controller.php
===================================================================
--- plugins/PDFReports/Controller.php	(revision 5397)
+++ plugins/PDFReports/Controller.php	(revision )
@@ -26,6 +26,8 @@
 		$reportsByCategory = array();
 		foreach($availableReports as $report)
 		{
+			// @Review 'isAggregateReport' report should ideally be in the metadata ? or somewhere in core ?
+			$report['isAggregate'] = Piwik_PDFReports_API::isAggregateReport($report);
 			$reportsByCategory[$report['category']][] = $report;
 		}
 
@@ -47,6 +49,7 @@
 							Piwik_PDFReports_API::getPeriodToFrequency());
 		$view->defaultFormat = Piwik_PDFReports::DEFAULT_FORMAT;
 		$view->formats = Piwik_ReportRenderer::$availableReportRenderers;
+		$view->aggregateReportsFormats = Piwik_PDFReports_API::getAggregateReportsFormats();
 		$view->reports = $reports;
 		$view->language = Piwik_LanguagesManager::getLanguageCodeForCurrentUser();
 		echo $view->render();
Index: plugins/PDFReports/PDFReports.php
===================================================================
--- plugins/PDFReports/PDFReports.php	(revision 5397)
+++ plugins/PDFReports/PDFReports.php	(revision )
@@ -18,6 +18,11 @@
 {
 	const DEFAULT_FORMAT = 'pdf';
 
+	const AGGREGATE_REPORTS_FORMAT_TABLES = 0; // Display Tables Only
+	const AGGREGATE_REPORTS_FORMAT_GRAPHS = 1; // Display Graphs Only
+	const AGGREGATE_REPORTS_FORMAT_TABLES_GRAPHS = 2; // Display Tables and Graphs
+	const DEFAULT_AGGREGATE_REPORTS_FORMAT = Piwik_PDFReports::AGGREGATE_REPORTS_FORMAT_TABLES;
+
 	public function getInformation()
 	{
 		return array(
Index: core/ReportRenderer.php
===================================================================
--- core/ReportRenderer.php	(revision 5397)
+++ core/ReportRenderer.php	(revision )
@@ -19,6 +19,8 @@
  */
 abstract class Piwik_ReportRenderer
 {
+	const IMAGE_GRAPH_HEIGHT = 200;
+	const IMAGE_GRAPH_WIDTH = 700;
 	const DEFAULT_REPORT_FONT = 'dejavusans';
 	const REPORT_TEXT_COLOR = "68,68,68";
 	const REPORT_TITLE_TEXT_COLOR = "126,115,99";
@@ -32,8 +34,10 @@
 		'html' => 'themes/default/images/html_icon.png',
 	);
 
+	protected $renderImageInline = false;
+
 	/**
-	 * Returns the ReportRenderer associated to the renderer type $rendererType
+	 * Return the ReportRenderer associated to the renderer type $rendererType
 	 *
 	 * @throws exception If the renderer is unknown
 	 * @param string $rendererType
@@ -61,6 +65,18 @@
 	}
 
 	/**
+	 * Currently only used for HTML reports.
+	 * When sent by mail, images are attached to the mail: renderImageInline = false
+	 * When downloaded, images are included base64 encoded in the report body: renderImageInline = true
+	 *
+	 * @param boolean $renderImageInline
+	 */
+	public function setRenderImageInline($renderImageInline)
+	{
+		$this->renderImageInline = $renderImageInline;
+	}
+
+	/**
 	 * Initialize locale settings.
 	 * If not called, locale settings defaults to 'en'
 	 *
@@ -115,7 +131,7 @@
 	}
 
 	/**
-	 * Returns $filename with temp directory and delete file
+	 * Return $filename with temp directory and delete file
 	 *
 	 * @static
 	 * @param  $filename
@@ -141,7 +157,7 @@
 	protected static function processTableFormat($reportMetadata, $report, $reportColumns)
 	{
 		$finalReport = $report;
-		if(!isset($reportMetadata['dimension']))
+		if(!Piwik_PDFReports_API::isAggregateReport($reportMetadata))
 		{
 //			var_dump($report);
 			$simpleReportMetrics = $report->getFirstRow();
@@ -157,13 +173,15 @@
 				}
 			}
 
-			$reportColumns = array('label' => Piwik_Translate('General_Name'),
-										 'value' => Piwik_Translate('General_Value'),);
+			$reportColumns = array(
+				'label' => Piwik_Translate('General_Name'),
+				'value' => Piwik_Translate('General_Value'),
+			);
 		}
 
 		return array(
-				$finalReport,
+			$finalReport,
-				$reportColumns
+			$reportColumns,
-			);
+		);
 	}
 }
Index: lang/en.php
===================================================================
--- lang/en.php	(revision 5397)
+++ lang/en.php	(revision )
@@ -250,6 +250,7 @@
 	'General_ExceptionMethodNotFound' => 'The method \'%s\' does not exist or is not available in the module \'%s\'.',
 	'General_ExceptionInvalidRendererFormat' => 'Renderer format \'%s\' not valid. Try any of the following instead: %s.',
 	'General_ExceptionInvalidReportRendererFormat' => 'Report format \'%s\' not valid. Try any of the following instead: %s.',
+	'General_ExceptionInvalidAggregateReportsFormat' => 'Aggregate reports format \'%s\' not valid. Try any of the following instead: %s.',
 	'General_ExceptionInvalidPeriod' => 'The period \'%s\' is not supported. Try any of the following instead: %s',
 	'General_ExceptionInvalidDateRange' => 'The date \'%s\' is not a correct date range. It should have the following format: %s.',
 	'General_ExceptionGoalNotFound' => 'The goal id = %s couldn\'t be found.',
@@ -1459,6 +1460,10 @@
 	'PDFReports_EmailSchedule' => 'Email Schedule',
 	'PDFReports_SendReportTo' => 'Send report to',
 	'PDFReports_ReportFormat' => 'Report Format',
+	'PDFReports_AggregateReportsFormat' => 'Aggregate Reports Format',
+	'PDFReports_AggregateReportsFormat_TablesOnly' => 'Display Report Tables Only',
+	'PDFReports_AggregateReportsFormat_GraphsOnly' => 'Display Graphs Only',
+	'PDFReports_AggregateReportsFormat_TablesAndGraphs' => 'Display Report Tables and Graphs',
 	'PDFReports_SentToMe' => 'Send to me',
 	'PDFReports_CreateAndScheduleReport' => 'Create and Schedule a report',
 	'PDFReports_CancelAndReturnToReports' => 'Cancel and %sreturn to the list of reports%s',
