note 62721 added to ref.com
| From: | M dot F dot at osu1 dot php dot net | Date: | Wed, 08 Mar 2006 08:06:27 +0000 |
| Subject: | note 62721 added to ref.com | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-105029@lists.php.net to get a copy of this message | ||
I couldn't find much on Crystal Reports and COM's when I went to tackle it
so I thought a few lines of code here may help out anyone looking for where
to get started in the future.
$crapp = new COM("CrystalRuntime.Application.10");
$creport = $crapp->OpenReport($reportToRun, 1);
//reportToRun=full path to *.rpt file
$creport->Database->Tables->
Item(1)->ConnectionProperties['User ID'] = $user;
$creport->Database->Tables->
Item(1)->ConnectionProperties['Password'] = $pass;
//fomatType = integer 22=xls, 31=pdf etc
$creport->ExportOptions->FormatType = $formatType;
//type 1 is to output to a file I think 2 is email
$creport->ExportOptions->DestinationType = 1;
//location = full path to report output file
$creport->ExportOptions->DiskFileName = $location;
$creport->DiscardSavedData();
$creport->Export(False);
----
Server IP: 64.71.164.2
Probable Submitter: 129.223.79.35
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.com.php
Edit -- http://master.php.net/note/edit/62721
Del: integrated -- http://master.php.net/note/delete/62721/integrated
Del: useless -- http://master.php.net/note/delete/62721/useless
Del: bad code -- http://master.php.net/note/delete/62721/bad+code
Del: spam -- http://master.php.net/note/delete/62721/spam
Del: non-english -- http://master.php.net/note/delete/62721/non-english
Del: in docs -- http://master.php.net/note/delete/62721/in+docs
Del: other reasons-- http://master.php.net/note/delete/62721
Reject -- http://master.php.net/note/reject/62721
Search -- http://master.php.net/manage/user-notes.php