Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

nuBuilder Forte with PhpSpreadsheet

Questions related to using nuBuilder Forte.
Post Reply
Arunas
Posts: 21
Joined: Sat Feb 07, 2015 11:19 pm

nuBuilder Forte with PhpSpreadsheet

Unread post by Arunas »

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?
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: nuBuilder Forte with PhpSpreadsheet

Unread post by kev1n »

Hi,

It's very hard to tell without knowing where and how you include the libraries and how you use them.
Arunas
Posts: 21
Joined: Sat Feb 07, 2015 11:19 pm

Re: nuBuilder Forte with PhpSpreadsheet

Unread post by Arunas »

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.
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: nuBuilder Forte with PhpSpreadsheet

Unread post by kev1n »

You can add a

Code: Select all

nuDebug(dirname(__FILE__) . '/Classes/PHPExcel/IOFactory.php');
in the first line of the procedure and then check the nuDebug log to verify if the path to IOFactory.php is correct.
Arunas
Posts: 21
Joined: Sat Feb 07, 2015 11:19 pm

Re: nuBuilder Forte with PhpSpreadsheet

Unread post by Arunas »

The directory was created "classes". I changed the capitalization to lowercase and it works.

Thank you
Post Reply