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 6981497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:09:54+00:00 2026-05-27T18:09:54+00:00

hello i am using joomla and i am trying to create an option that

  • 0

hello i am using joomla and i am trying to create an option that the user will be able to download a csv or excel file of the table that is currently presented.

i am trying to use PHPExcel for the creation of the file.
I have created an export.php file:

    {
    $objXLS = new PHPExcel();

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=File.xls"); 
header("Content-Transfer-Encoding: binary ");


    $objSheet = $objXLS->setActiveSheetIndex(0);
    //$objSheet->setCellValue(cell, value);
    $objSheet->setCellValue('A1', '1');
    $objSheet->setCellValue('A2', '2');
    $objSheet->setCellValue('A3', '3');
    $objSheet->setCellValue('A4', '4');
    $objSheet->setCellValue('A5', '5');


    $objSheet->setCellValue('B5', date('H:i:s'));

    $objXLS->getActiveSheet()->getColumnDimension("A")->setAutoSize(true);
    $objXLS->getActiveSheet()->getColumnDimension("B")->setAutoSize(true);

    $objXLS->getActiveSheet()->setTitle('Test Stats');

    $objXLS->setActiveSheetIndex(0);


    $objWriter = PHPExcel_IOFactory::createWriter($objXLS, 'Excel5');
    //$objWriter->save('php://output');
    exit;

}
}

the file gets the info of the table, inserts it into an excel sheet and outputs it to download but i am not able to access this file due to the joomla restrictions.

when i try to input the code to my model and call it the file that comes out is the entire page or the file is printed in the site page as garbage.

how do grante access to this file so i can open it in a new tab or something.
or is there a simpler way to export this information to an excel file or csv using AJAX or Jquery?

thank you

  • 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-05-27T18:09:55+00:00Added an answer on May 27, 2026 at 6:09 pm

    Your problem most likely is that the Joomla framework will output some additional HTML which is not needed for this special case; I think what you’re trying to do is pretty similar to what was asked in this question. The gist is that you have to create your own action in your controller, and using and additional format=raw parameter in your URL.

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

Sidebar

Related Questions

Hello i am using NSOperationQueue to download images in the background. I have created
Hello I am trying to setup a Padrino project using DataMapper and MySQL on
I'm just trying to compile the hello world example of boost.python WITHOUT using all
Hello I'm using the fullcalendar jQuery plugin to create a calendar app. When I
Hello I am using an android application and I am trying to figure out
I'm trying to build a hello world using GTK, which includes the line: #include
Hello I am using facebook graph api..and trying to display comments of each post..But
Hello i am using following xml to create some sort of Transparent panel .
Hello I am using Wamp Server 2.0 and trying to instal pear . When
Am trying out Ruby on Rails in Windows XP using the Hello World example.

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.