Results 1 to 6 of 6

Thread: Printing invoices and reports from website

  1. #1

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Question Printing invoices and reports from website

    Hi guys

    In my PHP application, I have to allow the user to take the printout of invoices and reports.

    Two options that I found are:
    • display the report/invoice in a html page with no fancy stuff and properly ordered and thus user could print the page from the browser itself
    • compose a PDF(dynamically) for the invoice/report and allow the user to download it and then print it.


    Among them, which one is the better option ? Any pros and cons ?
    Or any better solutions that you know ?

    Thanks in advance..

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Printing invoices and reports from website

    I am doing the "first" option already - that works well.

    I'm trying to get the "second" option working myself - using PDF-driver's on the server as "print devices" from my web services. Having many problems - still can't find the proper PDF-driver to use...

    What have you done? Which choice did you go with?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Printing invoices and reports from website

    Thanks

    But I haven't selected the best option yet. Trying to figure out whether there is any cross-browser solution in Sourceforge or somewhere else.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: Printing invoices and reports from website

    Have tried both and prefer the first option myself as both a developer and a user. From the development side, it's more straightforward and easier to implement. It doesn't have to be boring, either - you can still create an aesthetically pleasing layout (be sure to specify a print stylesheet and test it). As a user, the information is more accessible than when it's in a PDF, it loads incomparably faster, and if I want a PDF, I'll make one myself.

    But I've gone the PDF route for clients who want more meticulous control over the appearance of the output. For that I've used FPDF to create the file and served it as an attachment; this works fine cross-browser. Development takes longer as it can be hard to predict how the output will render, so I found myself editing and re-checking a lot.
    Last edited by SambaNeko; Mar 19th, 2012 at 12:21 PM.

  5. #5
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Printing invoices and reports from website

    I would print from a PDF because if the document isn't displayed as it would be in portrait view in Word then could encounter problems when printing it. That is if you haven't already overcome those difficulties?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  6. #6

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Printing invoices and reports from website

    Quote Originally Posted by SambaNeko View Post
    Have tried both and prefer the first option myself as both a developer and a user. From the development side, it's more straightforward and easier to implement. It doesn't have to be boring, either - you can still create an aesthetically pleasing layout (be sure to specify a print stylesheet and test it). As a user, the information is more accessible than when it's in a PDF, it loads incomparably faster, and if I want a PDF, I'll make one myself.

    But I've gone the PDF route for clients who want more meticulous control over the appearance of the output. For that I've used FPDF to create the file and served it as an attachment; this works fine cross-browser. Development takes longer as it can be hard to predict how the output will render, so I found myself editing and re-checking a lot.
    Thanks

    Then I think, I should follow the common practice of allowing the user to print from the browser itself.

    @All: Do you guys have any suggestions or "do's and don'ts" for this. Or any useful guide or manual for this ? If there are rules or guidelines(already followed by all), it would be easy.


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width