473,669 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Crystal report use in php?

57 New Member
hi

i use following codes. here crystal report open in pdf format.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php 
  3.  
  4. //- Variables - for your RPT and PDF 
  5. //echo "Print Report Test"; 
  6. $my_report = "D:\\Program Fiels\\xampp\\htdocs\\RPT\\RPT-list.rpt"; // 
  7. //rpt source file 
  8. $my_pdf = "D:\\Program Fiels\\xampp\\htdocs\\RPT\\RPT-list.pdf"; // RPT export to pdf file 
  9. //-Create new COM object-depends on your Crystal Report version 
  10. $ObjectFactory= new COM("CrystalReports10.ObjectFactory.1") or die ("Error on load"); // call COM port 
  11. $crapp = $ObjectFactory-> CreateObject("CrystalRuntime.Application.10"); // create an instance for Crystal 
  12. $creport = $crapp->OpenReport($my_report, 1); // call rpt report 
  13.  
  14. // to refresh data before 
  15.  
  16. //- Set database logon info - must have 
  17. $creport->Database->Tables(1)->SetLogOnInfo("servername", "username", "password", "databasename"); 
  18. //- field prompt or else report will hang - to get through 
  19. $creport->EnableParameterPrompting = 0; 
  20.  
  21. //- DiscardSavedData - to refresh then read records 
  22. $creport->DiscardSavedData; 
  23. $creport->ReadRecords(); 
  24.  
  25.  
  26. //export to PDF process 
  27. $creport->ExportOptions->DiskFileName=$my_pdf; //export to pdf 
  28. $creport->ExportOptions->PDFExportAllPages=true; 
  29. $creport->ExportOptions->DestinationType=1; // export to file 
  30. $creport->ExportOptions->FormatType=31; // PDF type 
  31. $creport->Export(false); 
  32.  
  33. //------ Release the variables ------ 
  34. $creport = null; 
  35. $crapp = null; 
  36. $ObjectFactory = null; 
  37.  
  38.  
  39.  
  40. ?> 
  41.  
  42.  
But i want to crystal report data open in web browser(ie). Crystal report parameter passing through php script. Is it Possible. Please help me.
Jun 17 '10 #1
3 23107
miltonlp
1 New Member
Hi,

I have the same problem, you got any solution?
Sep 21 '10 #2
naeemulhaq07
1 New Member
just add these line at the end

print "<embed src=\"C:\\xampp \\htdocs\\test. pdf\" width=\"100%\" height=\"100%\" >"
Nov 29 '22 #3
Vanisha
25 New Member
Crystal Reports is a popular reporting tool that allows users to create and design reports using various data sources. While it is primarily designed for use with Microsoft technologies, it is also possible to use Crystal Reports with PHP. Here's a high-level overview of how to use Crystal Reports in PHP:
Install Crystal Reports
Connect to a Data Source
Create a Report
Export the Report
Use the Report in PHP
Join PHP Online Course
Here are some additional resources to help you get started with using Crystal Reports in PHP:
Crystal Reports PHP Integration Guide
PHP Crystal Reports
Using Crystal Reports in PHP
Feb 15 '23 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
19161
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
7
4007
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
2
4926
by: Mythran | last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now they use the Root Namespace (VB) from the project. How can I extend the namespace for a single report (which will be set on all reports)? Thanks for any and all help, in advance :) Mythran
2
3888
by: Karun Karunakaran | last post by:
Hi, I am using the Crystal Enterprise .NET assemblies to generate and display a crystal report in a webform. This report connects to an SQL server (running locally) using a specific username and password. I use the InfoStore object to query for the report from the CE server (also running locally) and bind it to the CrystalReportViewer control in the webform. I am getting an "SQL Server logon failed" when I try to generate this
1
3072
by: bthomas71chevy | last post by:
I have just setup a WebServer and all the applications work fine, but when every any of the applications try to generate a Crystal Report the page errors out. "File or assembly name CrystalKeyCodeLib, or one of its dependencies, was not found." I read that the 4 MSM files need to be moved to the a MERGE MODULES folder in the Common Files folder, but didn't seem to do a thing.
2
3065
by: aldous scotch | last post by:
I designed a Crystal Report .rpt from within Microsoft Development Environment 2003 Version 7.1.3088 (VB .NET IDE). I selected database fields from the left side Field Explorer onto the Details (Section3) of the .rpt. Also, I added a new web form myWebform.aspx and a web object CystalReportViewer - CrystalReportViewer1 and had a code behind in ReportSource
0
1673
by: Ray | last post by:
Dear all, I have some questions about the Crystal Report and vb.net 2003. 1. I have installed the crystal report 10 and vs.net 2003. Should I update the crystal report within the vb.net so as to use crystal report 10? Which is better for using the program crystal report 10 or the crystal report within the vb.net to construct the report? 2. Is there any difference for deploying the window application for using crystal report 10 or the...
2
7238
by: Jason Huang | last post by:
Hi, The Crystal Report bundled with .Net 2003 is version 9. How do I update the Crystal Report V9 in my .Net 2003 to Version 11 so that whenever I open a .rpt file in my VS 2003, the Crystal Report V11 will come out? Thanks for help. Jason
0
2966
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the report directly to the printer bypassing the Crystal report viewer altogether. When sending the job directly to the printer I use the PrintToPrinter command CR.PrintToPrinter(1, False, 0, 0)
11
9679
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.