php-windows Digest 23 Dec 2011 01:26:06 -0000 Issue 3994
Topics (messages 30753 through 30755):
default domain name
30753 by: Vinay Kannan
30754 by: Ferenc Kovacs
Re: PHP and Crystal Reports
30755 by: luhana
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hello,
I need your help on something, i am developing an application, and there
are couple of modules where i need to provide the entire link of the domain
along with the sub dirs.
So i was wondering what is the way, to provide the default domain name
which will work on any domain.
for ex : if the file is lib/test.php, then a way to call it should be the
same if the domains are www.abc.com or www.xyz.com or any other domain.
something like the dirname, basename etc...
but i haven't had much luck on the same, any ideas?
Thanks,
--- End Message ---
--- Begin Message ---
On Fri, Dec 16, 2011 at 2:28 PM, Vinay Kannan <viny...@gmail.com> wrote:
> Hello,
>
> I need your help on something, i am developing an application, and there
> are couple of modules where i need to provide the entire link of the domain
> along with the sub dirs.
> So i was wondering what is the way, to provide the default domain name
> which will work on any domain.
>
> for ex : if the file is lib/test.php, then a way to call it should be the
> same if the domains are www.abc.com or www.xyz.com or any other domain.
> something like the dirname, basename etc...
>
> but i haven't had much luck on the same, any ideas?
>
> Thanks,
>
if you are looking for getting the domain for the current request, you
should use $_SERVER['HTTP_HOST'], you can also use relative and urls for
linking content from the same domain (
http://www.w3.org/TR/html4/types.html#type-uri )
--
Ferenc Kovács
@Tyr43l - http://tyrael.hu
--- End Message ---
--- Begin Message ---
Dear Sir
I am getting error
Fatal error: Class 'registryDatabaseLocations' not found in
C:\wamp\www\cc3.php on line 19
please guide
Richard Quadling wrote:
>
> 2009/4/30 John Messam <johnm...@hotmail.com>:
>>
>> I am trying to write a php program that opens a number of reports written
>> in Crystal 11. From research on the internet, I found that CR would have
>> to be called using COM. So I did that. From the command line it triggers
>> a dialog box saying that the version of Crystal the reports was written
>> in was later than the one that is being used to open it via the php
>> program. The other problem is that when it is run from the browser the
>> program hangs on the openReport command
>>
>>
>>
>> Can anyone assist me on resolving the hanging issue or the entire thing
>> for that matter.
>>
>>
>>
>> Thanks!
>>
>>
>>
>> John
>>
>> _________________________________________________________________
>> Show them the way! Add maps and directions to your party invites.
>> http://www.microsoft.com/windows/windowslive/products/events.aspx
>
> I use Crystal all day and via PHP also.
>
> Here is the code I use (edited). It might not be perfect, but it works
> perfectly.
>
> <?php
> // Create an Crystal Object Factory.
> $o_CrObjectFactory = new COM('CrystalReports11.ObjectFactory.1');
>
> // Create the Crystal Reports Runtime Application.
> $o_CrApplication =
> $o_CrObjectFactory->CreateObject("CrystalRunTime.Application.11");
>
> // Register the typelibrary.
> com_load_typelib('CrystalDesignRunTime.Application');
>
> // Load the report.
> $o_CrReport = $o_CrApplication->OpenReport('C:\Report.rpt', 1); // 1
> == crOpenReportByTempCopy.
>
> // Logon to the database.
> $o_CrReport->Database->LogOnServer
> (
> 'odbc',
> 'Accounts',
> registryDatabaseLocations::Database('Accounts'),
> registryDatabaseLocations::Username('Accounts'),
> registryDatabaseLocations::Password('Accounts')
> );
>
> // Don't tell anyone what is going on when running live.
> $o_CrReport->DisplayProgressDialog = False;
>
> $s_ExportedReport = 'C:\Report.pdf';
>
> // Run the report and save the PDF to disk.
> $o_CrReport->ExportOptions->DiskFileName = $s_ExportedReport;
> $o_CrReport->ExportOptions->PDFExportAllPages = True;
> $o_CrReport->ExportOptions->DestinationType = 1; // Export to File
> $o_CrReport->ExportOptions->FormatType = 31; // 31 = PDF, 36 = XLS, 14 =
> DOC
>
> // Assign the parameters to the report.
> $m_Stuff = new Variant();
>
> $o_CrPeriodsParam =
> $o_CrReport->ParameterFields->GetItemByName('PeriodIDs', $m_Stuff);
> $o_CrPeriodsParam->ClearCurrentValueAndRange();
>
> foreach($_SESSION['tabRG_PeriodIDs'] as $i_Period)
> {
> $o_CrPeriodsParam->AddCurrentValue(intval($i_Period));
> }
>
> $o_CrReport->ReadRecords();
> $o_CrReport->Export(False);
> ?>
>
>
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
> "Standing on the shoulders of some very clever giants!"
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
View this message in context:
http://old.nabble.com/PHP-and-Crystal-Reports-tp23308716p33026407.html
Sent from the Php - Windows mailing list archive at Nabble.com.
--- End Message ---