Hi.
I export data to Excel with PhpExcel or PhpSpreadsheet libraries. Works well with nuBuilder Pro. I want to do the same with nuBuilder Forte and I get an error. Why?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
nuBuilder Forte with PhpSpreadsheet
-
- Posts: 21
- Joined: Sat Feb 07, 2015 11:19 pm
nuBuilder Forte with PhpSpreadsheet
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: nuBuilder Forte with PhpSpreadsheet
Hi,
It's very hard to tell without knowing where and how you include the libraries and how you use them.
It's very hard to tell without knowing where and how you include the libraries and how you use them.
-
- Posts: 21
- Joined: Sat Feb 07, 2015 11:19 pm
Re: nuBuilder Forte with PhpSpreadsheet
Library include:
nuBuilder Home directory/Classes/PHPExcel (library directory)
In Builders-Procedure (nuBuilder Forte) and Code-PHP Procedures (nuBuilder Pro) write:
require_once dirname(__FILE__) . '/Classes/PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load("filename.xlsx");
$xlsName = 'filename1.xlsx';
$objPHPExcel->setActiveSheetIndex(0)->SetCellValue('A2', 'Test');
header("Content-Type:application/vnd.ms-excel");
header('Content-Disposition: attachment;filename="'.$xlsName.'"');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
Then Run Procedure. Works with nuBuilder Pro, does not work with nuBuilder Forte.
nuBuilder Home directory/Classes/PHPExcel (library directory)
In Builders-Procedure (nuBuilder Forte) and Code-PHP Procedures (nuBuilder Pro) write:
require_once dirname(__FILE__) . '/Classes/PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load("filename.xlsx");
$xlsName = 'filename1.xlsx';
$objPHPExcel->setActiveSheetIndex(0)->SetCellValue('A2', 'Test');
header("Content-Type:application/vnd.ms-excel");
header('Content-Disposition: attachment;filename="'.$xlsName.'"');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
Then Run Procedure. Works with nuBuilder Pro, does not work with nuBuilder Forte.
-
- nuBuilder Team
- Posts: 4307
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 448 times
- Contact:
Re: nuBuilder Forte with PhpSpreadsheet
You can add a
in the first line of the procedure and then check the nuDebug log to verify if the path to IOFactory.php is correct.
Code: Select all
nuDebug(dirname(__FILE__) . '/Classes/PHPExcel/IOFactory.php');
-
- Posts: 21
- Joined: Sat Feb 07, 2015 11:19 pm
Re: nuBuilder Forte with PhpSpreadsheet
The directory was created "classes". I changed the capitalization to lowercase and it works.
Thank you
Thank you