thanks, I will try that
yinka

On Thu, Sep 11, 2008 at 6:00 AM, Edvin Syse <[EMAIL PROTECTED]> wrote:

> The freemarker-version is something like this:
>
> The user has created a template using the .fo format with Freemarker, a
> (too) simple example could be:
>
> http://tornado.no/template/show?template=global.fop
>
> (Notice the list-directive to iterate over articles in this case, since it
> is a CMS).
>
> Then, in the Wicket page I do:
>
> byte[] b = FopUtils.createPDF(aStringWithTheMarkup);
> RequestCycle.get().setRequestTarget(new ResourceStreamRequestTarget(
> new ByteArrayResourceStream(b, contentType)).setFileName(page.getTitle() +
> ".pdf"));
>
> (contentType is "application/pdf").
>
> The FopUtils class is like this:
>
> public class FopUtils {
>   private static FopFactory fopFactory = FopFactory.newInstance();
>
>   public static byte[] createPDF(String foMarkup) throws IOException,
> FOPException, TransformerException {
>       ByteArrayOutputStream out = new ByteArrayOutputStream();
>
>       FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
>       Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent,
> out);
>
>       // Setup JAXP using identity transformer
>       TransformerFactory factory = TransformerFactory.newInstance();
>       javax.xml.transform.Transformer transformer =
> factory.newTransformer(); // identity transformer
>
>       // Setup input stream
>       Source src = new StreamSource(new StringInputStream(foMarkup));
>
>       // Resulting SAX events (the generated FO) must be piped through to
> FOP
>       Result res = new SAXResult(fop.getDefaultHandler());
>
>       // Start XSLT transformation and FOP processing
>       transformer.transform(src, res);
>
>       // Result processing
>       FormattingResults foResults = fop.getResults();
>
>       out.close();
>       return out.toByteArray();
>   }
>
>
> }
>
> .. and you get a simple PDF served in milliseconds :)
>
> -- Edvin
>
>
>
> Ajayi Yinka skrev:
>
>  Hi, could you shed more lights on how you achieve this?
>>
>> Thanks in advance.
>> Yinka
>>
>> On Thu, Sep 11, 2008 at 3:56 AM, Edvin Syse <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>> We use Apache XmlGraphhics/FOP to create PDF successfully in our
>>> Wicket-applications. Some places I use an external XML-datasource and
>>> convert using XSLT, and other times I use Freemarker to generate the .fo
>>> directly. It's extremely fast, and the markup is easy to understand and
>>> easy
>>> to change/style.
>>>
>>> Actually, in our Wicket-based CMS, the users can change templates so that
>>> the same article can output HTML, RSS/XML or even PDF through Apache FOP
>>> :)
>>>
>>> -- Edvin
>>>
>>> David R Robison skrev:
>>>
>>>
>>>
>>>> We use Jasper reports. We took what had been started and made some
>>>> modifications and have it working in Wicket. It works well for us. David
>>>>
>>>> Eyal Golan wrote:
>>>>
>>>>
>>>>
>>>>> reiern70:
>>>>> Could you please elaborate on how you included BIRT as the part of the
>>>>> application?
>>>>> You can mail directly to me if you feel it is out of Wicket's scope.
>>>>>
>>>>> Thanks
>>>>>
>>>>> On Tue, Sep 9, 2008 at 2:19 PM, reiern70 <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Actually there is no deed to have BIRT in a separated WAR: in our
>>>>>> project
>>>>>> we
>>>>>> have included it as a (singleton) runtime which is part of the
>>>>>> application.
>>>>>> We also have some kind of WEB interface to manage report parameters...
>>>>>> We
>>>>>> found BIRT quite useful  for generating reports.... thought we had
>>>>>> some
>>>>>> problems when migrating to new versions (sometimes things that were
>>>>>> working
>>>>>> perfectly with one version got terrible unfixed when moving to the
>>>>>> next).
>>>>>> With BIRT you get "for free" the ability to produce Excel, Word,
>>>>>> etc...
>>>>>>
>>>>>> In our project we went a bit further and built a machinery that allows
>>>>>> to
>>>>>> combine BIRT (and non BIRT) PDF reports into books: BIRT reports are
>>>>>> very
>>>>>> good in summarizing information but you are on your own when you have
>>>>>> to
>>>>>> combine them... This "tool" allows you to build a tree like structure
>>>>>> (a
>>>>>> book) where the nodes are BIRT reports. The  tool will help in
>>>>>> collecting
>>>>>> all the bookmarks into a table of contents, generate combined
>>>>>> bookmarks
>>>>>> and
>>>>>> so on...
>>>>>>
>>>>>> For simpler use cases I have used iText, JFreeChart, JExcelAPI,
>>>>>> OpenCSV...
>>>>>>
>>>>>> Best,
>>>>>>
>>>>>> Ernesto
>>>>>>
>>>>>>
>>>>>>
>>>>>> egolan74 wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi,
>>>>>>> We use BIRT as a report engine.
>>>>>>> A freelancer has created the prototype BIRT project, and now we took
>>>>>>> over
>>>>>>> it.
>>>>>>> 1. BIRT gives you all your needs.
>>>>>>> 2. I don't like it very much actually.
>>>>>>> 3. It is a different project than Wicket. (different WAR)
>>>>>>> 4. I plan to check how to integrate it to be in the same project /
>>>>>>> WAR
>>>>>>> of
>>>>>>> our main web application.
>>>>>>>
>>>>>>> Our integration:
>>>>>>> We don't like the way BIRT implemented the parameters window so we
>>>>>>> wanted
>>>>>>> to
>>>>>>> make our own.
>>>>>>> We found out that it would be much easier to develop it with Wicket
>>>>>>> than
>>>>>>> to
>>>>>>> customize it in BIRT.
>>>>>>> So:
>>>>>>> 1. We have a page that has an IFrame (inline frame).
>>>>>>> 2. For each report (in the BIRT project) there's a Wicket's popup
>>>>>>> modal
>>>>>>> window to select parameters.
>>>>>>>    I am very happy with the module we built for that. It is very easy
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> to
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> create new parameters window.
>>>>>>> 3. When the user chooses the parameters and press OK, I set, using
>>>>>>> AttributeModifier, the src attribute of the inline frame.
>>>>>>> 4. It is all Ajax, so the inline frame is updated with the src, and
>>>>>>> the
>>>>>>> report is generated with the correct parameters..
>>>>>>> This module is VERY new in our project. I still have some bugs, but
>>>>>>> this
>>>>>>> is
>>>>>>> how we integrated BIRT and Wicket.
>>>>>>>
>>>>>>> A question to you all:
>>>>>>> Has anyone worked with Wicket and BIRT?
>>>>>>> (funny, but I planned to ask this anyway)
>>>>>>>
>>>>>>> Eyal
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Sep 8, 2008 at 11:30 AM, Leon Nieuwoudt
>>>>>>> <[EMAIL PROTECTED]>wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Hi all
>>>>>>>>
>>>>>>>> I would like to know what kind of reporting engines are commonly
>>>>>>>> used
>>>>>>>> for Wicket-based apps? We have the need to generate CSV, Excel, and
>>>>>>>> PDF files with graphs and pretty graphics.
>>>>>>>>
>>>>>>>> We've looked at the JasperReports integration but the docs say it's
>>>>>>>> not
>>>>>>>> complete
>>>>>>>>
>>>>>>>> Thanks in advance
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Eyal Golan
>>>>>>> [EMAIL PROTECTED]
>>>>>>>
>>>>>>> Visit: http://jvdrums.sourceforge.net/
>>>>>>> LinkedIn: http://www.linkedin.com/in/egolan74
>>>>>>>
>>>>>>> P Save a tree. Please don't print this e-mail unless it's really
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> necessary
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> -----
>>>>>>> Eyal Golan
>>>>>>> [EMAIL PROTECTED]
>>>>>>>
>>>>>>> Visit: JVDrums
>>>>>>> LinkedIn: LinkedIn
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>>
>>>>>> http://www.nabble.com/Reporting-Engine-on-Wicket-1.3.4-tp19367975p19390209.html
>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> Med vennlig hilsen
>>>
>>> Edvin Syse
>>> Programutvikler
>>>
>>> www.sysedata.no / [EMAIL PROTECTED]
>>> Tlf: 333 49700  / Faks: 333 49701
>>> Adresse: Møllegaten 12, 3111 Tønsberg
>>>
>>> Syse Data AS -Profesjonelle IT-tjenester
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>
>>
>>
>
> --
> Med vennlig hilsen
>
> Edvin Syse
> Programutvikler
>
> www.sysedata.no / [EMAIL PROTECTED]
> Tlf: 333 49700  / Faks: 333 49701
> Adresse: Møllegaten 12, 3111 Tønsberg
>
> Syse Data AS -Profesjonelle IT-tjenester
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to