Re: [Zope] Reportlab issue
Did you try to get the report outside of FF or IE? I mean, did you try with tools like wget or the same, and looking at the result? Do you have the same behaviour if you exit the browser, clear the caches and the access a report again? Regards Marco On 8/28/06, David H [EMAIL PROTECTED] wrote: Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. Anyone seen this? David H I'm using ReportLab 1.20, Zope 2.78 and an external python script + ReportLab to generate the PDFs. The Server is Linux Ubuntu 5.10. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) -- Marco Bizzarri http://notenotturne.blogspot.com/ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
--On 28. August 2006 08:23:55 +0200 Marco Bizzarri [EMAIL PROTECTED] wrote: Did you try to get the report outside of FF or IE? I mean, did you try with tools like wget or the same, and looking at the result? Do you have the same behaviour if you exit the browser, clear the caches and the access a report again? You might also trible check that your app really sends the content-length header. -aj pgpLDPZnunnNk.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
David H wrote at 2006-8-27 17:54 -0700: ... I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. It is unlikely that this is a server side problem. To verify, check your ZServer log file (usually called Z2.log). It is likely that you need to configure it before Zope will write it. If configured, the log file will contain one entry (line) for each completed request. This way, you can verify, whether Zope see your report requests and how it responded. If this (quite high) level of detail is not sufficient to decide whether the problem is on client or server side, you can use a TCP-logger (such as Shane's tcpwatch) to log the communication between client and server. This will finally allow you to decide -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
Dieter Maurer wrote: David H wrote at 2006-8-27 17:54 -0700: ... I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. It is unlikely that this is a server side problem. To verify, check your "ZServer" log file (usually called "Z2.log"). It is likely that you need to configure it before Zope will write it. If configured, the log file will contain one entry (line) for each completed request. This way, you can verify, whether Zope see your report requests and how it responded. If this (quite high) level of detail is not sufficient to decide whether the problem is on client or server side, you can use a TCP-logger (such as Shane's "tcpwatch") to log the communication between client and server. This will finally allow you to decide Right Dieter and I really should have used these tools by now :-) ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
- Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 8:54 PM Subject: [Zope] Reportlab issue Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. I have never used ReportLab, but is there a possibility that when you go back to the adobe document it is being served from a cache? You could try using html meta tags or response.setHeader (better) to make sure the document is not being served from the cache. Just a shot in the dark! Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 8:54 PM Subject: [Zope] Reportlab issue Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. I have never used ReportLab, but is there a possibility that when you go back to the adobe document it is being served from a cache? You could try using html meta tags or response.setHeader (better) to make sure the document is not being served from the cache. Just a shot in the dark! Jonathan Hi Jonathan, Yes, I did try that, e.g. (report lab + external file stuff) # --- def writeReport(self, RESPONSE): # --- generates report output self.save() theFile=open( self.pdfpath,'rb') result = theFile.read() theFile.close() os.remove(self.pdfpath) # the next 3 lines were snarked from google zope no cache I think its a casey duncan recipe ... RESPONSE.setHeader('Pragma', 'no-cache') RESPONSE.setHeader('Cache-Control','no-cache') RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT') # the normal fair RESPONSE.setHeader('Content-Type','application/pdf') RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') RESPONSE.setHeader('Content-Length',len(result)) RESPONSE.write(result) # result is And it didn't help. David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
- Original Message - From: David H [EMAIL PROTECTED] To: Jonathan [EMAIL PROTECTED] Cc: zope user list zope@zope.org Sent: Sunday, August 27, 2006 9:25 PM Subject: Re: [Zope] Reportlab issue Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 8:54 PM Subject: [Zope] Reportlab issue Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. I have never used ReportLab, but is there a possibility that when you go back to the adobe document it is being served from a cache? You could try using html meta tags or response.setHeader (better) to make sure the document is not being served from the cache. Just a shot in the dark! Jonathan Hi Jonathan, Yes, I did try that, e.g. (report lab + external file stuff) # --- def writeReport(self, RESPONSE): # --- generates report output self.save() theFile=open( self.pdfpath,'rb') result = theFile.read() theFile.close() os.remove(self.pdfpath) # the next 3 lines were snarked from google zope no cache I think its a casey duncan recipe ... RESPONSE.setHeader('Pragma', 'no-cache') RESPONSE.setHeader('Cache-Control','no-cache') RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT') # the normal fair RESPONSE.setHeader('Content-Type','application/pdf') RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') RESPONSE.setHeader('Content-Length',len(result)) RESPONSE.write(result) # result is And it didn't help. Another shot in the dark... could it be an adobe acrobat issue? By which i mean that adobe sees that you are looking at the same document (reportNz.pdf) and then tries to reopen the document at the last point you were looking. Try randomizing the file name (add 2 or 3 random digits to the filename and see what happens). Good luck! Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: Jonathan [EMAIL PROTECTED] Cc: zope user list zope@zope.org Sent: Sunday, August 27, 2006 9:25 PM Subject: Re: [Zope] Reportlab issue Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 8:54 PM Subject: [Zope] Reportlab issue Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. I have never used ReportLab, but is there a possibility that when you go back to the adobe document it is being served from a cache? You could try using html meta tags or response.setHeader (better) to make sure the document is not being served from the cache. Just a shot in the dark! Jonathan Hi Jonathan, Yes, I did try that, e.g. (report lab + external file stuff) # --- def writeReport(self, RESPONSE): # --- generates report output self.save() theFile=open( self.pdfpath,'rb') result = theFile.read() theFile.close() os.remove(self.pdfpath) # the next 3 lines were snarked from google zope no cache I think its a casey duncan recipe ... RESPONSE.setHeader('Pragma', 'no-cache') RESPONSE.setHeader('Cache-Control','no-cache') RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT') # the normal fair RESPONSE.setHeader('Content-Type','application/pdf') RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') RESPONSE.setHeader('Content-Length',len(result)) RESPONSE.write(result) # result is And it didn't help. Another shot in the dark... could it be an adobe acrobat issue? By which i mean that adobe sees that you are looking at the same document (reportNz.pdf) and then tries to reopen the document at the last point you were looking. Try randomizing the file name (add 2 or 3 random digits to the filename and see what happens). Good luck! Jonathan Jonathan, We think alike. If you scan my original msg you'll see that I tested varying the Content-Dispostion ... report= name as well. Im sure if it were a snake i'd be bitten by now. David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
- Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 9:48 PM Subject: Re: [Zope] Reportlab issue Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: Jonathan [EMAIL PROTECTED] Cc: zope user list zope@zope.org Sent: Sunday, August 27, 2006 9:25 PM Subject: Re: [Zope] Reportlab issue Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 8:54 PM Subject: [Zope] Reportlab issue Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. I have never used ReportLab, but is there a possibility that when you go back to the adobe document it is being served from a cache? You could try using html meta tags or response.setHeader (better) to make sure the document is not being served from the cache. Just a shot in the dark! Jonathan Hi Jonathan, Yes, I did try that, e.g. (report lab + external file stuff) # --- def writeReport(self, RESPONSE): # --- generates report output self.save() theFile=open( self.pdfpath,'rb') result = theFile.read() theFile.close() os.remove(self.pdfpath) # the next 3 lines were snarked from google zope no cache I think its a casey duncan recipe ... RESPONSE.setHeader('Pragma', 'no-cache') RESPONSE.setHeader('Cache-Control','no-cache') RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT') # the normal fair RESPONSE.setHeader('Content-Type','application/pdf') RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') RESPONSE.setHeader('Content-Length',len(result)) RESPONSE.write(result) # result is And it didn't help. Another shot in the dark... could it be an adobe acrobat issue? By which i mean that adobe sees that you are looking at the same document (reportNz.pdf) and then tries to reopen the document at the last point you were looking. Try randomizing the file name (add 2 or 3 random digits to the filename and see what happens). Good luck! Jonathan Jonathan, We think alike. If you scan my original msg you'll see that I tested varying the Content-Dispostion ... report= name as well. Sorry, i missed that in your original post. I'm all out of shots-in-the-dark! Have you tried seeking help on the adobe acrobat developer lists? Jonathan ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Reportlab issue
Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 9:48 PM Subject: Re: [Zope] Reportlab issue Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: Jonathan [EMAIL PROTECTED] Cc: zope user list zope@zope.org Sent: Sunday, August 27, 2006 9:25 PM Subject: Re: [Zope] Reportlab issue Jonathan wrote: - Original Message - From: David H [EMAIL PROTECTED] To: zope user list zope@zope.org Sent: Sunday, August 27, 2006 8:54 PM Subject: [Zope] Reportlab issue Hi Zope List, I have an Zope application that uses ReportLab to generate acrobat viewable reports. (I already posted this to reportlab list - so far no solutions). Heres the problem: I display an acrobat report (using Firefox or IE 6) and say scroll down to page 10. I then use the browser back button to re-enter my Zope application. Now, even if I click various unrelated pages in the application (clearing the request,etc) and then return to the Report (which is always freshly generated) it will try to re-display at page 10 - instead of top of page. This occurs even if the data being reported has changed, and this occurs even if a different report is generated! Note: that I use import tempfile and tmpFile2 = tempfile.mktemp() to keep pdfPath's unique ... I've tried combinations of Content-Disposition params like changing filename=, etc. Nothing is changing this behavior. I've tried (a reportlab mailing list suggestion) varying to forms action= like form name=printform method=post action=extensions/pyBudgetReports tal:attributes=action python: 'extensions/pyBudgetReports/?random=' + context.python.pyTime() No help either. I have never used ReportLab, but is there a possibility that when you go back to the adobe document it is being served from a cache? You could try using html meta tags or response.setHeader (better) to make sure the document is not being served from the cache. Just a shot in the dark! Jonathan Hi Jonathan, Yes, I did try that, e.g. (report lab + external file stuff) # --- def writeReport(self, RESPONSE): # --- generates report output self.save() theFile=open( self.pdfpath,'rb') result = theFile.read() theFile.close() os.remove(self.pdfpath) # the next 3 lines were snarked from google zope no cache I think its a casey duncan recipe ... RESPONSE.setHeader('Pragma', 'no-cache') RESPONSE.setHeader('Cache-Control','no-cache') RESPONSE.setHeader('Expires', 'Sat, 1 Jan 2000 00:00:00 GMT') # the normal fair RESPONSE.setHeader('Content-Type','application/pdf') RESPONSE.setHeader('Content-Disposition','inline;filename=reportNz.pdf') RESPONSE.setHeader('Content-Length',len(result)) RESPONSE.write(result) # result is And it didn't help. Another shot in the dark... could it be an adobe acrobat issue? By which i mean that adobe sees that you are looking at the same document (reportNz.pdf) and then tries to reopen the document at the last point you were looking. Try randomizing the file name (add 2 or 3 random digits to the filename and see what happens). Good luck! Jonathan Jonathan, We think alike. If you scan my original msg you'll see that I tested varying the Content-Dispostion ... report= name as well. Sorry, i missed that in your original post. I'm all out of shots-in-the-dark! Have you tried seeking help on the adobe acrobat developer lists? Jonathan I think I'll slaughter a chicken at midnite! I'll wander off to adobe land ... David ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )