php crystal report
Publicado por Milton (1 intervención) el 18/10/2013 20:32:16
Hola estoy haciendo reportes con crystal report y php pero al momento de pasar los parametros "fechas" a crystal report me manda un error ya probe muchas obsiones pero no resultan por favor si alguien podria ayudarme.......
//------ Variables ------
$my_report = "C://creporteOTOS.rpt"; //This must be the full path to the file
$my_pdf = "C://reporte.pdf";
//------ Create a new COM Object of Crytal Reports 10 ------
$ObjectFactory= new COM("CrystalReports.ObjectFactory");
//------ Create a instance of library Application -------
$crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
//------ Open your rpt file ------
$creport = $crapp->OpenReport($my_report, 1);
//------ Set database logon info ------
$creport->Database->Tables(1)->SetLogOnInfo("******", "******", "****", "*******");
//------ Suppress the Parameter field prompt or else report will hang ------
$creport->EnableParameterPrompting = 0;
//------ DiscardSavedData make a Refresh in your data -------
$creport->DiscardSavedData;
$creport->ReadRecords();
//------ Pass formula fields --------
//$creport->FormulaFields->Item(1)->Text = ("'My reporte milton usca'");
$creport->ParameterFields(1)->AddCurrentValue ('01/04/2013'); //aqui empieza el error
$creport->ParameterFields(2)->AddCurrentValue ('10/04/2013');
// $zz = $creport->ParameterFields(1)->SetCurrentValue( intval( $param, 10) );
//------ Export to PDF -------
$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->FormatType=31;
$creport->ExportOptions->DestinationType=1;
$creport->Export(false);
//------ Release the variables ------
$creport = null;
$crapp = null;
$ObjectFactory = null;
//------ Embed the report in the webpage ------
print "<embed src=\"MyReport.pdf\" width=\"100%\" height=\"100%\">"
este es el error que me bota :
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> <br/><b>Description:</b> No se puede mover porque el conjunto de filas est� vac�o.' in C:\xampp\htdocs\www\helpdesk\contenido\pcr.php:133 Stack trace: #0 C:\xampp\htdocs\www\helpdesk\contenido\pcr.php(133): variant->AddCurrentValue('01/04/2013') #1 {main} thrown in C:\xampp\htdocs\www\helpdesk\contenido\pcr.php on line 133
//------ Variables ------
$my_report = "C://creporteOTOS.rpt"; //This must be the full path to the file
$my_pdf = "C://reporte.pdf";
//------ Create a new COM Object of Crytal Reports 10 ------
$ObjectFactory= new COM("CrystalReports.ObjectFactory");
//------ Create a instance of library Application -------
$crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
//------ Open your rpt file ------
$creport = $crapp->OpenReport($my_report, 1);
//------ Set database logon info ------
$creport->Database->Tables(1)->SetLogOnInfo("******", "******", "****", "*******");
//------ Suppress the Parameter field prompt or else report will hang ------
$creport->EnableParameterPrompting = 0;
//------ DiscardSavedData make a Refresh in your data -------
$creport->DiscardSavedData;
$creport->ReadRecords();
//------ Pass formula fields --------
//$creport->FormulaFields->Item(1)->Text = ("'My reporte milton usca'");
$creport->ParameterFields(1)->AddCurrentValue ('01/04/2013'); //aqui empieza el error
$creport->ParameterFields(2)->AddCurrentValue ('10/04/2013');
// $zz = $creport->ParameterFields(1)->SetCurrentValue( intval( $param, 10) );
//------ Export to PDF -------
$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->FormatType=31;
$creport->ExportOptions->DestinationType=1;
$creport->Export(false);
//------ Release the variables ------
$creport = null;
$crapp = null;
$ObjectFactory = null;
//------ Embed the report in the webpage ------
print "<embed src=\"MyReport.pdf\" width=\"100%\" height=\"100%\">"
este es el error que me bota :
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> <br/><b>Description:</b> No se puede mover porque el conjunto de filas est� vac�o.' in C:\xampp\htdocs\www\helpdesk\contenido\pcr.php:133 Stack trace: #0 C:\xampp\htdocs\www\helpdesk\contenido\pcr.php(133): variant->AddCurrentValue('01/04/2013') #1 {main} thrown in C:\xampp\htdocs\www\helpdesk\contenido\pcr.php on line 133
Valora esta pregunta


0