Skip to main content



      Home
Home » Archived » 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 09:57 Go to next message
Eclipse UserFriend
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 11:04 Go to previous messageGo to next message
Eclipse UserFriend
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 13: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 00:13 Go to previous messageGo to next message
Eclipse UserFriend
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 09:58 Go to previous messageGo to next message
Eclipse UserFriend
I have the same issue, anyone knows how to change the Ecore Data Source resource path programmatically ?

Thanks
Re: Run a report against a dynamic EMF data source [message #1589250 is a reply to message #756387] Wed, 28 January 2015 05:20 Go to previous message
Eclipse UserFriend
Dear Stefan
will it be possible you share your code to handle emf / xmi file and the rtpdesign file?
I am trying to adress the same problem.
Thanks
Previous Topic:What is the alternative to DrillDownGroupLevel function in Birt?
Next Topic:Manage pagination for tables
Goto Forum:
  


Current Time: Thu Apr 24 08:58:30 EDT 2025

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

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

Back to the top