Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8233729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:13:46+00:00 2026-06-07T18:13:46+00:00

I have a form that generates an SQL statement, based on the users choices.

  • 0

I have a form that generates an SQL statement, based on the users choices. It is functioning much like the report wizard in MS Access. On the last step, I have all the data, and the dynamically generated SQL query, but I need a way where they can download it as a file. How should I go about this?

Currently I have three buttons called
‘View Results’ (which just shows HTML generated results, that is easy – they just open up in a new tab)

‘Download CSV’ (preferably I would like this when clicked to just act like a normal download of a file, the user gets prompted to save as etc by the browser)

‘Download PDF’ (same as CSV)

At the moment when the CSV button is pressed a new tab opens up with export_report.php,
which outputs CSV style report data.

How can I achieve the desired results with the CSV and PDF button? I have all the data and information I need to generate either but I am unsure how to proceed forward with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:13:48+00:00Added an answer on June 7, 2026 at 6:13 pm

    For the generation of the PDF you could use fpdf witch allows you to build a pdf from php.

    For the generation of the CSV you only have to adjust the headers. Here is a link that explains how this works: csv generation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a factory method that generates django form classes like so: def get_indicator_form(indicator,
I have a form that generates an array of attribute objects. The attribute objects
I have a form that when submitted successfully generates new elements on the page
I have a create action for a form that potentially generates errors (i.e. first
I have an app that generates invoices in the form of PDF files stored
I have a form that sends a update sql piece of code to my
I have a charting application that dynamically generates SQL Server queries to compute values
The problem is that: In SQL Server,I have a SELECT statement that might take
I have a form that uses jquery to generate rows of input fields these
I have a form generator that makes all the dbEdits the same width. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.