Difference between revisions of "New Report Design - 2009"

From Catglobe Wiki
Jump to: navigation, search
(Rewrite the page)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
The new report design targets at;
+
[[Image:]]
* Remove XML processing during report generation
 
* Separate information to different layers for increasing re-usability
 
* Eliminate code duplication
 
* Move some calculation to diagram level instead of letting the CGScript engine do all the works
 
  
<i><u>''' This page is written at the time of implementing ''VN2560REP - Implement single case of CDG'', thus it focuses on Cross-Diagram and table chart only. And the design can be found here: \\catproc\Share\CatGlobe Teams\R & D\Documents\Designs\CatGlobe.Report.VN2560REP.eap.'''</u></i>
+
* Elements of reports: texts, images, figures, diagrams, style sheet
 +
* Presentation types: pdf, excel, ppt, word, html, image format
 +
* Frameworks in use: HTML, Aspose.Pdf, Aspose.Slides, Nevron
 +
* Components that use report: Tabulation Script, Dashboard, Monitor
  
== General Report Generation Process ==
+
== Concepts ==
 +
* [[Diagram]]
 +
* [[StyleSheet]]
 +
* [[Tabulation Script]]
 +
* [[Data cache]]
 +
* [[Diagram viewer]]
 +
* [[Report viewer]]
 +
* [[Dashboard]]
 +
* [[Monitor]]
  
[[Image:Diagram_-_Generating_from_HttpRequest.gif]]
+
== Why a new system? ===
  
* The input for the whole process is a ''DiagramInfo'' which contain all necessary information for generating a diagram
+
=== Current system drawbacks ===
* From the ''DiagramInfo'', through the ''Diagram'' class, the ''Chart'' object is built. ''Chart'' object contain physical data needed for generating a chart image/table
+
* Heavy XML
* As the last step, the ''Chart'' object become input to a ''ChartBuilder'' together with layout information (content width, stylesheet) the chart image/table is generated to different desired formats (pdf, ppt, html, excel)
+
* Code duplication
 +
* Not consistent generation process
  
We can consider the processing as a 3 phases processes in which the result of the first 2 phases can be stored as XML format for later use. More precisely, the classes ''DiagramInfo'' and ''Chart'' are '''SERIALIABLE'''.
+
=== New system goals ===
 +
* Remove all intermediate XML processing
 +
* Remove code duplication
 +
* Consistent generation process
  
== Detail Design ==
+
== Design details ==
In detail there are 2 different kinds of diagram: table and image. However, for the sake of using, the detail must be hind from developers. However, always keep in mind that there are 2 kinds of diagrams which have different processing.
+
* [[Report unit testing system]]
 +
* [[Diagram generation process]]
 +
* [[Tabulation Script]]
 +
* [[Tabulation Script for setting inline style to Table Chart]]
 +
* [[Diagram viewer control]]
 +
* [[Report viewer control]]
 +
* [[Integrating with Dashboard]]
 +
* [[Integrating with Monitor]]
  
=== Phase 1: Generate ''DiagramInfo'' ===
+
== Current implementation status ==
 +
* Report unit testing system
 +
* CrossDiagram
 +
* Tabulation Script
 +
* Tabulation Script for setting inline style to Table Chart
 +
* Diagram viewer control
  
[[Image:Diagram_-_Build_DiagramInfo_from_request.gif]]
+
== Next action ==
 +
* Report viewer control
 +
* Integrating with Dashboard
 +
* Integrating with Monitor
  
For each kind of diagram (Cross, Campaign, Standard, Tracking), there is a correspondence info class. But all of them inherit from the parent ''DiagramInfo'' class which contains common information like ''DiagramType'' and ''DiagramFilterInfo''.
 
 
''DiagramInfo'' also contains information about layout of a diagram. For example: which series should be displayed - ''SeriesDisplayType'', or what kind of chart to be layout (Table, Point, BarLine). For table layout, it needs more specific information which is provided by class ''TableChartLayoutInfo''.
 
 
=== Phase 2: Generate ''Chart'' ===
 
 
[[Image:Diagram_-_Content_generation.gif]]
 
 
At the center of ''Chart'' generation is the abstract ''Diagram'' class. It receives ''DiagramInfo'' as input and generates expression for specific kind of Diagram (Cross, Campaign, Tracking, Standard). Then it passes the expressions to the ''Calculator'' for evaluating. The ''Calculator'' class has CGScript expression calculated by the ''Interpreter'', so does the Significance calculation but with the ''Significance'' class from Data. The ''Calculator'' itself handles simple calculation like ''sum'', ''percentage'', ''constant''.
 
 
The result of this phase is a ''Chart'' object which contains a ''2-dimensions'' array of ''ChartSeries''. In turn, ''ChartSeries'' contains a series of ''DataItem''. Each data item contains a value (normally an ''double'' value or an ''Exception'') and some metadata like ''legend'' and ''SignificanceInfo''
 
 
=== Phase 3: Generate concrete objects (TO BE CHANGED) ===
 
