Home » Eclipse Projects » BIRT » How to save report to excel or pdf silently in server or client PC
| | | |
| Re: How to save report to excel or pdf silently in server or client PC [message #723620 is a reply to message #723540] |
Thu, 08 September 2011 21:23   |
cbr125x Messages: 34 Registered: July 2011 |
Member |
|
|
actually i'm not really sure what method i use, i think it is BIRT Viewer, i put the "webviewerExample" in the tomcat server, is it Viewer?
can i you explain me too about the RE API?
Thanks
Jason Weathersby wrote on Thu, 08 September 2011 14:39Are you using the RE API or the BIRT Viewer?
Jason
On 9/6/2011 9:28 PM, cbr125x wrote:
> Thanks Jason for reply,
> yes, i want to generate the report that i made by BIRT into PDF file,
> and save the file in the server local drive or client local drive (which
> i already granted permission to write).
> Let's say i want to generate the report in pdf file at C:\PDF\ or at
> \\server1\PDF\
> is there a way to do that?
>
>
>
> Jason Weathersby wrote on Tue, 06 September 2011 10:38
>> Can you give some more detail? Do you want as a user views the report
>> in html the server to generate a pdf copy somewhere?
>>
>> Jason
>>
>> On 9/6/2011 4:24 AM, cbr125x wrote:
>> > Hi all,
>> > Is there a way to save or export report to pdf or excel silently in
>> > server or client PC?
>> >
>> > Thanks
>
>
|
|
|
| Re: How to save report to excel or pdf silently in server or client PC [message #724557 is a reply to message #723620] |
Mon, 12 September 2011 10:16   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
That is the viewer. You could write some script in the report that
would save the report to the server in a different format while the user
is viewing it in HTML. Is that what you want?
Jason
On 9/8/2011 9:23 PM, cbr125x wrote:
> actually i'm not really sure what method i use, i think it is BIRT
> Viewer, i put the "webviewerExample" in the tomcat server, is it Viewer?
>
> can i you explain me too about the RE API?
>
> Thanks
>
> Jason Weathersby wrote on Thu, 08 September 2011 14:39
>> Are you using the RE API or the BIRT Viewer?
>>
>> Jason
>>
>> On 9/6/2011 9:28 PM, cbr125x wrote:
>> > Thanks Jason for reply,
>> > yes, i want to generate the report that i made by BIRT into PDF file,
>> > and save the file in the server local drive or client local drive
>> (which
>> > i already granted permission to write).
>> > Let's say i want to generate the report in pdf file at C:\PDF\ or at
>> > \\server1\PDF\
>> > is there a way to do that?
>> >
>> >
>> >
>> > Jason Weathersby wrote on Tue, 06 September 2011 10:38
>> >> Can you give some more detail? Do you want as a user views the report
>> >> in html the server to generate a pdf copy somewhere?
>> >>
>> >> Jason
>> >>
>> >> On 9/6/2011 4:24 AM, cbr125x wrote:
>> >> > Hi all,
>> >> > Is there a way to save or export report to pdf or excel silently in
>> >> > server or client PC?
>> >> >
>> >> > Thanks
>> >
>> >
>
>
Jason Weathersby
BIRT Exchange
|
|
|
| Re: How to save report to excel or pdf silently in server or client PC [message #724731 is a reply to message #724557] |
Mon, 12 September 2011 21:27   |
cbr125x Messages: 34 Registered: July 2011 |
Member |
|
|
Yes, that is what i want, what script i should write?
Jason Weathersby wrote on Mon, 12 September 2011 10:16 :
That is the viewer. You could write some script in the report that
would save the report to the server in a different format while the user
is viewing it in HTML. Is that what you want?
Jason
On 9/8/2011 9:23 PM, cbr125x wrote:
> actually i'm not really sure what method i use, i think it is BIRT
> Viewer, i put the "webviewerExample" in the tomcat server, is it Viewer?
>
> can i you explain me too about the RE API?
>
> Thanks
>
> Jason Weathersby wrote on Thu, 08 September 2011 14:39
>> Are you using the RE API or the BIRT Viewer?
>>
>> Jason
>>
>> On 9/6/2011 9:28 PM, cbr125x wrote:
>> > Thanks Jason for reply,
>> > yes, i want to generate the report that i made by BIRT into PDF file,
>> > and save the file in the server local drive or client local drive
>> (which
>> > i already granted permission to write).
>> > Let's say i want to generate the report in pdf file at C:\PDF\ or at
>> > \\server1\PDF\
>> > is there a way to do that?
>> >
>> >
>> >
>> > Jason Weathersby wrote on Tue, 06 September 2011 10:38
>> >> Can you give some more detail? Do you want as a user views the report
>> >> in html the server to generate a pdf copy somewhere?
>> >>
>> >> Jason
>> >>
>> >> On 9/6/2011 4:24 AM, cbr125x wrote:
>> >> > Hi all,
>> >> > Is there a way to save or export report to pdf or excel silently in
>> >> > server or client PC?
>> >> >
>> >> > Thanks
>> >
>> >
>
>
|
|
|
| Re: How to save report to excel or pdf silently in server or client PC [message #725008 is a reply to message #724731] |
Tue, 13 September 2011 13:52   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
I am attaching an example of a report that creates a pdf for every row
in a detail table. Look at the table row oncreate to get an idea on how
to call the api from script. In your case you can put the script in the
afterFactory of the report.
Jason
On 9/12/2011 9:27 PM, cbr125x wrote:
> Yes, that is what i want, what script i should write?
>
> Jason Weathersby wrote on Mon, 12 September 2011 10:16 :
> That is the viewer. You could write some script in the report that would
> save the report to the server in a different format while the user is
> viewing it in HTML. Is that what you want?
>
> Jason
>
> On 9/8/2011 9:23 PM, cbr125x wrote:
>> actually i'm not really sure what method i use, i think it is BIRT
>> Viewer, i put the "webviewerExample" in the tomcat server, is it Viewer?
>>
>> can i you explain me too about the RE API?
>>
>> Thanks
>>
>> Jason Weathersby wrote on Thu, 08 September 2011 14:39
>>> Are you using the RE API or the BIRT Viewer?
>>>
>>> Jason
>>>
>>> On 9/6/2011 9:28 PM, cbr125x wrote:
>>> > Thanks Jason for reply,
>>> > yes, i want to generate the report that i made by BIRT into PDF file,
>>> > and save the file in the server local drive or client local drive
>>> (which
>>> > i already granted permission to write).
>>> > Let's say i want to generate the report in pdf file at C:\PDF\ or at
>>> > \\server1\PDF\
>>> > is there a way to do that?
>>> >
>>> >
>>> >
>>> > Jason Weathersby wrote on Tue, 06 September 2011 10:38
>>> >> Can you give some more detail? Do you want as a user views the report
>>> >> in html the server to generate a pdf copy somewhere?
>>> >>
>>> >> Jason
>>> >>
>>> >> On 9/6/2011 4:24 AM, cbr125x wrote:
>>> >> > Hi all,
>>> >> > Is there a way to save or export report to pdf or excel silently in
>>> >> > server or client PC?
>>> >> >
>>> >> > Thanks
>>> >
>>> >
>>
>>
>
Attachment: burst.zip
(Size: 5.53KB, Downloaded 121 times)
Jason Weathersby
BIRT Exchange
|
|
|
| Re: How to save report to excel or pdf silently in server or client PC [message #725173 is a reply to message #725008] |
Wed, 14 September 2011 03:02   |
cbr125x Messages: 34 Registered: July 2011 |
Member |
|
|
Thx Jason for keep replying my question.
i already test the example u gave me. it generate pdf successfuly.
but i did not succeed implement the script in my report.
i try to describe the example u gave, sorry if i was wrong.
in the report it seeems we have to report "burstpdf" and "burstDetail".
when we called the "burstpdf" report then we generate the "burstDetail" report to pdf into "c:temp".
how about if i want to generate the burstpdf only?
i try to put this script in the afterFactory Events in report design
importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var des = re.openReportDesign("C:/Testing/ABC.rptdesign"); //--> Let's say i have ABC.rptdesign
var ntask = re.createRunAndRenderTask(des);
var options = new PDFRenderOption();
var outputfile = "c:/temp/test1.pdf";
options.setOutputFileName(outputfile);
options.setOutputFormat("pdf");
ntask.setRenderOption(options);
ntask.run();
ntask.close();
the viewer become not responding. but when i comment the
//ntask.run();
//ntask.close();
The report run successfuly but the pdf is still not created.
can u help me in which script i must change?
Thx Again
Jason Weathersby wrote on Tue, 13 September 2011 13:52I am attaching an example of a report that creates a pdf for every row
in a detail table. Look at the table row oncreate to get an idea on how
to call the api from script. In your case you can put the script in the
afterFactory of the report.
Jason
[Updated on: Wed, 14 September 2011 03:03] Report message to a moderator
|
|
| | |
| Re: How to save report to excel or pdf silently in server or client PC [message #725677 is a reply to message #725508] |
Thu, 15 September 2011 09:46  |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
It does not matter if you do it in the beforeFactory or afterFactory.
The reason it is taking longer without the parameter is it is trying to
run the report a bunch of times. Every time you call the report it will
create the pdf which is circular logic.
Jason
On 9/14/2011 10:07 PM, cbr125x wrote:
> thx Jason it works now. but i have some questions. 1. I tried not to use
> the parameter, PDF file is generated but it takes long time than we use
> parameter. why should we use parameter?
> 2. what is the different with after factory and before factory?
>
>
>
> Jason Weathersby wrote on Wed, 14 September 2011 11:25
>> My guess is that you have a nested chase condition. You are calling a
>> report that generates a pdf which in itself is generating another pdf
>> and on and on and on..
>>
>> Look at the attached example where I use a hidden parameter to make
>> sure this does not happen. BTW I just did the pdf generation in the
>> beforeFactory.
>>
>> Jason
>>
>> On 9/14/2011 3:02 AM, cbr125x wrote:
>> > importPackage(Packages.org.eclipse.birt.report.engine.api);
>> > var re = reportContext.getReportRunnable().getReportEngine();
>> > var des = re.openReportDesign("C:/Testing/ABC.rptdesign"); var ntask =
>> > re.createRunAndRenderTask(des);
>> > var options = new PDFRenderOption();
>> > var outputfile = "c:/temp/test1.pdf";
>> > options.setOutputFileName(outputfile);
>> > options.setOutputFormat("pdf");
>> > ntask.setRenderOption(options);
>> > ntask.run();
>> > ntask.close();
>
>
Jason Weathersby
BIRT Exchange
|
|
|
Goto Forum:
Current Time: Tue May 21 00:28:23 EDT 2013
Powered by FUDForum. Page generated in 0.01951 seconds
|