How to using it in PHP?
Hello to you
I'm using VB6 with FastReport for COM/ActiveX
In VB6, I Write simple code as shown below :
Dim report As TfrxReport
Dim export As IfrxBuiltinExports
Private Sub Form_Load()
Set report = CreateObject("FastReport.TfrxReport")
End Sub
Private Sub Command1_Click()
report.LoadReportFromFile ("d:/rptmember.fr3")
report.PrepareReport (True)
Set export = report
export.ExportToPDF "d:/demo.pdf", False, False, False, False, "", ""
End Sub
The above code is work well in VB6
My questions is How to translate it into PHP?
I tried but still not works, as shown
<?php
$report= New COM("FastReport.TfrxReport");
$export= New COM("FastReport.TfrxDispatchableExports");
$report->LoadReportFromFile("d:/rptmember.fr3");
$report->PrepareReport(True);
Set export = report
$export->ExportToPDF("d:/demo.pdf", False, False, False, False, "", "");
$len = filesize("d:/demo.pdf");
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=d:/demo.pdf");
readfile("d:/demo.pdf");
?>
Please advice and correct my code
Thanks & Regards,
Steven
I'm using VB6 with FastReport for COM/ActiveX
In VB6, I Write simple code as shown below :
Dim report As TfrxReport
Dim export As IfrxBuiltinExports
Private Sub Form_Load()
Set report = CreateObject("FastReport.TfrxReport")
End Sub
Private Sub Command1_Click()
report.LoadReportFromFile ("d:/rptmember.fr3")
report.PrepareReport (True)
Set export = report
export.ExportToPDF "d:/demo.pdf", False, False, False, False, "", ""
End Sub
The above code is work well in VB6
My questions is How to translate it into PHP?
I tried but still not works, as shown
<?php
$report= New COM("FastReport.TfrxReport");
$export= New COM("FastReport.TfrxDispatchableExports");
$report->LoadReportFromFile("d:/rptmember.fr3");
$report->PrepareReport(True);
Set export = report
$export->ExportToPDF("d:/demo.pdf", False, False, False, False, "", "");
$len = filesize("d:/demo.pdf");
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=d:/demo.pdf");
readfile("d:/demo.pdf");
?>
Please advice and correct my code
Thanks & Regards,
Steven
Comments