Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Run a report against a dynamic EMF data source
Run a report against a dynamic EMF data source [message #756387] Sat, 12 November 2011 14:57 Go to next message
Stefan   is currently offline Stefan Friend
Messages: 9
Registered: July 2009
Junior Member
Hello guys,

i designed a report that visualizes data from an EMF model using the new EMF ODA driver.

Currently the defined data source points to one XMI file, what is good for debugging purposes.

But the use case is not to run the report always against this single XMI file, but against any kind of EMF model that corresponds to the metamodel of this file. The selection of the model, the report should run against, depends on user selection in a RCP application. So the data source isn't fixed, just the format.

Is it possible to change the URI of the EMF data source programmatically? Or with some parameter binding? I haven't found anything yet.

Many thanks in advance.

Best regards,
Stefan
Re: Run a report against a dynamic EMF data source [message #756675 is a reply to message #756387] Mon, 14 November 2011 16:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Stefan,

I have not used that driver, but look at the report design in xml view.
Does it have a data set property for the xmi file. If it does it
should be changeable in script in the beforeOpen:

this.setExtensionProperty("xmlprop","value");

Jason

On 11/12/2011 9:57 AM, Stefan wrote:
> Hello guys,
>
> i designed a report that visualizes data from an EMF model using the new
> EMF ODA driver.
>
> Currently the defined data source points to one XMI file, what is good
> for debugging purposes.
>
> But the use case is not to run the report always against this single XMI
> file, but against any kind of EMF model that corresponds to the
> metamodel of this file. The selection of the model, the report should
> run against, depends on user selection in a RCP application. So the data
> source isn't fixed, just the format.
>
> Is it possible to change the URI of the EMF data source
> programmatically? Or with some parameter binding? I haven't found
> anything yet.
>
> Many thanks in advance.
>
> Best regards,
> Stefan
Re: Run a report against a dynamic EMF data source [message #756712 is a reply to message #756387] Mon, 14 November 2011 18:47 Go to previous messageGo to next message
Eclipse UserFriend
Hello Stefan,

I too have a similar use case (I suspect many people will as well).

What I have done is to use external connection properties and a script
that searches for these properties.

My model instances are located in projects of the workspace. Each
project has an external connection property file that points to the
ECore instance for the project.

I have a reports project that contains all the reports. I simply copy a
report to the project. (Would like to have used links but I had
problems with that approach.)


Here is copy of the oda-data-source element that shows the script.

<oda-data-source extensionID="org.eclipse.emf.oda.ecore.dataSource"
name="Premises" id="326">
<method name="beforeOpen"><![CDATA[

importPackage( Packages.java.io );

var reportFolderAndReportName = null;
try{
reportFolderAndReportName =
reportContext.getReportRunnable().getReportName();
}catch (err){

}
reportFolderAndReportName="+reportFolderAndReportName);
if(reportFolderAndReportName!=null){
var index = reportFolderAndReportName.lastIndexOf("/");
var reportFolder = reportFolderAndReportName.slice(0,index);
this.setExtensionProperty("OdaConnProfileStorePath", reportFolder +
"/default.cps");
}

]]>
<property
name="resource">platform:/resource/Example_Farm/example.premises</property>
<property name="OdaConnProfileName">Premises</property>
<property
name="OdaConnProfileStorePath">/home/jconlon/workspace/com.verticon.tracker.premises.reports/default.cps</property>
</oda-data-source>


On 11/12/2011 08:57 AM, Stefan wrote:
> Hello guys,
>
> i designed a report that visualizes data from an EMF model using the new
> EMF ODA driver.
>
> Currently the defined data source points to one XMI file, what is good
> for debugging purposes.
>
> But the use case is not to run the report always against this single XMI
> file, but against any kind of EMF model that corresponds to the
> metamodel of this file. The selection of the model, the report should
> run against, depends on user selection in a RCP application. So the data
> source isn't fixed, just the format.
>
> Is it possible to change the URI of the EMF data source
> programmatically? Or with some parameter binding? I haven't found
> anything yet.
>
> Many thanks in advance.
>
> Best regards,
> Stefan
Re: Run a report against a dynamic EMF data source [message #977200 is a reply to message #756387] Fri, 09 November 2012 05:13 Go to previous messageGo to next message
Maya Uscasti is currently offline Maya UscastiFriend
Messages: 1
Registered: November 2012
Junior Member
Hello Stefan,

I'm newly in Birt. I have a similar situation about a Birt report with a EMF Ecore Data Source.

I need to change the URI of the data source of my report to point to a different XMI file, I mean, the data source of my report needs to be variable.

I would like to know if you found a solution.

I saw the option about the script but I donĀ“t understand what it means about the external connection property.

I will really appreciate your help.
Thanks

Re: Run a report against a dynamic EMF data source [message #1005148 is a reply to message #977200] Thu, 24 January 2013 14:58 Go to previous message
Jonathan Dumont is currently offline Jonathan DumontFriend
Messages: 25
Registered: January 2013
Location: Laval
Junior Member
I have the same issue, anyone knows how to change the Ecore Data Source resource path programmatically ?

Thanks


Previous Topic:Problems with cache
Next Topic:Using JTable as datasource in BIRT report
Goto Forum:
  


Current Time: Sun Nov 23 13:44:32 GMT 2014

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

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