Report Designer Printable Report With Selected

Post Reply
enishemed
Posts: 653
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Report Designer Printable Report With Selected

Post by enishemed »

Dear Sergey,

I have a report designed by Report Designer. It is a "Printable report". If the button position is "on the repord page", "menu:more actions" and "button: print", everything is well.

But if the button position is "Menu: with selected", it gives the following error.

Code: Select all

Database Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and FROM_UNIXTIME(e.field_826, '%Y-%m-%d') = '' order by urun_grubu, urun_c' at line 18
Query: select FROM_UNIXTIME(e.field_826,'%d.%m.%Y') as tespit_tarihi, FROM_UNIXTIME((select g.field_817 from app_entity_60 g where g.id = e.parent_item_id), '%d.%m.%Y') as giris_tarihi, (select j.field_918 from app_entity_68 j where j.id = (select i.field_816 from app_entity_60 i where i.id = e.parent_item_id)) as arac, (select h.field_777 from app_entity_62 h where h.id = e.field_825) as urun_grubu, (select l.field_785 from app_entity_63 l where l.id = e.field_793) as urun_cesidi, (select m.field_864 from app_entity_65 m where m.id = e.field_822) as birimi, e.field_794 as miktar, e.field_1068 as birim_fiyat, e.field_800 as tutar, e.field_1225 as hizmet_bedeli from app_entity_64 e where e.field_821 = and FROM_UNIXTIME(e.field_826, '%Y-%m-%d') = '' order by urun_grubu, urun_cesidi
Page: /index.php?module=items/report_page_print_selected&path=84&report_id=27
#0 includes/functions/database.php(87): mysqli_query()
#1 plugins/ext/classes/report_page/blocks_php.php(42) : eval()'d code(24): db_query()
#2 plugins/ext/classes/report_page/blocks_php.php(42): eval()
#3 plugins/ext/classes/report_page/blocks_html.php(70): report_page\blocks_php->render()
#4 plugins/ext/classes/report_page/report.php(69): report_page\blocks_html->render()
#5 modules/items/actions/report_page_print_selected.php(37): report_page\report->get_html()
#6 index.php(20): require('m...')
#7 {main}
The code can not find the value for "e.field_821" and "FROM_UNIXTIME(e.field_826, '%Y-%m-%d')". These values works for other button positions. The code for these values comes from the following code.

Code: Select all

$info_query = db_query("select field_1261 as satici, FROM_UNIXTIME(field_1260, '%Y-%m-%d') as tarih from app_entity_84 where id='[current_item_id]'");
$info = db_fetch_array($info_query);
$satici = $info['satici'];
$tarih = $info['tarih'];
User avatar
support
Site Admin
Posts: 6231
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Report Designer Printable Report With Selected

Post by support »

Did some tests and can't reproduce it. I think it's hard to reproduce. You better try reproduce it on personal demo with standard configuration https://www.rukovoditel.net/demo.php and give me the link to the demo.
With real example we will know which place need to fix.
enishemed
Posts: 653
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Report Designer Printable Report With Selected

Post by enishemed »

Dear Sergey,

I have created the demo

https://pdemo.rukovoditel.pro/3.3/index ... mo_id=1849

Please go to Reports table/entity and click on "Customer Report" button from "with selected" and "on the record page". On the record page is working but "with selected" gives error.

You can also see my code from report designer.

Thanks.
User avatar
support
Site Admin
Posts: 6231
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Report Designer Printable Report With Selected

Post by support »

I have found issue. Files from archive replace to plugins\ext\classes\report_page\

But note, you have modify your code. Use Custom PHP https://docs.rukovoditel.net/index.php?p=129
to declare function html_table($data)
so you can use this function in any php blocks.
Attachments
report_page_fix.zip
(9.39 KiB) Downloaded 18 times
enishemed
Posts: 653
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Report Designer Printable Report With Selected

Post by enishemed »

Now, it works but there is another problem.

If 1 item is selected, then the it is working.

If more than one items selected, then it is NOT working.

The error on screenshot means: This page is not working now.
Attachments
Ekran görüntüsü_20230118_161121.png
enishemed
Posts: 653
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Report Designer Printable Report With Selected

Post by enishemed »

Yes, I use this in custom php, in demo just to show you the bug.
support wrote: 18 Jan 2023, 16:50 But note, you have modify your code. Use Custom PHP https://docs.rukovoditel.net/index.php?p=129
to declare function html_table($data)
User avatar
support
Site Admin
Posts: 6231
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Report Designer Printable Report With Selected

Post by support »

Your function should be there (see attached)

PHP code in Report designed try to run for each item and you have error where function is already defined.
Attachments
screenshot-localhost-2023.01.18-16_17_57.png
enishemed
Posts: 653
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Report Designer Printable Report With Selected

Post by enishemed »

Ok. I see.

Last, when the process button on the te item page "pdf" button is shown, but when it is on with selected, "pdf" button is not shown.
Attachments
Ekran görüntüsü_20230118_162340.png
User avatar
support
Site Admin
Posts: 6231
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Report Designer Printable Report With Selected

Post by support »

Yes, did not add this button yet. You can save as PDF in print dialog window. The result will be much better then convert html to pdf.
enishemed
Posts: 653
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Report Designer Printable Report With Selected

Post by enishemed »

Ok. thanks.
support wrote: 18 Jan 2023, 17:42 Yes, did not add this button yet. You can save as PDF in print dialog window. The result will be much better then convert html to pdf.
Post Reply