Page 2 of 2
Re: Saving report as a pdf
Posted: Wed Feb 03, 2021 10:41 pm
by kev1n
Re: Saving report as a pdf
Posted: Thu Feb 04, 2021 6:54 am
by apmuthu
If you are on v4.5, then use
@kev1n's repo for v4.5.
Re: Saving report as a pdf
Posted: Fri Feb 05, 2021 8:04 pm
by Janusz
@treed, is it OK with mailing reports now? do you need something more?
Re: Saving report as a pdf
Posted: Mon Feb 08, 2021 6:12 pm
by treed
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)
Re: Saving report as a pdf
Posted: Mon Feb 08, 2021 7:07 pm
by treed
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.
Re: Saving report as a pdf
Posted: Tue Feb 09, 2021 7:51 am
by Janusz
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?.
report.JPG
Re: Saving report as a pdf
Posted: Wed Feb 10, 2021 3:05 pm
by apmuthu
Line 213 of
nurunpdf.php
Code: Select all
for($g = 0 ; $g < count($groups) ; $g++){
should be
Code: Select all
if (count($groups) > 0)
for($g = 0 ; $g < count($groups) ; $g++){
as
$groups must have records to enter the
for loop.
Re: Saving report as a pdf
Posted: Thu Feb 11, 2021 3:48 am
by kev1n
apmuthu wrote:Line 213 of
nurunpdf.php
Code: Select all
for($g = 0 ; $g < count($groups) ; $g++){
should be
Code: Select all
if (count($groups) > 0)
for($g = 0 ; $g < count($groups) ; $g++){
as
$groups must have records to enter the
for loop.
Will this prevent the error "SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'title'" ?
Re: Saving report as a pdf
Posted: Fri Feb 19, 2021 6:22 am
by apmuthu
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.