HowTo read a textfile wwith javascript [message #360884] |
Wed, 27 February 2008 09:55 |
Eclipse User |
|
|
|
Originally posted by: dunkelpeter.spam.gmx.net
Hello!
I want to read the content of a file into a dynamic text.
Birt is running as a application, the file is in the local computer.
An image can be insert with the "file:///c:/test/test.jpg" as URI. I put a
function, that returs the URI in the Expression Builder.
The same thing with the dymanic text (put the URI in the Expression
Builder), I get the filename instead of the file content (I think, this is
okay), but when I try to open the file and read it with JavaScript, I get
an empty string.
Peter
|
|
|
Re: HowTo read a textfile wwith javascript [message #360933 is a reply to message #360884] |
Thu, 28 February 2008 16:14 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Peter,
On a dynamic text onCreate event you can do something like:
importPackage(Packages.java.io);
fr = new FileReader( "c:/xfer/mydt.txt" );
inf = new BufferedReader( fr );
mydata = inf.readLine();
fr.close();
inf.close();
this.text = mydata;
Jason
Peter Dunkel wrote:
> Hello!
>
> I want to read the content of a file into a dynamic text.
> Birt is running as a application, the file is in the local computer.
>
> An image can be insert with the "file:///c:/test/test.jpg" as URI. I put a
> function, that returs the URI in the Expression Builder.
>
> The same thing with the dymanic text (put the URI in the Expression
> Builder), I get the filename instead of the file content (I think, this is
> okay), but when I try to open the file and read it with JavaScript, I get
> an empty string.
>
> Peter
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02821 seconds