The Jasper Report plug-in is working. However, the PDF that's returned is displayed in the same browser window that initiated the action. I want the PDF to display in a new browser window. That way, my original window is not overwritten by the report.
I've tried opening another window with java script { window.open('displayJasperReport.jsp') } and then calling the action that generates the jasper report from it using <s:action name="generateReport" executeResult="true"/> , this does work, however the result isn't rendered correctly in the browser. Instead of seeing a nice PDF in the browser, I see a string that starts with: %PDF-1.4 %���� 3 0 obj <> stream x���MO�0���s\`�3�q�J6�����`X�6��mq!K I'm guessing the content-type isn't being set. To recap, calling the action from a <a:submit and having the results returned to the same browser window works perfectly. Calling the action using <a:action from a popup opened via window.open does excecute the action class. However, what's returned is not displayed as a PDF. Thanks in advance for the help... Frank honey0303 wrote: > > > hello again.. > i got this error..when i try to include struts-plugin.xml > > > Message ID: > > WebModule[/myeis]Exception starting filter struts2 The package name > 'jasperreports-default' at location package - jar > Complete Message > > file:/opt/SDK/domains/domain1/applications/j2ee-modules/myeis/WEB-INF/lib/struts2-jasperreports-plugin-2.0.5.jar!/struts-plugin.xml:8:43 > is already been used by another package at location package - > file:/opt/SDK/domains/domain1/applications/j2ee-modules/myeis/WEB-INF/classes/struts-plugin.xml:8:43 > - package - > jar:file:/opt/SDK/domains/domain1/applications/j2ee-modules/myeis/WEB-INF/lib/struts2-jasperreports-plugin-2.0.5.jar!/struts-plugin.xml:8:43 > > > here is my struts-plugin.xml > > <struts> > <package name="jasperreports-default"> > > <result-types> > <result-type name="jasper" > class="org.apache.struts2.views.jasperreports.JasperReportsResult"/> > </result-types> > </package> > > </struts> > > and my action mapping > > <action name="eis_hr_002" class="apps.eis_hr_002"> > <result name="success" type="jasper"> > </result> > </action> > > please help me..thank you so much > > > RobinCamus <[EMAIL PROTECTED]> wrote: > I saw your others post so if i understand correctly, you want to use > jasperreports so here is what i ve done: > in struts.xml: > - > - > > - > - > class="org.apache.struts2.views.jasperreports.JasperReportsResult" /> > - > - > -... > -... > -... > -... > - > class="maintenanceHistoryQueryAction" method="search"> > - > - WEB-INF/pages/reports.jasper/maintenance_report.jasper > - maintenanceHistoryQueryList > - PDF > - > - > -... > -... > - > > actually if you re using jasperreports, > org.apache.struts2.views.jasperreports.JasperReportsResult is the good > class > for the result class. > WEB-INF/pages/reports.jasper/maintenance_report.jasper is your precompiled > rapport (i ve build them with ireports) > maintenanceHistoryQueryList is the list with the data you need for your > report > > you can find all those information on jasperreports forum... > > Robin > > > honey0303 wrote: >> >> still i got the error even if i include that in my default package.. >> >> e.g. >> >> >> >> > >> >> >> >> class="org.apache.struts2.views.jasperreports.JasperReportsResult" /> >> >> ... >> >> >> still have same error.. >> >> what you mean by this.. >> >> You ll have to find the result class you need to point at.. >> >> i am really new at Struts..please help me..thanks again. >> >> >> >> >> RobinCamus wrote: >>> >>> I had to implement a jasper type for jasper report: >>> I think you need to define a result type in struts.xml like >>> >>> > >>> >>> >>> class="org.apache.struts2.views.jasperreports.JasperReportsResult" /> >>> >>> .... >>> >>> >>> You ll have to find the result class you need to point at. >>> I hope it helps >>> >>> Robin >>> >>> >>> honey0303 wrote: >>>> >>>> Hi i'm trying to integrate jasper with struts 2..but i got an error >>>> because of my result type jasper >>>> >>>> i've followed this tutorial.. >>>> >>>> >>>> class="com.mevipro.test.action.JasperAction"> >>>> >>>> >>>> >>>> my question is how can i defined a jasper result type? >>>> i need answers ASAP..Thanks in advance >>>> >>> >>> >> >> > > -- > View this message in context: > http://www.nabble.com/result-type-Jasper--Struts-2--tf3882770.html#a11006929 > Sent from the Struts - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > --------------------------------- > Be a better Globetrotter. Get better travel answers from someone who > knows. > Yahoo! Answers - Check it out. > -- View this message in context: http://www.nabble.com/result-type-Jasper--Struts-2--tf3882770.html#a11413180 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]