|
|
|
Re: How to save report to excel or pdf silently in server or client PC [message #723540 is a reply to message #722861] |
Thu, 08 September 2011 18: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 #723620 is a reply to message #723540] |
Fri, 09 September 2011 01: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 14: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 #724731 is a reply to message #724557] |
Tue, 13 September 2011 01: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 17:52 |
|
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 1136 times)
|
|
|
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 07: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 07:03] Report message to a moderator
|
|
|
Re: How to save report to excel or pdf silently in server or client PC [message #725382 is a reply to message #725173] |
Wed, 14 September 2011 15: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();
|
|
|
|
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 13:46 |
|
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();
>
>
|
|
|
|
Re: How to save report to excel or pdf silently in server or client PC [message #1727778 is a reply to message #1064752] |
Sun, 27 March 2016 11:32 |
|
Hi jason,
In the way you showed i am able to create pdf files for static reports. but what about dynamic reports? I mean i am using pojo data source provided in birt and generating a report from rptdesign file. in the rptdesign file i tried copying the same code written by you but i does not work.
I want to generate the pdf file for the viewing report which is generated by pojo datasource using the data from the database. can you help me in this?
Thanks and Regards,
Muralidhar Yaragalla.
http://yaragalla.blogspot.in
|
|
|
|
Re: How to save report to excel or pdf silently in server or client PC [message #1771810 is a reply to message #725508] |
Wed, 30 August 2017 18:56 |
yoovraj khullar Messages: 7 Registered: November 2014 |
Junior Member |
|
|
Hi
your Example report CreatePDFversion is working for no parameters But i have to pass parameters.
But in my Report i have many parameters which are passed to the Report.
It shows 27 pages data, but the file in C;/temp/testa.pdf shows no data.
Why ? Is additional code required for paramterized Report to pass those paramters to the PDF too.
Can you please modify your code in Before Factory to include the parameters value passed to the Report design in your code. i.e.
if( params["createPDF"] == true ){
importPackage(Packages.org.eclipse.birt.report.engine.api);
var re = reportContext.getReportRunnable().getReportEngine();
var des = re.openReportDesign("C:\\work\\workspaces\\2.6.1workspaces\\BIRT - Reports\\BirtEventHandlersReports\\book\\script\\burst\\createpdfversion.rptdesign");
var ntask = re.createRunAndRenderTask(des);
ntask.setParameterValue("createPDF", false);
var options = new PDFRenderOption();
var outputfile = "C:/Temp/testa.pdf";
options.setOutputFileName(outputfile);
options.setOutputFormat("pdf");
ntask.setRenderOption(options);
ntask.run();
ntask.close();
}
[Updated on: Wed, 30 August 2017 20:54] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05284 seconds