Concrete objects can be considered ''Aspose.Pdf.Table'', ''Aspose.Ppt.Table'', ''System.Web.UI.Control.HtmlTable'' or simple ''System.Drawing.Image''. There concrete objects are useful in their own context. So we can consider this process as moving information from a generic context to a specific one.
 
 
[[Image:Diagram_-_Builders.gif]]
 
 
At the center of the generation, is the abstract class ''ChartBuilder''. As stated before, there are 2 kinds for chart table and image, thus there are 2 sub-classes of ''ChartBuilder'': ''TableChartBuilder'' and ''NevronChartBuilder''. This page will focus on ''TableChartBuilder'' only.
 
 
The ''ChartBuilder'' takes an ''ChartBuilderInfo'' object as an input and generate a concrete object base on that input. The input contains:
 
* A ''Chart'' object which contain data for generation
 
* A ''PresentationType'' which is used to determined what kind of concrete object to generate
 
* A ''StyleSheet'' which format the concrete object
 
 
The value of ''DataItem'' must be formatted before copying to concrete object. There a are currently 2 formatters corresponding to 2 types of values (double and exception).
 
 
''TableChartBuilder'' also need another formatter to decorate the significance information.
 
 
The result of a ''TableChartBuilder'' is a ''Table'' object. The ''Table'' class is the abstraction of all kind of concrete table. Using this abstraction we can eliminate the code duplication copying to different kinds of table.
 
 
<u>'''''Table'' Class'''</u>
 
 
[[Image:Diagram_-_Table_adaptors.gif]]
 
 
''Table'' as a normal table contains a 2-dimensions list of ''Cell''. It also contains methods/properties for getting ''Cell'', ''RowCount'', ''ColumnCount''. It is designed to be expanded as needed, means that at first no memory is allocated only when needed. The ''Cell'' class also contains common information of a cell like ''Value'', ''RowSpan'', ''ColumnSpan'', ''RowIndex, ''ColumnIndex''.
 
 
To avoid code duplication on a common scenario of data copying: loop through all cells and copy to concrete object we invent the ''ITableAdaptor'' interface. Each kind of concrete object has an ''adaptor'' to our ''Table'', through which data of ''Table'' can be cloned seamlessly.
 
 
Whenever, a row/cell is created/deleted or a cell is changed in value, index, span, the attached 'adaptors' would be signal. In turn, the adaptors change the concrete objects correspondingly. After filling data to ''Table'' we have the concrete object ready-to-use without no further copying.
 
 
== Tabulation Script For generating Diagram ==
 
''TODO''
 
 
== Tabulation Script for setting inline Stylesheet ==
 
''TODO''
 
 
 
== Diagram Viewer Control ==
 
''TODO''
 
  
 
== Document revisions ==
 
== Document revisions ==
Line 87: Line 64:
 
| Nguyen Trung Chinh  
 
| Nguyen Trung Chinh  
 
| Create the first version for working with a single case of CDG
 
| Create the first version for working with a single case of CDG
 +
|-
 +
| 0.1
 +
| 20.07.2009
 +
| Nguyen Trung Chinh
 +
| Refine the document
 
|}
 
|}

Revision as of 06:37, 20 July 2009

Introduction

[[Image:]]

  • Elements of reports: texts, images, figures, diagrams, style sheet
  • Presentation types: pdf, excel, ppt, word, html, image format
  • Frameworks in use: HTML, Aspose.Pdf, Aspose.Slides, Nevron
  • Components that use report: Tabulation Script, Dashboard, Monitor

Concepts

Why a new system? =

Current system drawbacks

  • Heavy XML
  • Code duplication
  • Not consistent generation process

New system goals

  • Remove all intermediate XML processing
  • Remove code duplication
  • Consistent generation process

Design details

Current implementation status

  • Report unit testing system
  • CrossDiagram
  • Tabulation Script
  • Tabulation Script for setting inline style to Table Chart
  • Diagram viewer control

Next action

  • Report viewer control
  • Integrating with Dashboard
  • Integrating with Monitor


Document revisions

Version No. Date Changed By Description
0.1 27.04.2009 Nguyen Trung Chinh Create the first version for working with a single case of CDG
0.1 20.07.2009 Nguyen Trung Chinh Refine the document