OFBiz
  1. OFBiz
  2. OFBIZ-4480

Need to have an option to pass file name as OrderId for the generated confirmation or invoice PDF.

    Details

    • Sprint:
      Bug Crush Event - 21/2/2015

      Description

      Need to have set the order pdf file name to its order number when we open the pdf from backoffice orderdetail page (/ordermgr/control/order.pdf?orderId=XXXXX).

      Currently, the default name of the pdf is always "order.pdf", instead need to have an option to set the default pdf name to its order number?

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          5d 23h 27m 1 Ganesh Bawne 20/Oct/11 07:58
          Patch Available Patch Available Resolved Resolved
          1308d 13h 54m 1 Michael Brohl 20/May/15 21:52
          Resolved Resolved Closed Closed
          4m 40s 1 Michael Brohl 20/May/15 21:56
          Closed Closed Reopened Reopened
          9h 15m 1 Deepak Dixit 21/May/15 07:12
          Reopened Reopened Closed Closed
          4h 25m 1 Deepak Dixit 21/May/15 11:37
          Deepak Dixit made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Hide
          Deepak Dixit added a comment -

          Sure Michael,

          Here is the ticket for print pick sheet pdf issue OFBIZ-6398

          Show
          Deepak Dixit added a comment - Sure Michael, Here is the ticket for print pick sheet pdf issue OFBIZ-6398
          Deepak Dixit made changes -
          Link This issue breaks OFBIZ-6398 [ OFBIZ-6398 ]
          Hide
          Michael Brohl added a comment -

          Deepak,

          wouldn't this be another ticket? This ticket is about the order and invoice pdf.

          Show
          Michael Brohl added a comment - Deepak, wouldn't this be another ticket? This ticket is about the order and invoice pdf.
          Deepak Dixit made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Hide
          Deepak Dixit added a comment -

          Pick Sheet pdf also using the OrderId.pdf pattern.

          Show
          Deepak Dixit added a comment - Pick Sheet pdf also using the OrderId.pdf pattern.
          Michael Brohl made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Michael Brohl added a comment -

          improved in
          trunk r1680671
          release 14.12 r1680672

          I'm closing this issue because the initial intent is done with it. There are some interesting additional thoughts for better file export / view handling in the comments. Please file an new issue if you want to work on them further.

          Show
          Michael Brohl added a comment - improved in trunk r1680671 release 14.12 r1680672 I'm closing this issue because the initial intent is done with it. There are some interesting additional thoughts for better file export / view handling in the comments. Please file an new issue if you want to work on them further.
          Michael Brohl made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Michael Brohl made changes -
          Fix Version/s Trunk [ 12311928 ]
          Fix Version/s Release Branch 14.12 [ 12329704 ]
          Michael Brohl made changes -
          Affects Version/s Upcoming Branch [ 12329183 ]
          Affects Version/s Trunk [ 12311928 ]
          Michael Brohl made changes -
          Assignee Michael Brohl [ mbrohl ]
          Michael Brohl made changes -
          Link This issue relates to OFBIZ-6238 [ OFBIZ-6238 ]
          Sharan Foga made changes -
          Rank Ranked higher
          Sharan Foga made changes -
          Rank Ranked higher
          Sharan Foga made changes -
          Rank Ranked higher
          Sharan Foga made changes -
          Sprint Bug Crush Event - 21/2/2015 [ 91 ]
          Hide
          Adrian Crum added a comment -

          I agree that we need a better way to handle import/export. The screen renderers are convenient, but using them requires a lot of kludge code. A "file export" view handler would be ideal.

          Show
          Adrian Crum added a comment - I agree that we need a better way to handle import/export. The screen renderers are convenient, but using them requires a lot of kludge code. A "file export" view handler would be ideal.
          Hide
          Chris Howe added a comment -

          Using this works on pdf files because the output stream waits until the end. However when using the MacroScreenViewHandler (for text/csv for example), you end up putting the servletResponse in the committed state by using response.getWriter() or by writing to the output stream.

          response.getWriter is the default when using stock ofbiz. That gets called before any action takes place in evaluating the screen. There would need to be an override for that in determining "useOutputStreamNotWriter".

          Once that's determined, the Tree Renderer tries to render it's template. That needs to be fixed to match the Screen and Form Renderers.

          Then finally, there is an attempt to render the Screen Begin Macro.

          I'm not sure how to best overcome this for use within the OFBiz project going forward. But checking for contentType "text/csv" before each of those issues fixes my local setup. Perhaps using a different View Handler when such modifications are needed is best (though Tree Widget Rendering differently than the others probably would need to be taken care of).

          Show
          Chris Howe added a comment - Using this works on pdf files because the output stream waits until the end. However when using the MacroScreenViewHandler (for text/csv for example), you end up putting the servletResponse in the committed state by using response.getWriter() or by writing to the output stream. response.getWriter is the default when using stock ofbiz. That gets called before any action takes place in evaluating the screen. There would need to be an override for that in determining "useOutputStreamNotWriter". Once that's determined, the Tree Renderer tries to render it's template. That needs to be fixed to match the Screen and Form Renderers. Then finally, there is an attempt to render the Screen Begin Macro. I'm not sure how to best overcome this for use within the OFBiz project going forward. But checking for contentType "text/csv" before each of those issues fixes my local setup. Perhaps using a different View Handler when such modifications are needed is best (though Tree Widget Rendering differently than the others probably would need to be taken care of).
          Hide
          Nicolas Malin added a comment -

          I look the patch, quick and powerful improvement to solve this issue, but improve directly ViewHandler to support a generic attribute (as example responseFileName) would be more usable for other report.

          Nicolas

          Show
          Nicolas Malin added a comment - I look the patch, quick and powerful improvement to solve this issue, but improve directly ViewHandler to support a generic attribute (as example responseFileName) would be more usable for other report. Nicolas
          Ganesh Bawne made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Ganesh Bawne added a comment -

          Thank you Anne for your quick reply.

          I have created the patch which will use orderId and InvoiceId as default name when "File Download" Dialog Box appear.

          To fix the issue, I set the content-disposition header in response to override this default behavior.
          Right now done it in CompanyHeader.groovy as is used for print pdf files.

          You can test it on pdf and invoice link on backend's orderdetails page.

          Thanks,
          Ganesh

          Show
          Ganesh Bawne added a comment - Thank you Anne for your quick reply. I have created the patch which will use orderId and InvoiceId as default name when "File Download" Dialog Box appear. To fix the issue, I set the content-disposition header in response to override this default behavior. Right now done it in CompanyHeader.groovy as is used for print pdf files. You can test it on pdf and invoice link on backend's orderdetails page. Thanks, Ganesh
          Ganesh Bawne made changes -
          Field Original Value New Value
          Attachment orderPdf-FileName.patch [ 12499818 ]
          Hide
          Jacques Le Roux added a comment -

          From Anne on user ML

          Only a partial answer, I'm afraid.

          You need to set the content-disposition header. Google gave this page
          http://support.microsoft.com/kb/260519 which shows the syntax.

          I haven't looked at how you might do this with OfBiz.

          Show
          Jacques Le Roux added a comment - From Anne on user ML Only a partial answer, I'm afraid. You need to set the content-disposition header. Google gave this page http://support.microsoft.com/kb/260519 which shows the syntax. I haven't looked at how you might do this with OfBiz.
          Ganesh Bawne created issue -

            People

            • Assignee:
              Michael Brohl
              Reporter:
              Ganesh Bawne
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile