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.
Saving report as a pdf
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore
-
- nuBuilder Team
- Posts: 506
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 8 times
- Been thanked: 18 times
Re: Saving report as a pdf
@treed, is it OK with mailing reports now? do you need something more?
If you like nuBuilder, please leave a review on SourceForge
Re: Saving report as a pdf
Ok, found it. The new column was added during the update. However the update seems to have broken one of my reports. There was no change to this report and the column Title is only in the query once.
0] :
===USER==========
globeadmin
===PDO MESSAGE===
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'title'
===SQL===========
ALTER TABLE ___nu160216e359647c___ ADD `USER_ID` VARCHAR(5) DEFAULT 'admin' , ADD `HOME_ID` VARCHAR(6) DEFAULT 'nuhome' , ADD `GLOBAL_ACCESS` VARCHAR(1) DEFAULT '1' , ADD `form_id` VARCHAR(15) DEFAULT '5f7ba6100209806' , ADD `redirect_form_id` VARCHAR(15) DEFAULT '5f7ba6100209806' , ADD `record_id` VARCHAR(15) DEFAULT '5f7b6c61a3ee10a' , ADD `title` VARCHAR(22) DEFAULT 'Parameters for CallRpt' , ADD `call_type` VARCHAR(9) DEFAULT 'getreport' , ADD `column_widths` VARCHAR(1) DEFAULT '0' , ADD `iframe` VARCHAR(1) DEFAULT '0' , ADD `object_id` VARCHAR(1) DEFAULT '1' , ADD `page_number` VARCHAR(1) DEFAULT '0' , ADD `rows` VARCHAR(2) DEFAULT '20' , ADD `row_height` VARCHAR(2) DEFAULT '18' , ADD `session_id` VARCHAR(15) DEFAULT 's16128036225934' , ADD `sort` VARCHAR(2) DEFAULT '-1' , ADD `sort_direction` VARCHAR(4) DEFAULT 'desc' , ADD `subforms` VARCHAR(1) DEFAULT '0' , ADD `refreshed` VARCHAR(1) DEFAULT '0' , ADD `CLONED_RECORD` VARCHAR(1) DEFAULT '0' , ADD `NEW_RECORD` VARCHAR(1) DEFAULT '0' , ADD `browse_sql` VARCHAR(1) DEFAULT '0' , ADD `browse_rows` VARCHAR(1) DEFAULT '0' , ADD `browse_table_id` VARCHAR(22) DEFAULT '___nu160216e2f010b3___' , ADD `browse_filtered_rows` VARCHAR(1) DEFAULT '0' , ADD `form_code` VARCHAR(13) DEFAULT 'CallRptParams' , ADD `form_description` VARCHAR(22) DEFAULT 'Parameters for CallRpt' , ADD `form_type` VARCHAR(6) DEFAULT 'launch' , ADD `run_code` VARCHAR(7) DEFAULT 'CallRpt' , ADD `run_description` VARCHAR(11) DEFAULT 'Call Report' , ADD `UserID` VARCHAR(15) DEFAULT '5f4e75df8041193' , ADD `datFrom` VARCHAR(10) DEFAULT '2021-02-01' , ADD `nuDelete` VARCHAR(1) DEFAULT '0' , ADD `PREVIOUS_RECORD_ID` VARCHAR(15) DEFAULT '5f7b6c61a3ee10a' , ADD `SUBFORM_ID` VARCHAR(1) DEFAULT '1' , ADD `TABLE_ID` VARCHAR(22) DEFAULT '___nu160216e359647c___' , ADD `description` VARCHAR(11) DEFAULT 'Call Report' , ADD `parentID` VARCHAR(19) DEFAULT 'SQL:5f7b42b3f373e42' , ADD `nuInstall` VARCHAR(1) DEFAULT '0' , ADD `nu_date_time` VARCHAR(19) DEFAULT '2021-02-08 09:00:37' , ADD `nu_date` VARCHAR(10) DEFAULT '2021-02-08' , ADD `nu_time` VARCHAR(8) DEFAULT '09:00:37' , ADD `nu_year` VARCHAR(4) DEFAULT '2021' , ADD `nu_month` VARCHAR(2) DEFAULT '02' , ADD `nu_day` VARCHAR(2) DEFAULT '08' , ADD `nu_hour` VARCHAR(2) DEFAULT '09' , ADD `nu_minute` VARCHAR(2) DEFAULT '00' , ADD `sre_layout` VARCHAR(198) DEFAULT '{\"top\":30,\"left\":30,\"bottom\":260,\"right\":30,\"width\":215.9,\"height\":279.4,\"paper\":\"Letter\",\"orientation\":\"P\",\"groups\":[{\"sortField\":\"Detail\",\"sortBy\":\"a\",\"sections\":[{'
===BACK TRACE====
/var/www/html/db/core/nurunpdf.php - line 1054 (nuRunQuery)
/var/www/html/db/core/nurunpdf.php - line 55 (nuAddCriteriaValues)
0] :
===USER==========
globeadmin
===PDO MESSAGE===
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'title'
===SQL===========
ALTER TABLE ___nu160216e359647c___ ADD `USER_ID` VARCHAR(5) DEFAULT 'admin' , ADD `HOME_ID` VARCHAR(6) DEFAULT 'nuhome' , ADD `GLOBAL_ACCESS` VARCHAR(1) DEFAULT '1' , ADD `form_id` VARCHAR(15) DEFAULT '5f7ba6100209806' , ADD `redirect_form_id` VARCHAR(15) DEFAULT '5f7ba6100209806' , ADD `record_id` VARCHAR(15) DEFAULT '5f7b6c61a3ee10a' , ADD `title` VARCHAR(22) DEFAULT 'Parameters for CallRpt' , ADD `call_type` VARCHAR(9) DEFAULT 'getreport' , ADD `column_widths` VARCHAR(1) DEFAULT '0' , ADD `iframe` VARCHAR(1) DEFAULT '0' , ADD `object_id` VARCHAR(1) DEFAULT '1' , ADD `page_number` VARCHAR(1) DEFAULT '0' , ADD `rows` VARCHAR(2) DEFAULT '20' , ADD `row_height` VARCHAR(2) DEFAULT '18' , ADD `session_id` VARCHAR(15) DEFAULT 's16128036225934' , ADD `sort` VARCHAR(2) DEFAULT '-1' , ADD `sort_direction` VARCHAR(4) DEFAULT 'desc' , ADD `subforms` VARCHAR(1) DEFAULT '0' , ADD `refreshed` VARCHAR(1) DEFAULT '0' , ADD `CLONED_RECORD` VARCHAR(1) DEFAULT '0' , ADD `NEW_RECORD` VARCHAR(1) DEFAULT '0' , ADD `browse_sql` VARCHAR(1) DEFAULT '0' , ADD `browse_rows` VARCHAR(1) DEFAULT '0' , ADD `browse_table_id` VARCHAR(22) DEFAULT '___nu160216e2f010b3___' , ADD `browse_filtered_rows` VARCHAR(1) DEFAULT '0' , ADD `form_code` VARCHAR(13) DEFAULT 'CallRptParams' , ADD `form_description` VARCHAR(22) DEFAULT 'Parameters for CallRpt' , ADD `form_type` VARCHAR(6) DEFAULT 'launch' , ADD `run_code` VARCHAR(7) DEFAULT 'CallRpt' , ADD `run_description` VARCHAR(11) DEFAULT 'Call Report' , ADD `UserID` VARCHAR(15) DEFAULT '5f4e75df8041193' , ADD `datFrom` VARCHAR(10) DEFAULT '2021-02-01' , ADD `nuDelete` VARCHAR(1) DEFAULT '0' , ADD `PREVIOUS_RECORD_ID` VARCHAR(15) DEFAULT '5f7b6c61a3ee10a' , ADD `SUBFORM_ID` VARCHAR(1) DEFAULT '1' , ADD `TABLE_ID` VARCHAR(22) DEFAULT '___nu160216e359647c___' , ADD `description` VARCHAR(11) DEFAULT 'Call Report' , ADD `parentID` VARCHAR(19) DEFAULT 'SQL:5f7b42b3f373e42' , ADD `nuInstall` VARCHAR(1) DEFAULT '0' , ADD `nu_date_time` VARCHAR(19) DEFAULT '2021-02-08 09:00:37' , ADD `nu_date` VARCHAR(10) DEFAULT '2021-02-08' , ADD `nu_time` VARCHAR(8) DEFAULT '09:00:37' , ADD `nu_year` VARCHAR(4) DEFAULT '2021' , ADD `nu_month` VARCHAR(2) DEFAULT '02' , ADD `nu_day` VARCHAR(2) DEFAULT '08' , ADD `nu_hour` VARCHAR(2) DEFAULT '09' , ADD `nu_minute` VARCHAR(2) DEFAULT '00' , ADD `sre_layout` VARCHAR(198) DEFAULT '{\"top\":30,\"left\":30,\"bottom\":260,\"right\":30,\"width\":215.9,\"height\":279.4,\"paper\":\"Letter\",\"orientation\":\"P\",\"groups\":[{\"sortField\":\"Detail\",\"sortBy\":\"a\",\"sections\":[{'
===BACK TRACE====
/var/www/html/db/core/nurunpdf.php - line 1054 (nuRunQuery)
/var/www/html/db/core/nurunpdf.php - line 55 (nuAddCriteriaValues)
Re: Saving report as a pdf
More info. My first statement was incorrect. Both files behave the same. What is happening though is that when the query returns no records that meet the parameters the system generates this debug message about the duplicate column. It would be nice if it didn't do that.
-
- nuBuilder Team
- Posts: 506
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 8 times
- Been thanked: 18 times
Re: Saving report as a pdf
Hi treed,
I did a test with empty table (just used LIMIT 0) and what I can see on my setup is following:
- report is generated (just titles)
- no errors on the nuBuilder Debug level
- following warnings on the server logs level
(tested on Debian server, PHP 8.0.1 nuB:V.4.5-2021.02.07.01)
Are you able to prepare same sample from you DB where I could replicate the isuue you see on your side?.
I did a test with empty table (just used LIMIT 0) and what I can see on my setup is following:
- report is generated (just titles)
- no errors on the nuBuilder Debug level
- following warnings on the server logs level
(tested on Debian server, PHP 8.0.1 nuB:V.4.5-2021.02.07.01)
Are you able to prepare same sample from you DB where I could replicate the isuue you see on your side?.
You do not have the required permissions to view the files attached to this post.
If you like nuBuilder, please leave a review on SourceForge
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore
Re: Saving report as a pdf
Line 213 of nurunpdf.php
should be
as $groups must have records to enter the for loop.
Code: Select all
for($g = 0 ; $g < count($groups) ; $g++){
Code: Select all
if (count($groups) > 0)
for($g = 0 ; $g < count($groups) ; $g++){
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: Saving report as a pdf
apmuthu wrote:Line 213 of nurunpdf.phpshould beCode: Select all
for($g = 0 ; $g < count($groups) ; $g++){
as $groups must have records to enter the for loop.Code: Select all
if (count($groups) > 0) for($g = 0 ; $g < count($groups) ; $g++){
Will this prevent the error "SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'title'" ?
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore
Re: Saving report as a pdf
As the error occurs due to running the for loop without any $group element, it should suffice. @teed or someone else with this issue can test and revert. The code can then be properly indented and assimilated in the core.