<?php
set_time_limit(0);
$path = "C:\\wamp\\www\\Drainage\\Reports";
$file = "C:\\PartyName.pdf";
$app_obj = new COM("CrystalRuntime.Application") or Die ("Did not open");
$report= $path."\\PartyName.rpt";
com_load_typelib('CrystalDesignRunTime.Application');
$rpt_obj= $app_obj->OpenReport($report,1);
$rpt_obj->Database->Tables(1)->SetLogOnInfo("ServerName","DatabaseName","username","password");
$rpt_obj->SQLQuery = "SELECT PartyMaster.PartyName, PartyMaster.PropertyNo, PartyMaster.ConnectionNo FROM DatabaseName.dbo.PartyMaster Where PartyMaster.ConnectionNo='10916'";//Getting Error on this line
$rpt_obj->EnableParameterPrompting = true;
$rpt_obj->ExportOptions->DiskFileName = $file;
$rpt_obj->ExportOptions->PDFExportAllPages = true;
$rpt_obj->ExportOptions->DestinationType = 1;
$rpt_obj->ExportOptions->FormatType = 31;
$rpt_obj->Export(false);
$rpt_obj = NULL;
$app_obj = NULL;
header("Content-Type: application/pdf");
readfile($file);
unlink($file);
?>
If I comment the errored line I get default report but I want to use query string to get report.Just want to know is there ant other method to pass query string to crystal report.Any help in this matter would be appreciated.


