12 Replies - 3575 Views - Last Post: 11 November 2015 - 03:24 AM Rate Topic: -----

#1 R. Gregorio   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-November 15

Converting crystal report into pdf using php

Posted 09 November 2015 - 07:47 PM

I have a project. This should be a php page where you input data and then save it into a temporary table in mysql. After saving this should be viewed and be printable. :(

My question is, how can i convert the crystal report into pdf using php where my data that the user inputted is saved on my temporary table in stored procedure and then (via button) can be printed or viewed before printing (viewed in the same page in php) -_-

I hope someone out there can give me some advice or enlighten me about this problem.

Thank you in advance for the answer. :helpsmilie:

This post has been edited by Atli: 09 November 2015 - 08:49 PM
Reason for edit:: Removed the unreadable font.


Is This A Good Question/Topic? 0
  • +

Replies To: Converting crystal report into pdf using php

#2 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Converting crystal report into pdf using php

Posted 09 November 2015 - 09:00 PM

You're not making sense. Or, at least, you're missing some steps in your description.

First you tell us people are supposed to enter info and it is to be saved in a MySQL DB.

Then all of a sudden you're converting a Crystal Report into a PDF?
Where did the Crystal Report come from?


Generating PDFs from MySQL data is simple enough. There are plenty of libraries out there that can help you do that, like TCPDF and FPDF. You can also use things like wkhtmltopdf to build PDFs from HTML, using libraries like Snappy. (I'd recommend that, unless you need pixel perfect layouts. Far simpler to use.)
Was This Post Helpful? 0
  • +
  • -

#3 R. Gregorio   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-November 15

Re: Converting crystal report into pdf using php

Posted 09 November 2015 - 10:15 PM

Sorry. :dontgetit: I'm new to this kind of programming level. So please have patience with me. :sad2:

This should be the cycle.

User input data ->

Save and then stored in a temporary table in stored procedure ->

The save Data should be viewable to in php page (should have a choice to print or edit)
then to view the viewable php page i thought i could convert the crystal report (crystal report that i use to save the inputted data by the user) to pdf that will produce the print method. :hang:

This post has been edited by Atli: 09 November 2015 - 10:34 PM
Reason for edit:: Removed the double post.

Was This Post Helpful? 0
  • +
  • -

#4 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Converting crystal report into pdf using php

Posted 09 November 2015 - 10:48 PM

The thing there that is confusing matters is the use of Crystal Reports.

As far as I know, this is a Windows-only thing that is not exactly compatible with PHP (on any platform.) You could probably jury rig something together, but I wouldn't really advice it.

In the context of "PHP-MySQL" development, I wouldn't be using that tool. You'd be better of using PHP by itself to compile the reports, based on the MySQL data directly.
Was This Post Helpful? 0
  • +
  • -

#5 R. Gregorio   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-November 15

Re: Converting crystal report into pdf using php

Posted 09 November 2015 - 11:24 PM

View PostAtli, on 09 November 2015 - 10:48 PM, said:

The thing there that is confusing matters is the use of Crystal Reports.

As far as I know, this is a Windows-only thing that is not exactly compatible with PHP (on any platform.) You could probably jury rig something together, but I wouldn't really advice it.

In the context of "PHP-MySQL" development, I wouldn't be using that tool. You'd be better of using PHP by itself to compile the reports, based on the MySQL data directly.


Is it possible to view and print the data on my stored procedure without using crystal report and directed it on a pdf file or at least put it print the inputted data? :sad3: :wacko: :unsure: f:

My project is like a receipt? user input the data then they have an option to print it or just viewed it. :( :dead:

By the way thank you for making it clear for me. :blush:
Was This Post Helpful? 0
  • +
  • -

#6 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Converting crystal report into pdf using php

Posted 09 November 2015 - 11:55 PM

Sure, that's possible. Any language like PHP can be used to fetch data from a database and print it in whatever format you need. (HTML, PDF, Excel, etc...)
Was This Post Helpful? 0
  • +
  • -

#7 R. Gregorio   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-November 15

Re: Converting crystal report into pdf using php

Posted 10 November 2015 - 12:14 AM

View PostAtli, on 09 November 2015 - 11:55 PM, said:

Sure, that's possible. Any language like PHP can be used to fetch data from a database and print it in whatever format you need. (HTML, PDF, Excel, etc...)

by the means of "print" i mean really print it. my project is a receipt so i have to be able to print the inputted data. is it possible to print the data on my stored procedure? (converted into pdf file) and could you please give me an example? Thank you so much. :angel:
Was This Post Helpful? 0
  • +
  • -

#8 R. Gregorio   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-November 15

Re: Converting crystal report into pdf using php

Posted 10 November 2015 - 01:46 AM

Can anyone please help me? :helpsmilie: I'm new to this kind of programming level so, Please? :pinch: Have patience with me. :death:

I have this project where the user input data and then save it in a temporary table via stored procedure. After saving, the user have a choice to view or print the saved data. Can someone help me? Is it possible to call the crystal report (where my stored procedure is generated to a report) to my php file? and then export it into PDF file? Or any other recommendation? :( :surrender:

I really hope someone out there can answer me or at least give me some advice? or maybe guide me even.Thank you in advance. :ohno: :cry2: :wacko:
Was This Post Helpful? 0
  • +
  • -

#9 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: Converting crystal report into pdf using php

Posted 10 November 2015 - 04:02 AM

Merged duplicate topics.
Was This Post Helpful? 0
  • +
  • -

#10 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Converting crystal report into pdf using php

Posted 10 November 2015 - 04:41 AM

I get the feeling your programming knowledge is at a very basic level. Am I right?
How well do you know development? Have you ever worked on any significant development?


Nobody here is going to write this code for you. In fact, given how little we know about the specifics, we really couldn't write it even if we were so inclined.

You need somebody who knows how to write the code you need, and who has access to the database and other details about the project. If you don't have the development skill to do that, and don't have the time or willingness to learn it, then I suggest you hire somebody.
Was This Post Helpful? 1
  • +
  • -

#11 R. Gregorio   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 09-November 15

Re: Converting crystal report into pdf using php

Posted 11 November 2015 - 01:08 AM

But sir, is it possible to use a stord procedure on a fpdf? on showing my saved data on my pdf?

I'm sorry. Please have patience with me. I just want to learn. :cry2:/>

This post has been edited by Dormilich: 11 November 2015 - 02:04 AM

Was This Post Helpful? 0
  • +
  • -

#12 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4278
  • View blog
  • Posts: 13,573
  • Joined: 08-June 10

Re: Converting crystal report into pdf using php

Posted 11 November 2015 - 02:06 AM

FPDF doesn’t care where and how PHP gets the data.
Was This Post Helpful? 0
  • +
  • -

#13 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4241
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Converting crystal report into pdf using php

Posted 11 November 2015 - 03:24 AM

If you want to learn, the first thing you need to do is understand the basics of the technologies you are dealing with. Based on your questions, it's very clear that you do not. - It doesn't really make sense to be asking questions this far above your knowledge level; any answers we give aren't likely to even make sense until you know the basics.

You need to study how MySQL and PHP work. I suggest finding a good beginners book somewhere, or go through some online tutorials. Once you've done that, answers to questions, such as the one you just asked, will become quite clear.


This is basically how all PHP development works: PHP gets data from a data source (usually a database), and uses it to generate output. Usually we are talking about MySQL as the data source, and HTML as the output. - In your case, PHP would be getting data from MySQL (via a Stored Procedure, or whatever else method you want to use, it makes no difference) and then uses the FPDF library to generate PDF as output.

If you want to understand this in more detail - or try to write code to make this happen - study the basics first.


P.S.
Having experienced both of them, I'd recommend TCPDF over FPDF. I found it less annoying to deal with, not that either of them are exactly a joy to work with. - WKHTMLTOPDF, and the like, are a lot less annoying, as they only require you to generate HTML, which is then turned into the PDF. Downside is that the layouts may not be as precise, as the HTML-to-PDF conversion is a bit twitchy.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1