Crystal Reports & PHP

Post Author: abarone
CA Forum: Other
Hi everybody,I would like to know if it's possible to use Crystal Reports with PHP.If it's possible, can you please provide me a sample code that shows how to pass parameters from the PHP page to my report.Thanks in advance.

Post Author: Ted Ueda
CA Forum: Other
There's no direct support for PHP. Crystal Reports XI Release 2 comes with three SDKs:  Report Designer Component (RDC) COM-based, CR.NET .NET-based, and Java Reporting Component (JRC), Java-based.RDC has been deprecated, and the JRC is now part of Crystal Reports for Eclipse.Crystal Reports 2008 comes with CR.NET.The SDKs haven't been tested when invoked via PHP or COM/.NET/Java connectors from PHP.If you have BusinessObjects Enterprise or Crystal Reports Server, an alternative is URL reporting, which allow you to invoke reports via constructing a URL to BusinessObjects web application deployed on IIS or a Java Web Application Server.Sincerely,Ted Ueda

Similar Messages

  • Crystal Reports - PHP issue

    Hello,
    I have the following code:
        $ds = odbc_exec($conn,$strSql);
        //------ Create a new COM Object of Crytal Reports 10 ------
        $ObjectFactory= new COM("CrystalReports11.ObjectFactory.1");
        //------ Create a instance of library Application -------
        $lib = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
        //------ Open your rpt file ------
        $creport = $lib->OpenReport($my_report, 1);
        $creport->ReportTitle = $repTitle;
    Which works on my development PC which has Visual Studio and Crystal Reports installed, however on a brand new installation on a windows 2003 server the code falls over and the creating an new COM object.
    Are there any SDK's or anything that needs to be installed on the webserver?

    Any suggestions?
    I am using Crystal Reports Developer 11.0.0.895. I have tried installing Crystal version 12, on the web server with no luck.

  • Crystal Reports from PHP using COM

    I have tried copying various snippets of PHP code to render a Crystal Report in PDF which I can then stream to the browser, but I never get past the creation of the CrystalRunTime.Application.  (Earlier examples had CrystalDesignRunTime.Application instead; they did not work either).  Any suggestions what is wrong here?
    $ObjectFactory= new COM("CrystalReports12.ObjectFactory.1") or die ("Error on load");
    echo "<p>ObjectFactory created.<p>About to create CrystalRunTime.Application...";
    try {
         $crapp = $ObjectFactory-> CreateObject("CrystalRunTime.Application");
    } catch (com_exception $e) {
         echo("Error on instance creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString());
         echo "<p>".$e;
         exit;
    Here is the output:
    ObjectFactory created.
    About to create CrystalRunTime.Application...Error on instance creation:
    Source: Unknown
    Description: Unknown
    #0 C:\xampp\htdocs\tempo\comtest.php(11): com->CreateObject('CrystalRunTime....') #1
    exception 'com_exception' with message 'Source: Unknown
    Description: Unknown' in C:\xampp\htdocs\tempo\comtest.php:11 Stack trace: #0 C:\xampp\htdocs\tempo\comtest.php(11): com->CreateObject('CrystalRunTime....') #1

    $ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
                   //------ Create a instance of library Application -------
                   try
                        $CRobj = $ObjectFactory->CreateObject("CrystalRunTime.Application.11");
                   catch (com_exception $e)
                        echo("<br>Error on instance creation:<br>".$e->getMessage().'<p>'.$e->getTraceAsString().'</p>');
                        echo "<p><pre>".print_r($e, true)."</pre></p>";
                        exit;
    Source: Unknown
    Description: Unknown
    #0 C:\xampp\htdocs\analytics\generate_cr.php(103): com->CreateObject('CrystalRunTime....') #1 {main}
    com_exception Object
        [message:protected] => Source: Unknown
    Description: Unknown
        [string:Exception:private] =>
        [code:protected] => -2147352567
        [file:protected] => C:\xampp\htdocs\analytics\generate_cr.php
        [line:protected] => 103
        [trace:Exception:private] => Array
                [0] => Array
                        [file] => C:\xampp\htdocs\analytics\generate_cr.php
                        [line] => 103
                        [function] => CreateObject
                        [class] => com
                        [type] => ->
                        [args] => Array
                                [0] => CrystalRunTime.Application.11
        [previous:Exception:private] =>
    Edited by: EddieM on Dec 9, 2009 9:34 PM

  • Crystal Reports and PHP

    Post Author: amyfletcher
    CA Forum: General
    I am working on an application for one of our clients in PHP and MySQL.  The client would like to utilize Crystal Reports to create some of the reports in the database.  I am not very familiar with Crystal Reports.  Can it work with PHP?  Is it fairly easy to integrate?  Would the user machines be required to have Crystal Reports installed on it or is there some sort of embedded viewer that we could use?  Please let me know.  Thanks!

    Post Author: halfer
    CA Forum: General
    Sorry Amy, these fora aren't exactly teeming with helpful respondents! I am using Crystal 9 and Crystal 10 with PHP, and it does work. You can install the Crystal Reports component on the server (it's on the developer disc, I presume it would come with the standard edition). You can then instantiate a Crystal object in PHP using the COM class, if you are using Windows.I have had problems (a) switching databases in reports based on stored procedures and (b) supplying date types in PHP to the Crystal COM object, so be aware that your mileage may vary. Do some R&D before committing yourself to a particular route (you can still use PHP, you may just need to create an external component to interface to Crystal).

  • How to use crystal report in php

    hello
    i need help for how to use crystal report for view the database report spacilly crosstab report i need it very much to complete my project ill be very thank full for help
    from farooq

    Hello sir
    i am sudeep and i need to deploy crstal reports in php
    i want to integrate it in sugar crm (open source project(
    can u plz tell me how to do it
    i have written this code
    <?php
    //echo phpinfo();exit;
    $ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
    $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
    //$crapp = new COM("CrystalRuntime.Application.10");
    $reportToRun="C:\Report4.rpt";
    $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);
    ?>
    thanks in advance

  • How to use crystal report with php

    Hello every body
    can any body know how to use crystal report with php any helping material, code or tutorial for my problem ill be very thankful for helping me
    farooq

    Hello sir
    i am sudeep and i need to deploy crstal reports in php
    i want to integrate it in sugar crm (open source project(
    can u plz tell me how to do it
    i have written this code
    <?php
    //echo phpinfo();exit;
    $ObjectFactory= New COM("CrystalReports11.ObjectFactory.1");
    $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
    //$crapp = new COM("CrystalRuntime.Application.10");
    $reportToRun="C:\Report4.rpt";
    $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);
    ?>
    thanks in advance

  • Crystal Report with PHP

    Hi, I am new to crystal report. I want to use CR 11 integrated with my web based application. Now as entire application is designed in PHP, I need to use PHP, use COM, to pass parameters and generate PDF report.
    I have following question.
    Will I need CR server ?
    How do i actually invoke CR from PHP ?
    Right now I am doing following
    $my_report = "C:
    Inetpub
    wwwroot
    test
    test.rpt";
    $my_pdf = "C:\Inetpub\wwwroot\test
    MyReport.pdf";
    try 
        $ObjectFactory = new COM ( 'CrystalRuntime.Application' ); 
    catch ( exception $e ) 
        echo 'caught exception: ' . $e->getMessage () . ', error trace: ' . $e->getTraceAsString (); 
    $crapp = $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
    $creport = $crapp->OpenReport($my_report, 1);
    $creport->Database->Tables(1)->SetLogOnInfo("server IP address", "db_name", "username", "password");
    $creport->EnableParameterPrompting = 0;
    $creport->DiscardSavedData;
    $creport->ReadRecords();
    $creport->FormulaFields->Item(1)->Text = ("'My Report Title'");
    $creport->ParameterFields(1)->AddCurrentValue ("FirstParameter");
    $creport->ParameterFields(2)->AddCurrentValue (2000);
    $creport->ExportOptions->DiskFileName=$my_pdf;
    $creport->ExportOptions->PDFExportAllPages=true;
    $creport->ExportOptions->DestinationType=1;
    $creport->ExportOptions->FormatType=31;
    $creport->Export(false);
    $creport = null;
    $crapp = null;
    $ObjectFactory = null;
    but i am getting following error
    caught exception: Failed to create COM object `CrystalRuntime.Application': Invalid syntax , error trace: #0 C:\Inetpub\wwwroot\cr_test.php(69): com->com('CrystalRuntime....') #1 Notice: Undefined variable: ObjectFactory in C:\Inetpub\wwwroot\cr_test.php on line 78 Fatal error: Call to a member function CreateObject() on a non-object in C:\Inetpub\wwwroot\cr_test.php on line 78
    I will appreciate any help provided in this matter

    Thank you. Ludek Uher
    Just after I posted my update, I realized that there was an error in version I am passing, i actually have version 14.0.0.760 RTM
    Now my code is like this
    $my_report = "C:\\MyReport.rpt";
    $my_pdf = "C:\\MyReport.pdf";
    try 
        $ObjectFactory = new COM ( 'CrystalReports14.ObjectFactory.1' ); 
    catch ( exception $e ) 
        echo 'caught exception: ' . $e->getMessage () . ', error trace: ' . $e->getTraceAsString (); 
    $crapp = $ObjectFactory->CreateObject("CrystalReports14.ObjectFactory.1");
    $creport = $crapp->OpenReport($my_report, 1);
    and it creating creating Crystal Reports object. Now the problem I am facing is that the method OpenReport() is not working.
    Does the RPT file mentioned in $my_report variable should exists when I run this code?
    The same question also goes for the PDF file I am mentioning in $my_pdf variable.

  • Crystal Reports - Problema ao gerar código de barras de boleto

    Boa tarde a todos! Preciso de um help.
    Desenvolvi o boleto de um cliente em Crystal Reports, mas estou encontrando um pequeno problema ao gerar determinados códigos. O número de código de barras é gerado corretamente pela DLL do BankSync. Até aí tudo bem.
    Eu tenho a fonte Interleaved 2 of 5 - Regular, que é composta por 3 aquivos .ttf, e duas DLLs (que são responsáveis por converter o número gerado pelo BS em símbolos, para que a fonte traga corretamente a seqüência de barras).
    Se eu tentar pegar o campo do B1 onde é gravado o número do código de barras (BarCodeNum) e colocar diretamente a fonte, naturalmente ele vai me trazer um código de barras errado, pois antes eu devo converter essa sequência numérica! Isso eu sei.
    Estou utilizando a seguinte fórmula para a conversão no Crystal (que fica disponível depois que eu instalo as DLLs):  BarcodeI2of5 (BarCodeNum) . Ela me traz como resultado uma seqüência de símbolos, que, ao colocá-la no corpo do documento e selecionar a fonte Interleaved 2 of 5 - Regular, ele me traz a sequência correta de barras!
    Exemplo:
    Número do código de barras: 03396517100000100009415546700000000002050005
    O que a DLL da fonte retorna com a fórmula: «$Hb2!!!*JXOg!!!!#&!&¬
    O código de barras sai perfeito e é lido por qualquer leitor ótico!
    MAS AFINAL, QUAL O PROBLEMA?
    Alguns caracteres provavelmente não estão disponíveis na fonte, ou a fórmula está gerando algum caractere que não deveria, que são:
    Ç   e   ¶    (por enquanto só identifiquei esses)
    E quando o resultado da fórmula traz esses caracteres em específico em alguma posição dela, o local onde ele deveria aparecer uma sequência de 5 barras, aparece aquele retângulo característico de quando a fonte não suporta algum acento ou caractere.
    Agora eu não sei o que está errado:
    - Ou a fórmula não deveria trazer de jeito nenhum os caracteres Ç e ¶ como resultado, e obviamente minha fonte não deveria suportá-los.
    - Ou a fórmula está correta e deve realmente trazer os caracteres Ç e ¶ como resultado e o problema está na minha fonte, que deveria suportá-los.
    Alguém já passou por este problema e pode me ajudar?
    Qual das duas possibilidades é o que está acontecendo comigo?
    Já tentei instalar outras DLLs e utilizar outras fontes, mas o problema persiste.
    Preciso saber se o erro está na conversão que a DLL faz ou se está na fonte.
    Quero deixar claro que isso não acontece em todos os boletos. É somente naqueles que a fórmula retorna os caracteres citados.
    Muito obrigada!
    Aline Garroux.

    Prezada Aline, boa tarde.
         Baixa a fonte disponível neste link: http://www.netfontes.com.br/dow.php?cod=3of9_barcode, após coloque o arquivo "3OF9_NEW" na pasta "C:\Windows\Fonts" a qual será instalada automaticamente.
    Espero ter auxiliado.

  • Printing Crystal report from web

    I am using crystal report 8.5 and Coldfusion MX 6.1
    I open my report in a blank page. Everything show up
    properly.
    However, in my report, I have 12 pages. When I print it it
    only show up as 1-2 pages. I notice that on screen, when I click
    next ( to go to the next page of the report ), the url show up as
    whatever my path is and the word "report" + the page -1 + htm
    eg. If I am on page 2 of the report, my url would be
    \\localhost\mywebfolder\report1.htm
    Anyone have the same problem? Any solution?
    * I am thinking of taking off the grouping in the report, see
    if that make any different!

    Hiya,
    It isn't clear how you are calling the report (cfreport,
    location, etc.,).
    With 8.5 professional and higher, there is report server; 8.5
    enforces the five instance connection license that the 8.0 version
    implied and the 7.0 version didn't have at all. This methodology
    allows for using the Crystal web report engine which supports the
    use of an ActiveX viewer or Java Viewer.
    I have an annoyance where an application that has run for
    more than five years using the ActiveX viewer used to run without
    prompting for database credentials but now does.
    Take a look here for some hints
    http://www.vordesigns.com/Portal/phpBB2/viewtopic.php?t=154
    I can send you the page cfm pages I use but it references a
    table of report names, you will have to do a little of your own
    debugging to get it to work in your enviroment.
    There is also a topic post in March from me
    http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=3&threadid=1137866 &forumid=1
    ... or is it one of my pseudonyms?

  • Creating crystal report file dynamically.

    Post Author: malcomstewart115
    CA Forum: General
    Hi, everybody.
    I have one problem.
    How to create crystal report file(*.rpt)  in php dynamically.
    I mean, I want to create the "*.rpt" file with php code.
    Please help me. thanks everybody.

    Post Author: PWilkens
    CA Forum: General
    It sounds like you're defeating the power and purpose of Crystal Reports, or replace it with pure PHP (which I suppose could be done... but why?)
    What exactly are you trying to do?
    If you're trying to make certain parts of the report hide or reveal or change depending on variables settings in the PHP file, that's easy enough to accomplish by sending parameters with your PHP values into the report.  But the dynamic actions really need to be done within the report itself, accomplished through ample use of the section and field settings provided within the Report Designer.

  • Crystal Report 9 - Can't Display UTF-8 Data

    Dear Sir,
    I am using PHP with Crystal Report 9.2 and has problem displaying UTF-8 data from MSSQL field. It shows weird characters instead. I am very sure the data stored in database is in UTF-8 because when I ouput it into the web browser with encoding as UTF-8, it shows correctly. Currently is using ADODB recordset to pass data into CR. I tried using ODBC to connect directly to database and preview the data - same issue.
    Now I wonder whether are there any settings need to be done in CR in order to display unicode correctly? From what I read, CR 9 and above should be able to support unicode.
    Thanks
    AL

    To be honest, I have no idea if TTX files supported UTF-8... I kinda doubt it. I'd check, but the only person I knwo of that may have a clue is not in until September 28...
    Re. ODBC, see if adding the following option to your DSN entry in the odbc.ini file will help:
    stmt = SET CHARACTER SET utf8
    Also, if I remember right, MS SQL does not install UTF-8 support by default (at least at one time or another it did not...(?).
    Oh - one more thing. I've attached a non CR app that I'd like you to use to see what the data it returns looks like. Please give that a try.
    - Ludek
    Edited by: Ludek Uher on Sep 7, 2011 10:43 AM

  • Crystal Reports-Issue

    Hi,
      When I am connecting to SAP-R/3 System through Crystal Reports, I could see only few tables. Most of the tables are not seen. What could be the reason behind this?
    Thanks.

    Hi,
    If i understand you correctly, you are connecting directly to the R/3 system, so it's very unlikely you will get a response in this forum (as we are mainly dealing with BW here).
    What i can suggest is the following:
    1. Can you make sure the user you specified in Crystal Reports has the required read permissions on all the tables you need?
    2. If this doesn't help - check the Business Objects forums (http://www.forumtopics.com/busobj/search.php and www.businessobjects.com)
    3. Ingo Hilgefort from Business Objects  normally answers questions related to the Crystal-BW integration in this forum. Maybe he can help, but i am sure you will manage to solve it by yourself.
    Assign points if useful,
    Gilad

  • Crystal Reports - Page Break/Create Address Labels

    Problem description:
    I am creating a letter writer function for a Windows application. The how-to documentation I have is not providing the necessary step(s) for showing one record per page.  From what I have gathered there is a page break function, however, I have not been able to implement it.   I have set up a Crystal report in a .Net 2008 (Visual Basic) application with a Section 5 (Page Footer) and need to break and start a new page at this point.  One page per letter (record) for multiple letter distributions.
    I also need specific instructions on how to create an address label maker for this application.  So far I was able to include a Crystal Reports form set up specifically for address labels but not to make it work.
    Since the application will be distributed this is not a machine specific issue.
    Jaime Baldovinos

    Hello,
    apart from the CR manual please see a [good guide |http://www.codeguru.com/forum/archive/index.php/f-64.html]for all kind of question related to report design with CR.

  • Unicode issues connecting Crystal Report to MySQL 5.0

    Post Author: Charles Wong
    CA Forum: Data Connectivity and SQL
    Hi,
    We are developing a web application by PHP 4.4.5, Crystal Report XI developer edition (English version), MySQL 5.0 and English Windows 2003 server.
    MySQL has been configured to store unicode values in all levels. In other words, connectivity, server itself, tables, etc are set to unicode.
    In the web browser, PHP can store and show special Portugues characters (e.g. çã), Chinese (both traditional and simplified) normally. In MySQL browser, all these values can be shown successfully.
    In Crystal Report, both Traditional and simplifed Chinese characters show as ???, however. The connection between Crystal Report and MySQL is throught MySQL ODBC 3.5.12 version.
    Does anybody know why? Any special setting needed in Crystal Report or in MySQL or in ODBC???

    Post Author: Charles Wong
    CA Forum: Data Connectivity and SQL
    Hi All,
    I'm replying myself.
    I read something in the Internet. Somebody said Windows and Crystal report use UCS-2 (or UTF-16?) as the unicode encoding scheme. In our the system, we set to UTF-8. Can this be a problem?

  • Problem in crystal reports

    Hello
    i have a problem in crystal report, i want to dispaly data from MYSql data base to crystal report through my application
    I have'nt work on crystall report before this
    please help me.....
    thanks in advance

    Some forums to try (or for someone who might land on this thread):
    http://www.bing.com/search?q=crystal+reports+forum
    http://forums.asp.net/76.aspx/1?Crystal+Reports
    http://www.crystalreportsbook.com/forum/default.asp
    http://scn.sap.com/community/crystal-reports-for-visual-studio/
    http://forums.codeguru.com/forumdisplay.php?64-Crystal-Reports
    Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

Maybe you are looking for

  • Extract an image which is only on opening screen

    A while back I chose an image of my cat to use on the opening screen of my iPhone. The cat is now dying and I would love to use that image in a multimedia program. But I no longer have the original image. Is there somewhere that the image is stored,

  • Satellite M100-165: message Network Cable Unplugged appears

    My NEW notebook TOSHIBA M100-165 /model PSMA1E/ with network adapter Intel 10/100 VM Network Adapter have big problem when connected to my office network!!! So many collisions I can see on my 3COM HUB /model TP800/. But this HUB is perfectly working

  • Why won't my computer allow to download windows updates?

    my computer can not download windows update.It keeps saying I am not connected to internet.

  • ITunes 7.0.1.8

    I had been having problems like many others with bad playback performance and sync issues since I upgraded to 7, and then 7.0.1. iTunes notified me of a new version update today, 7.0.1.8, downloaded and installed it, and all of my previous issues hav

  • Cant burn getting Error 4280 (Yes I have latest version)

    I was having this issue before I upgraded to the newest version and still seem to not be able to burn. I am getting Error 4280? There isnt much info on this to fix it it seems... I'm running Win7 64 Never had a problem before. Ideas to fix this?