Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to read the data from emf file for a script DataSet
How to read the data from emf file for a script DataSet [message #307842] Thu, 24 January 2008 08:46
Li Junhong is currently offline Li Junhong
Messages: 1012
Registered: July 2009
Senior Member
Hi All,

Now I have an EMF Model file(.xml type), in which exsiting some info I
want to add them to a table in rptdesign file. So I pass the file uri to a
DataInput(I create it to get the info from EMF Model file) constructor in
the open() function of dataset script, it is successful. And then I want
call the readData() method of the DataInput class, in this method, I call
some methods of EMF, in order to get the data, just as following:

URI fileURI = URI.createFileURI(url); //this url indicates the EMF file

Resource modeResource = resourceSet.getResource(fileURI, true);

EList<EObject> contents = modeResource.getContents();

for (int i = 0; i < contents.size(); i++) {
DocumentRoot root = (DocumentRoot) contents.get(i); //Throw Exception
......
}

But when i preview this report, it throw java.lang.ClassCastException from
the code in the for() sentence.

I'm not very clear that how to read the data from an EMF file, is anybody
familiar with EMF and BIRT can give me some advice or sample to pull me
out of dark?

Thanks very much!!~

Lee
Previous Topic:How to read the data from emf file for a script DataSet
Next Topic:How to read the data from emf file for a script DataSet
Goto Forum:
  


Current Time: Thu Oct 23 05:10:59 GMT 2014

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

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