Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,005 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,375 people online right now. Registration is fast and FREE... Join Now!




PHP with Crystal Report help

 
Reply to this topicStart new topic

PHP with Crystal Report help

jalakhijau
12 Mar, 2008 - 02:16 AM
Post #1

New D.I.C Head
*

Joined: 12 Mar, 2008
Posts: 1

Hai master..

I have problem with this php code

i want to create a pdf file from crystal report which is connected to mssql database.
currently i set no password into database.

CODE

$my_report     = 'C:\inetpub\wwwroot\Report\myreport.rpt';
$my_pdf     = 'C:\inetpub\wwwroot\Report\myreport.pdf';
$webpath     = 'http://localhost/report/myreport.pdf';

$ObjectFactory    = New COM("CrystalReports.ObjectFactory.2");
$crapp         = $ObjectFactory->CreateObject("CrystalRuntime.Application.9");
$crapp->LogOnServer('crdb_ado.dll','myserver','mydatabase','myuser','mypassword');
$creport     = $crapp->OpenReport($my_report, 1);

$creport->ExportOptions->DiskFileName=$my_pdf;
$creport->ExportOptions->PDFExportAllPages=true;
$creport->ExportOptions->DestinationType=1;
$creport->ExportOptions->FormatType=31;
$creport->Export(false);


the problem is :
if i leave mypassword blank it's work
but, if i set a password its error.

anyone can help??
please advice.

*edit* code.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 12:45PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month