Skip to content

Commit

Permalink
[#1831]Add project time span. Handle missing city.
Browse files Browse the repository at this point in the history
  • Loading branch information
stellanl committed Oct 23, 2015
1 parent 3c9fd59 commit 71e0abf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3442,6 +3442,18 @@ where (rsr_relatedproject.relation = '2') and (rsr_relatedproject.related_projec
<expression name="valueExpr" type="javascript">row["title"]</expression>
<property name="contentType">html</property>
</text-data>
<text-data id="250">
<property name="paddingLeft">8pt</property>
<property name="paddingBottom">8pt</property>
<property name="paddingRight">8pt</property>
<expression name="valueExpr">((reportContext.getGlobalVariable("planned_start") ) ? &#13;
"Planned "+ reportContext.getGlobalVariable("planned_start") + " - " + reportContext.getGlobalVariable("planned_end") :&#13;
"(No time period)")&#13;
+&#13;
((reportContext.getGlobalVariable("actual_start") ) ?&#13;
"Actual "+ reportContext.getGlobalVariable("actual_start") + " - " + reportContext.getGlobalVariable("actual_end") + " (actual)" :"")</expression>
<property name="contentType">html</property>
</text-data>
<grid id="123">
<property name="backgroundColor">silver</property>
<property name="marginTop">0pt</property>
Expand Down Expand Up @@ -3499,6 +3511,16 @@ where (rsr_relatedproject.relation = '2') and (rsr_relatedproject.related_projec
<property name="dataType">string</property>
</structure>
</list-property>
<method name="onPrepare"><![CDATA[
]]></method>
<method name="onCreate"><![CDATA[//remember time span of the project
reportContext.setGlobalVariable("actual_start",row["date_start_actual"]);
reportContext.setGlobalVariable("actual_end",row["date_end_actual"]);
reportContext.setGlobalVariable("planned_start",row["date_start_planned"]);
reportContext.setGlobalVariable("planned_end",row["date_end_planned"]);
]]></method>
<method name="onRender"><![CDATA[
]]></method>
<expression name="valueExpr">row["project_plan_summary"]</expression>
<property name="contentType">html</property>
</text-data>
Expand Down Expand Up @@ -3592,7 +3614,7 @@ where (rsr_relatedproject.relation = '2') and (rsr_relatedproject.related_projec
<property name="allowExport">true</property>
</structure>
</list-property>
<expression name="valueExpr">row ["city"] + ", " + row["countryname"]</expression>
<expression name="valueExpr">row ["city"] + (row ["city"] ? ", ":"") + row["countryname"]</expression>
<property name="contentType">html</property>
</text-data>
</cell>
Expand Down
8 changes: 4 additions & 4 deletions akvo/templates/reportserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These BIRT templates are intended to be installed on a ReportServer.

They were developed using the BIRT Report Designer plugin for Eclipse, version 4.4.

The RSR projects used as test cases were 2849 and its parent project 2081.
The RSR projects used as test cases were #2849 and its parent project #2081.


## Deployment to reportserver
Expand All @@ -21,7 +21,7 @@ Where format can be one of [WORD, PDF, HTML, PNG, EXCEL].

During development I found it convenient to:

## Set up a readonly account for the database
### Set up a readonly account for the database
```
sudo -u postgres psql
postgres=# create role rsr_readonly encrypted password '*************' login;
Expand All @@ -37,10 +37,10 @@ GRANT
```


## Make an ssl tunnel to the DB server
### Make an ssl tunnel to the DB server

```
ssh -L 1234:psql.test.akvo-ops.org:5432 gabriel@psql.test.akvo-ops.org
ssh -L 1234:psql.test.akvo-ops.org:5432 stellan@psql.test.akvo-ops.org
```
which allowed me to create a BIRT data source like this:
```
Expand Down

0 comments on commit 71e0abf

Please sign in to comment.