Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Google maps with Birt
Google maps with Birt [message #500571] Thu, 26 November 2009 19:21 Go to next message
abedi  is currently offline abedi Friend
Messages: 26
Registered: July 2009
Junior Member
Hi All,

I try to display a google maps in my report but it doesn't work. I have downloaded an example from birt-exchange but it doesn't work.

Below the report, if anyone could help me to adapt this report or giving me an example which works.

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 1.0.1 Build &lt;20051130-1157></property>
<property name="units">in</property>
<text-property name="title">Google Maps Mashup in a BIRT Report</text-property>
<property name="comments">In order to use this report, please obtain a Google Maps API Key. Then place this key in the Header Code Item at the top of the report. This report was tested in Internet Explorer v6.

When you run the report, click on any row in the Customer Data table. That will display the Google map and create a marker for the city in which the customer is located.

Please refer to Google Maps API for documentation on utilizing their API.</property>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="CMI" id="119">
<property name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet " name="Customers" id="120">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ADDRESSLINE1</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CITY</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">STATE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">POSTALCODE</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">CMI</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNAME</property>
<property name="nativeName">CUSTOMERNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ADDRESSLINE1</property>
<property name="nativeName">ADDRESSLINE1</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CITY</property>
<property name="nativeName">CITY</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">STATE</property>
<property name="nativeName">STATE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">POSTALCODE</property>
<property name="nativeName">POSTALCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
</list-property>
<property name="queryText">select CLASSICMODELS.CUSTOMERS.CUSTOMERNAME,
CLASSICMODELS.CUSTOMERS.ADDRESSLINE1,
CLASSICMODELS.CUSTOMERS.CITY,
CLASSICMODELS.CUSTOMERS.STATE,
CLASSICMODELS.CUSTOMERS.POSTALCODE
from CLASSICMODELS.CUSTOMERS
where

CLASSICMODELS.CUSTOMERS.COUNTRY = 'USA'
order by CLASSICMODELS.CUSTOMERS.STATE</property>
</oda-data-set>
</data-sets>
<styles>
<style name="table-group-header-1" id="106">
<property name="backgroundColor">#0B285B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-footer-1" id="107">
<property name="backgroundColor">#0B285B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-header-2" id="108">
<property name="backgroundColor">#13449B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-footer-2" id="109">
<property name="backgroundColor">#13449B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-header-3" id="110">
<property name="backgroundColor">#1A5FDA</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-footer-3" id="111">
<property name="backgroundColor">#1A5FDA</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-header" id="112">
<property name="backgroundColor">#6495ED</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#483D8B</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#483D8B</property>
<property name="borderRightColor">#483D8B</property>
<property name="borderTopColor">#483D8B</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-footer" id="114">
<property name="backgroundColor">#6495ED</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#483D8B</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftColor">#483D8B</property>
<property name="borderRightColor">#483D8B</property>
<property name="borderTopColor">#483D8B</property>
<property name="borderTopStyle">double</property>
<property name="textAlign">right</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="style">table-group-footer-3</property>
<property name="fontSize">xx-small</property>
<property name="fontStyle">italic</property>
<property name="textAlign">left</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<label name="Header Label" id="68">
<property name="backgroundColor">#0000FF</property>
<property name="fontSize">xx-large</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="textAlign">center</property>
<text-property name="text">BIRT Report Integrating Google Maps</text-property>
</label>
<text name="Header Code Item" id="66">
<property name="borderBottomColor">#0000FF</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thick</property>
<property name="borderLeftColor">#0000FF</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thick</property>
<property name="borderRightColor">#0000FF</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thick</property>
<property name="borderTopColor">#0000FF</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thick</property>
<property name="paddingTop">1pt</property>
<property name="textAlign">center</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<html>
<head>

<script src=" http://maps.google.com/maps?file=api&v=2&key=ABQIAAA AbbKonlyxwYI8gy86khHSRhRW_yFMOJXjvLzCaN3GJDhuruvXrxR27tF3iS2 dmloRSCFflpgk9djrHg" type="text/javascript"></script>

<script src=" http://www.google.com/intl/en_us/mapfiles/85/maps2.api/main. js" type="text/javascript"></script>

<script type="text/javascript">
var geocoder = null;
var map = null;

function load(newaddress,mapname)
{
// Create new map object once
if (!map)
{
if (!mapname)
{
alert ("No mapname");
return;
}

map = new GMap2(document.getElementById(mapname));
if (!map)
{
alert ("Could not create Google map");
return;
}

map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
}

// Create new geocoding object once
if (!geocoder)
{
geocoder = new GClientGeocoder();
geocoder.setBaseCountryCode("US");
}

// Retrieve location information, pass it to addToMap()
geocoder.getLocations(newaddress, addToMap);
}

// This function adds the point to the map
function addToMap(response)
{
// Retrieve the object
var place = response.Placemark[0];

// Retrieve the latitude and longitude
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);

// Center the map on this point
map.setCenter(point, 3);

// Create a marker
marker = new GMarker(point);
GEvent.addListener (marker, "click",
function() {
marker.openInfoWindowHtml (place.address);
}
);

// Add the marker to map
map.addOverlay(marker);

// Add address information to marker
marker.openInfoWindowHtml(place.address);

}
</script>

