I've been getting different suggestions with you guys
and I appreciate it alot. I tried applying your
suggestions but it looks like I'm still having a
problem with my pdf reports.
I found this lines of codes in the fpdf class.. Maybe
this is the source of the problem...
function Output($file='',$download=false)
{
//Output PDF to file or browser
global $HTTP_ENV_VARS;
if($this->state<3)
$this->Close();
if($file=='')
{
//Send to browser
Header('Content-Type: application/pdf');
if(headers_sent())
$this->Error('Some data has already been output to
browser, can\'t send PDF file');
Header('Content-Length: '.strlen($this->buffer));
Header('Content-disposition: inline;
filename=doc.pdf');
echo $this->buffer;
}
else
{
if($download)
{
//Download file
if(isset($HTTP_ENV_VARS['HTTP_USER_AGENT']) and
strpos($HTTP_ENV_VARS['HTTP_USER_AGENT'],'MSIE 5.5'))
Header('Content-Type: application/dummy');
else
Header('Content-Type:
application/octet-stream');
if(headers_sent())
$this->Error('Some data has already been output
to
browser, can\'t send PDF file');
Header('Content-Length: '.strlen($this->buffer));
Header('Content-disposition: attachment;
filename='.$file);
echo $this->buffer;
}
else
{
//Save file locally
$f=fopen($file,'wb');
if(!$f)
$this->Error('Unable to create output file:
'.$file);
fwrite($f,$this->buffer,strlen($this->buffer));
fclose($f);
}
}
}
This function is being called at the end so I wonder
how can I can improve this part to avoid caching of
generated pdf reports.
Thank you.
--- "Clodelio C. Delfino" <[EMAIL PROTECTED]> wrote:
> <script language="javascript">
> location="PrintReport.php?"<?= md5(date('r'));?>;
> </script>
>
> Above would do assuming <script
> language-"javascript"> is part of an
> HTML file parse by PHP.
>
> On Wed, Apr 16, 2008 at 11:12 AM, edgardo catorce
> <[EMAIL PROTECTED]> wrote:
> > Basically, all the file names are the same...
> >
> > this is a part of the code that creates a new
> window
> > for the pdf. The PrintReport.php calls includes a
> > cache
> >
> > <script language="javascript">
> > location="PrintReport.php";
> > </script>
> >
> > When saving the pdf file, PrintReport.pdf is
> created.
> > I don't know where to put the random token for
> the
> > file name here.
> >
> > With regards to header that expires at the
> > time of the pdf, can i put it at the end of the
> fpdf
> > class? Is this correct?
> >
> > header("Pragma: no-cache");
> > header("Cache: no-cahce");
> >
> >
> > Is this a client or a server caching problem?
> >
> > The problem happens in almost all their
> computers.
> > Even if you select other type of report, it still
> > generate the same report. I think it only works
> > correctly in 2 computers. I also tried accessing
> their
> > system from my computer, and the report module
> works
> > ok naman :(
> >
> > I really your help guys.
> >
> > --- RJ <[EMAIL PROTECTED]> wrote:
> >
> > > Is there a previous report generated and the
> > > filenames are the same? Better
> > > append the date and time and then a random
> token to
> > > the filename to minimize
> > > cache problems. Or send a header that expires
> at the
> > > time of the pdf
> > > generation.
> > >
> > > On 4/15/08, edgardo catorce
> <[EMAIL PROTECTED]>
> > > wrote:
> > > >
> > > > Hello guys,
> > > >
> > > > I badly need your help.
> > > >
> > > > We have a report module that generates
> different
> > > types
> > > > of reports in pdf format. We used FPDF
> classes for
> > > > this.
> > > >
> > > > The problem is that when we try to generate
> one
> > > report
> > > > in one computer, a different pdf report is
> being
> > > > shown. I dont know if it has something to do
> with
> > > the
> > > > cache file in the server or version no. of
> the
> > > > browser.
> > > >
> > > > Report generation using other PC is working
> > > properly.
> > > >
> > > > What should I do? I need your help.... Thank
> you.
> > > >
> > > >
> > >
> >
>
__________________________________________________________
> > > > Be a better friend, newshound, and
> > > > know-it-all with Yahoo! Mobile. Try it now.
> > > >
> > >
> >
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > RJ David
> > > NetCon http://www.netcon.ph
> > > Sulit Community http://www.sulit.com.ph
> > >
> > >
> > > [Non-text portions of this message have been
> > > removed]
> > >
> > >
> >
> >
> >
> >
>
____________________________________________________________________________________
> > Be a better friend, newshound, and
> > know-it-all with Yahoo! Mobile. Try it now.
>
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
>
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