Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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 #330361] Thu, 24 January 2008 08:46
Li Junhong is currently offline Li JunhongFriend
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: Sat Nov 02 17:01:59 GMT 2024

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

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

Back to the top