Here's the Full Code. Iam trying to connect to a existing Crystal Report and save it as a excel file.
use Win32::ODBC;
use Win32::OLE;
$ex = Win32::OLE->new('CrystalRuntime.Application', sub {$_[0]->Quit;}
+) or die "Oops, cannot start Crystal";
$oReport = $ex->OpenReport ('C:\CrystalParameters\Myreportone.rpt', 1)
+ ;
$oReport->{'EnableParameterPrompting'} = 0 ;
$oexportoptions = $oReport->{'ExportOptions'} ;
#######set the Export Options to Export it to Excel file #############
+#####
$oexportoptions->{'FormatType'} = 36 ;
$oexportoptions->{'DestinationType'} = 1 ;
$oexportoptions->{'DiskFileName'} = 'c:\mytestreportone.xls' ;
#######################################################
$oReport->Export(0);
Edit: Added <code> tags. larsen
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|