Jump to content

Save the generated report(by Struts2) in local PC


me_vsoundar

Recommended Posts

Hello,

I am using the jasper reports in struts2 framework.

 

Consider, I've an action class which contains the dataSource(i.e a list) and the necessary parameters...

In my struts.xml like

         <action name="masterAction" class="real.MasterAction">
            
              <result name="SUCCESS" type="jasper">
                  <param name="location">/page/DspGrpBasedReport.jasper</param>
                   <param name="dataSource">plist</param>
                  <param name="format">PDF</param>
                </result>
              <result name="FAILURE">/Page2.jsp</result>
          </action>

Now, if i invoke this action, it runs and generated the PDF in the same browser window. But I want this PDF to save in my local system(where ever i specify the location) also automatically.

  --------> If I set the parameter contentdisposition = attachment, then it asks everytime to download/open the file. But I dont want to asking the location to save/open instead of saving the generated file wherever i specified.....

                    <param name="contentDisposition">attachment</param>

In other words, Whenever i invoke the action, the generated PDF File automatically save in the local machine(Where i to specify for eg., UNDER C:Reports).

Regards,

../../../themes/jasper/images//tools/forum/arrow.gif

Soundararajan V

 

Link to comment
Share on other sites

  • 3 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...