</head>
<body onunload="GUnload()">

<div id="map1" style="width: 100%; height: 300px"><BR><BR><BR><BR><BR><BR> <B>(Click on a ROW below to see a map of the address)</B></div>

</body>
</html>]]></text-property>
</text>
<table name="Customer Data" id="71">
<property name="width">100%</property>
<property name="dataSet">Customers</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">CUSTOMERNAME</property>
<expression name="expression">dataSetRow["CUSTOMERNAME"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">ADDRESSLINE1</property>
<expression name="expression">dataSetRow["ADDRESSLINE1"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">CITY</property>
<expression name="expression">dataSetRow["CITY"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">STATE</property>
<expression name="expression">dataSetRow["STATE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">POSTALCODE</property>
<expression name="expression">dataSetRow["POSTALCODE"]</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<column id="100"/>
<column id="101"/>
<column id="102"/>
<column id="103"/>
<column id="104"/>
<header>
<row id="72">
<cell id="73">
<label id="74">
<property name="textAlign">center</property>
<text-property name="text">Name</text-property>
</label>
</cell>
<cell id="75">
<label id="76">
<property name="textAlign">center</property>
<text-property name="text">Address</text-property>
</label>
</cell>
<cell id="77">
<label id="78">
<property name="textAlign">center</property>
<text-property name="text">City</text-property>
</label>
</cell>
<cell id="79">
<label id="80">
<property name="textAlign">center</property>
<text-property name="text">State</text-property>
</label>
</cell>
<cell id="81">
<label id="82">
<property name="textAlign">center</property>
<text-property name="text">ZIP</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="83">
<cell id="84">
<property name="textAlign">center</property>
<text id="118">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand"
onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>, USA','map1');">
<VALUE-OF>row["CUSTOMERNAME"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="86">
<property name="textAlign">center</property>
<text id="117">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand"
onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>, USA','map1');"><VALUE-OF>row["ADDRESSLINE1"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="88">
<property name="textAlign">center</property>
<text id="116">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand"
onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>, USA','map1');"><VALUE-OF>row["CITY"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="90">
<property name="textAlign">center</property>
<text id="115">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand"
onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<value-of>row["CITY"]</value-of>, USA','map1');"><VALUE-OF>row["STATE"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="92">
<property name="textAlign">center</property>
<text id="105">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand"
onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>, USA','map1');"><VALUE-OF>row["POSTALCODE"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
</row>
</detail>
<footer>
<row id="94">
<cell id="95"/>
<cell id="96"/>
<cell id="97"/>
<cell id="98"/>
<cell id="99"/>
</row>
</footer>
</table>
</body>
</report>
Re: Google maps with Birt [message #500992 is a reply to message #500571] Mon, 30 November 2009 15:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What version of BIRT are you using?

abedi wrote:
> Hi All,
>
> I try to display a google maps in my report but it doesn't work. I have
> downloaded an example from birt-exchange but it doesn't work.
>
> Below the report, if anyone could help me to adapt this report or giving
> me an example which works.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version 1.0.1 Build
> <20051130-1157></property>
> <property name="units">in</property>
> <text-property name="title">Google Maps Mashup in a BIRT
> Report</text-property>
> <property name="comments">In order to use this report, please obtain
> a Google Maps API Key. Then place this key in the Header Code Item at
> the top of the report. This report was tested in Internet Explorer v6.
>
> When you run the report, click on any row in the Customer Data table.
> That will display the Google map and create a marker for the city in
> which the customer is located.
>
> Please refer to Google Maps API for documentation on utilizing their
> API.</property>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="CMI" id="119">
> <property
> name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver
> </property>
> <property name="odaURL">jdbc:classicmodels:sampledb</property>
> <property name="odaUser">ClassicModels</property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="Customers" id="120">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">CUSTOMERNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">ADDRESSLINE1</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">CITY</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">STATE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">POSTALCODE</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">CMI</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">CUSTOMERNAME</property>
> <property name="nativeName">CUSTOMERNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">ADDRESSLINE1</property>
> <property name="nativeName">ADDRESSLINE1</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">CITY</property>
> <property name="nativeName">CITY</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">STATE</property>
> <property name="nativeName">STATE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">POSTALCODE</property>
> <property name="nativeName">POSTALCODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> </list-property>
> <property name="queryText">select
> CLASSICMODELS.CUSTOMERS.CUSTOMERNAME,
> CLASSICMODELS.CUSTOMERS.ADDRESSLINE1,
> CLASSICMODELS.CUSTOMERS.CITY,
> CLASSICMODELS.CUSTOMERS.STATE,
> CLASSICMODELS.CUSTOMERS.POSTALCODE
> from CLASSICMODELS.CUSTOMERS
> where
> CLASSICMODELS.CUSTOMERS.COUNTRY = 'USA'
> order by CLASSICMODELS.CUSTOMERS.STATE</property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="table-group-header-1" id="106">
> <property name="backgroundColor">#0B285B</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">medium</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#FFF8DC</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#FFF8DC</property>
> <property name="borderRightColor">#FFF8DC</property>
> <property name="borderTopColor">#FFF8DC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-group-footer-1" id="107">
> <property name="backgroundColor">#0B285B</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">medium</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#FFF8DC</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#FFF8DC</property>
> <property name="borderRightColor">#FFF8DC</property>
> <property name="borderTopColor">#FFF8DC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-group-header-2" id="108">
> <property name="backgroundColor">#13449B</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#FFF8DC</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#FFF8DC</property>
> <property name="borderRightColor">#FFF8DC</property>
> <property name="borderTopColor">#FFF8DC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-group-footer-2" id="109">
> <property name="backgroundColor">#13449B</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#FFF8DC</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#FFF8DC</property>
> <property name="borderRightColor">#FFF8DC</property>
> <property name="borderTopColor">#FFF8DC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-group-header-3" id="110">
> <property name="backgroundColor">#1A5FDA</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#FFF8DC</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#FFF8DC</property>
> <property name="borderRightColor">#FFF8DC</property>
> <property name="borderTopColor">#FFF8DC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-group-footer-3" id="111">
> <property name="backgroundColor">#1A5FDA</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#FFF8DC</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#FFF8DC</property>
> <property name="borderRightColor">#FFF8DC</property>
> <property name="borderTopColor">#FFF8DC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-header" id="112">
> <property name="backgroundColor">#6495ED</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#483D8B</property>
> <property name="borderBottomStyle">double</property>
> <property name="borderLeftColor">#483D8B</property>
> <property name="borderRightColor">#483D8B</property>
> <property name="borderTopColor">#483D8B</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thin</property>
> <property name="textAlign">right</property>
> </style>
> <style name="table-footer" id="114">
> <property name="backgroundColor">#6495ED</property>
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFE0</property>
> <property name="borderBottomColor">#483D8B</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thin</property>
> <property name="borderLeftColor">#483D8B</property>
> <property name="borderRightColor">#483D8B</property>
> <property name="borderTopColor">#483D8B</property>
> <property name="borderTopStyle">double</property>
> <property name="textAlign">right</property>
> </style>
> </styles>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2">
> <page-footer>
> <text id="3">
> <property name="style">table-group-footer-3</property>
> <property name="fontSize">xx-small</property>
> <property name="fontStyle">italic</property>
> <property name="textAlign">left</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<value-of>new
> Date()</value-of>]]></text-property>
> </text>
> </page-footer>
> </simple-master-page>
> </page-setup>
> <body>
> <label name="Header Label" id="68">
> <property name="backgroundColor">#0000FF</property>
> <property name="fontSize">xx-large</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="textAlign">center</property>
> <text-property name="text">BIRT Report Integrating Google
> Maps</text-property>
> </label>
> <text name="Header Code Item" id="66">
> <property name="borderBottomColor">#0000FF</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">thick</property>
> <property name="borderLeftColor">#0000FF</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">thick</property>
> <property name="borderRightColor">#0000FF</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">thick</property>
> <property name="borderTopColor">#0000FF</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">thick</property>
> <property name="paddingTop">1pt</property>
> <property name="textAlign">center</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<html>
> <head>
> <script
> src=" http://maps.google.com/maps?file=api&v=2&key=ABQIAAA AbbKonlyxwYI8gy86khHSRhRW_yFMOJXjvLzCaN3GJDhuruvXrxR27tF3iS2 dmloRSCFflpgk9djrHg"
> type="text/javascript"></script>
>
> <script
> src=" http://www.google.com/intl/en_us/mapfiles/85/maps2.api/main. js"
> type="text/javascript"></script>
> <script type="text/javascript">
> var geocoder = null;
> var map = null;
>
> function load(newaddress,mapname)
> { // Create new map object once
> if (!map)
> {
> if (!mapname)
> {
> alert ("No mapname");
> return;
> }
> map = new GMap2(document.getElementById(mapname));
> if (!map)
> {
> alert ("Could not create Google map");
> return;
> }
> map.addControl(new GSmallMapControl());
> map.addControl(new GMapTypeControl());
> }
> // Create new geocoding object once
> if (!geocoder)
> {
> geocoder = new GClientGeocoder();
> geocoder.setBaseCountryCode("US");
> }
> // Retrieve location information, pass it to addToMap()
> geocoder.getLocations(newaddress, addToMap);
> }
>
> // This function adds the point to the map
> function addToMap(response)
> {
> // Retrieve the object
> var place = response.Placemark[0];
>
> // Retrieve the latitude and longitude
> point = new GLatLng(place.Point.coordinates[1],
> place.Point.coordinates[0]);
>
> // Center the map on this point
> map.setCenter(point, 3);
>
> // Create a marker
> marker = new GMarker(point);
> GEvent.addListener (marker, "click", function() {
> marker.openInfoWindowHtml (place.address);
> }
> );
> // Add the marker to map
> map.addOverlay(marker);
>
> // Add address information to marker
> marker.openInfoWindowHtml(place.address);
> }
> </script>
> </head>
> <body onunload="GUnload()">
>
> <div id="map1" style="width: 100%; height:
> 300px"><BR><BR><BR><BR><BR><BR> <B>(Click on a ROW below to see a map of
> the address)</B></div>
>
> </body>
> </html>]]></text-property>
> </text>
> <table name="Customer Data" id="71">
> <property name="width">100%</property>
> <property name="dataSet">Customers</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">CUSTOMERNAME</property>
> <expression
> name="expression">dataSetRow["CUSTOMERNAME"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">ADDRESSLINE1</property>
> <expression
> name="expression">dataSetRow["ADDRESSLINE1"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">CITY</property>
> <expression
> name="expression">dataSetRow["CITY"]</expression>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">STATE</property>
> <expression
> name="expression">dataSetRow["STATE"]</expression>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">POSTALCODE</property>
> <expression
> name="expression">dataSetRow["POSTALCODE"]</expression>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> <column id="100"/>
> <column id="101"/>
> <column id="102"/>
> <column id="103"/>
> <column id="104"/>
> <header>
> <row id="72">
> <cell id="73">
> <label id="74">
> <property name="textAlign">center</property>
> <text-property name="text">Name</text-property>
> </label>
> </cell>
> <cell id="75">
> <label id="76">
> <property name="textAlign">center</property>
> <text-property
> name="text">Address</text-property>
> </label>
> </cell>
> <cell id="77">
> <label id="78">
> <property name="textAlign">center</property>
> <text-property name="text">City</text-property>
> </label>
> </cell>
> <cell id="79">
> <label id="80">
> <property name="textAlign">center</property>
> <text-property name="text">State</text-property>
> </label>
> </cell>
> <cell id="81">
> <label id="82">
> <property name="textAlign">center</property>
> <text-property name="text">ZIP</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="83">
> <cell id="84">
> <property name="textAlign">center</property>
> <text id="118">
> <property
> name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<table
> width=100%>
> <tr>
> <td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
> onMouseOut="this.bgColor = '#FFFFFF'"
> onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>, USA','map1');">
> <VALUE-OF>row["CUSTOMERNAME"]</VALUE-OF>
> </td>
> </tr>
> </table>]]></text-property>
> </text>
> </cell>
> <cell id="86">
> <property name="textAlign">center</property>
> <text id="117">
> <property
> name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<table
> width=100%>
> <tr>
> <td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
> onMouseOut="this.bgColor = '#FFFFFF'"
> onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>,
> USA','map1');"><VALUE-OF>row["ADDRESSLINE1"]</VALUE-OF>
> </td>
> </tr>
> </table>]]></text-property>
> </text>
> </cell>
> <cell id="88">
> <property name="textAlign">center</property>
> <text id="116">
> <property
> name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<table
> width=100%>
> <tr>
> <td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
> onMouseOut="this.bgColor = '#FFFFFF'"
> onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>,
> USA','map1');"><VALUE-OF>row["CITY"]</VALUE-OF>
> </td>
> </tr>
> </table>]]></text-property>
> </text>
> </cell>
> <cell id="90">
> <property name="textAlign">center</property>
> <text id="115">
> <property
> name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<table
> width=100%>
> <tr>
> <td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
> onMouseOut="this.bgColor = '#FFFFFF'"
> onclick="load('<value-of>row["CITY"]</value-of>,
> USA','map1');"><VALUE-OF>row["STATE"]</VALUE-OF>
> </td>
> </tr>
> </table>]]></text-property>
> </text>
> </cell>
> <cell id="92">
> <property name="textAlign">center</property>
> <text id="105">
> <property
> name="fontFamily">sans-serif</property>
> <property name="fontSize">x-small</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<table
> width=100%>
> <tr>
> <td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
> onMouseOut="this.bgColor = '#FFFFFF'"
> onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>,
> USA','map1');"><VALUE-OF>row["POSTALCODE"]</VALUE-OF>
> </td>
> </tr>
> </table>]]></text-property>
> </text>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="94">
> <cell id="95"/>
> <cell id="96"/>
> <cell id="97"/>
> <cell id="98"/>
> <cell id="99"/>
> </row>
> </footer>
> </table>
> </body>
> </report>
Re: Google maps with Birt [message #501149 is a reply to message #500571] Tue, 01 December 2009 10:16 Go to previous messageGo to next message
abedi  is currently offline abedi Friend
Messages: 26
Registered: July 2009
Junior Member
Hi Jason,

I'm using BIRT 2.5.
Thanx for you help.

Re: Google maps with Birt [message #501235 is a reply to message #501149] Tue, 01 December 2009 15:53 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I assume this example came from here:
http://www.birt-exchange.org/devshare/designing-birt-reports /149-google-maps-mashup-with-birt-reports/#comments

I have modified it to work with the html and preview, but it will not
work when using the /frameset url.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.0.v20090603 Build &lt;2.5.0.v20090617-0630></property>
<property name="units">in</property>
<text-property name="title">Google Maps Mashup in a BIRT
Report</text-property>
<property name="comments">In order to use this report, please
obtain a Google Maps API Key. Then place this key in the Header Code
Item at the top of the report. This report was tested in Internet
Explorer v6.

When you run the report, click on any row in the Customer Data table.
That will display the Google map and create a marker for the city in
which the customer is located.

Please refer to Google Maps API for documentation on utilizing their
API.</property>
<property name="layoutPreference">auto layout</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="CMI" id="119">
<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Customers" id="120">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ADDRESSLINE1</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CITY</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">STATE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">POSTALCODE</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">CMI</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNAME</property>
<property name="nativeName">CUSTOMERNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ADDRESSLINE1</property>
<property name="nativeName">ADDRESSLINE1</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CITY</property>
<property name="nativeName">CITY</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">STATE</property>
<property name="nativeName">STATE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">POSTALCODE</property>
<property name="nativeName">POSTALCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select
CLASSICMODELS.CUSTOMERS.CUSTOMERNAME,
CLASSICMODELS.CUSTOMERS.ADDRESSLINE1,
CLASSICMODELS.CUSTOMERS.CITY,
CLASSICMODELS.CUSTOMERS.STATE,
CLASSICMODELS.CUSTOMERS.POSTALCODE
from CLASSICMODELS.CUSTOMERS
where
CLASSICMODELS.CUSTOMERS.COUNTRY = 'USA'
order by CLASSICMODELS.CUSTOMERS.STATE]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="table-group-header-1" id="106">
<property name="backgroundColor">#0B285B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-footer-1" id="107">
<property name="backgroundColor">#0B285B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-header-2" id="108">
<property name="backgroundColor">#13449B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-footer-2" id="109">
<property name="backgroundColor">#13449B</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-header-3" id="110">
<property name="backgroundColor">#1A5FDA</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-group-footer-3" id="111">
<property name="backgroundColor">#1A5FDA</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#FFF8DC</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#FFF8DC</property>
<property name="borderRightColor">#FFF8DC</property>
<property name="borderTopColor">#FFF8DC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-header" id="112">
<property name="backgroundColor">#6495ED</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#483D8B</property>
<property name="borderBottomStyle">double</property>
<property name="borderLeftColor">#483D8B</property>
<property name="borderRightColor">#483D8B</property>
<property name="borderTopColor">#483D8B</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thin</property>
<property name="textAlign">right</property>
</style>
<style name="table-footer" id="114">
<property name="backgroundColor">#6495ED</property>
<property name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFE0</property>
<property name="borderBottomColor">#483D8B</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thin</property>
<property name="borderLeftColor">#483D8B</property>
<property name="borderRightColor">#483D8B</property>
<property name="borderTopColor">#483D8B</property>
<property name="borderTopStyle">double</property>
<property name="textAlign">right</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
<page-footer>
<text id="3">
<property name="style">table-group-footer-3</property>
<property name="fontSize">xx-small</property>
<property name="fontStyle">italic</property>
<property name="textAlign">left</property>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<label name="Header Label" id="68">
<property name="backgroundColor">#0000FF</property>
<property name="fontSize">xx-large</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="textAlign">center</property>
<text-property name="text">BIRT Report Integrating Google
Maps</text-property>
</label>
<text name="Header Code Item" id="66">
<property name="borderBottomColor">#0000FF</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">thick</property>
<property name="borderLeftColor">#0000FF</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">thick</property>
<property name="borderRightColor">#0000FF</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">thick</property>
<property name="borderTopColor">#0000FF</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">thick</property>
<property name="paddingTop">1pt</property>
<property name="textAlign">center</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[
<script
src="http://maps.google.com/maps?file=api&amp ;amp;v=2&amp;amp;sensor=false&amp;amp;key=ABQIAAAAzr 2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94Q xWIa6N4U6MouMmBA "
type="text/javascript"></script>

<script type="text/javascript">
var geocoder = null;
var map = null;

function load(newaddress,mapname)
{ // Create new map object once
if (!map)
{
if (!mapname)
{
alert ("No mapname");
return;
}
map = new GMap2(document.getElementById(mapname));
if (!map)
{
alert ("Could not create Google map");
return;
}
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
}
// Create new geocoding object once
if (!geocoder)
{
geocoder = new GClientGeocoder();
geocoder.setBaseCountryCode("US");
}
// Retrieve location information, pass it to addToMap()
geocoder.getLocations(newaddress, addToMap);
}

// This function adds the point to the map
function addToMap(response)
{
// Retrieve the object
var place = response.Placemark[0];

// Retrieve the latitude and longitude
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);

// Center the map on this point
map.setCenter(point, 3);

// Create a marker
marker = new GMarker(point);
GEvent.addListener (marker, "click", function() {
marker.openInfoWindowHtml (place.address);
}
);
// Add the marker to map
map.addOverlay(marker);

// Add address information to marker
marker.openInfoWindowHtml(place.address);
}
</script>
<div id="map1" style="width: 100%; height:
300px"><BR><BR><BR><BR><BR><BR> <B>(Click on a ROW below to see a map of
the address)</B></div>

]]></text-property>
</text>
<table name="Customer Data" id="71">
<property name="width">100%</property>
<property name="dataSet">Customers</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">CUSTOMERNAME</property>
<expression
name="expression">dataSetRow["CUSTOMERNAME"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">ADDRESSLINE1</property>
<expression
name="expression">dataSetRow["ADDRESSLINE1"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">CITY</property>
<expression
name="expression">dataSetRow["CITY"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">STATE</property>
<expression
name="expression">dataSetRow["STATE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">POSTALCODE</property>
<expression
name="expression">dataSetRow["POSTALCODE"]</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<property name="pageBreakInterval">50</property>
<column id="100"/>
<column id="101"/>
<column id="102"/>
<column id="103"/>
<column id="104"/>
<header>
<row id="72">
<cell id="73">
<label id="74">
<property name="textAlign">center</property>
<text-property name="text">Name</text-property>
</label>
</cell>
<cell id="75">
<label id="76">
<property name="textAlign">center</property>
<text-property
name="text">Address</text-property>
</label>
</cell>
<cell id="77">
<label id="78">
<property name="textAlign">center</property>
<text-property name="text">City</text-property>
</label>
</cell>
<cell id="79">
<label id="80">
<property name="textAlign">center</property>
<text-property
name="text">State</text-property>
</label>
</cell>
<cell id="81">
<label id="82">
<property name="textAlign">center</property>
<text-property name="text">ZIP</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="83">
<cell id="84">
<property name="textAlign">center</property>
<text id="118">
<property
name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>, USA','map1');">
<VALUE-OF>row["CUSTOMERNAME"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="86">
<property name="textAlign">center</property>
<text id="117">
<property
name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>,
USA','map1');"><VALUE-OF>row["ADDRESSLINE1"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="88">
<property name="textAlign">center</property>
<text id="116">
<property
name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>,
USA','map1');"><VALUE-OF>row["CITY"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="90">
<property name="textAlign">center</property>
<text id="115">
<property
name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<value-of>row["CITY"]</value-of>,
USA','map1');"><VALUE-OF>row["STATE"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
<cell id="92">
<property name="textAlign">center</property>
<text id="105">
<property
name="fontFamily">sans-serif</property>
<property name="fontSize">x-small</property>
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<table width=100%>
<tr>
<td style="cursor:hand" onMouseOver="this.bgColor = '#CCFFFF'"
onMouseOut="this.bgColor = '#FFFFFF'"
onclick="load('<VALUE-OF>row["CITY"]</VALUE-OF>,
USA','map1');"><VALUE-OF>row["POSTALCODE"]</VALUE-OF>
</td>
</tr>
</table>]]></text-property>
</text>
</cell>
</row>
</detail>
<footer>
<row id="94">
<cell id="95"/>
<cell id="96"/>
<cell id="97"/>
<cell id="98"/>
<cell id="99"/>
</row>
</footer>
</table>
</body>
</report>


abedi wrote:
> Hi Jason,
>
> I'm using BIRT 2.5.
> Thanx for you help.
>
>
Re: Google maps with Birt [message #546754 is a reply to message #500571] Wed, 14 July 2010 06:30 Go to previous messageGo to next message
Gerard  is currently offline Gerard Friend
Messages: 1
Registered: July 2010
Junior Member
I have the same Problem. i copy your example but didn't work.
Coul you helpme.
i'm using birt 2.5
thanx in advance. Razz
Re: Google maps with Birt [message #546962 is a reply to message #546754] Wed, 14 July 2010 18:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

The way I got this to work is to remove the include line:
<script
src="http://maps.google.com/maps?file=api&amp ;v=2&amp;sensor=false&amp;key=ABQIAAAAzr2EBOXUKnm_jV nk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6Mou MmBA "
type="text/javascript"></script>

From the text element and add it to the FramesetFragment.jsp located in
the viewer plugin \birt\webcontent\birt\pages\layout directory.

Jason


On 7/14/2010 2:30 AM, Gerard wrote:
> I have the same Problem. i copy your example but didn't work.
> Coul you helpme.
> i'm using birt 2.5 thanx in advance. :p
Re: Google maps with Birt [message #805987 is a reply to message #500571] Fri, 24 February 2012 11:38 Go to previous message
Rajani Gunda is currently offline Rajani GundaFriend
Messages: 2
Registered: February 2012
Junior Member
Hi Jason,
I have the same problem with Google maps. I have added the code in the FramesetFragment.jsp. But it is not working for me.
Can you please provide me a solution for my problem.

Thanks in advance.

Rajani Gunda.
Previous Topic:Integrating Designer into RCP
Next Topic:Really dumb problem with the BIRT tutorial
Goto Forum:
  


Current Time: Thu Dec 18 17:22:35 GMT 2014

Powered by FUDForum. Page generated in 0.02061 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software