Difficulty join tables and filters

I have 4 tables: A, B, C and D.

In table D, there are 3 joins for tables A, B and C.

In table D, I created my own template for printing the PDF.

In table C, there is a field that takes a number from a record in table B.


In table C, you can have many records for the same number in table B.

I need to mount the following filter in table D:
-- record from table A , with its corresponding item from table B, with all records from table C (all records from C linked to record number from B, belonging to record from A)

upload_2022-10-27_17-42-35.png

I don't know if you make me understand :(



Could anyone help by telling me how I can do this?
Thanks!
 
Sounds like you need 3 list joins, all in table D:
1. from D to A
2. from A to B
3. from B to C

You may want to set "Display mode" to "Merge rows" and hide the multiple ID (primary key) and Parent ID (foreign key) elements from being displayed in the resulting list (and maybe other elements as well), but that should do what you want from what I understand.

Don't know why you mention the term "filter" for this, because -- again, from what I understand, and unless I'm missing something -- joins are all you need.
 
Last edited:
Perfect @lousyfool !!!

I managed to do all the Joins.

The filter also worked.

The only issue that didn't work was the use of the "Display mode" options, because the print PDF was unconfigured, see:

upload_2022-10-28_16-40-2.png

would there be any special adjustments to make in the template I developed to use these options?

Thanks!
 
One way is to create PDF templates for each option and set custom link in main table. Sometnig like this:

upload_2022-10-29_9-52-1.png
 
Wow @deant !
But to do this you customized the component's CORE?

No...this is a JS list plugin
How to have multiple reports for same table:
1. In original form create pdf templete - lets call it pdf templete 1
2. Create a copy of original form/table
2. Create a second pdf template and set it to "copy" form
3. Add JS list plugin to original list
4. In plugins/fabrik_list/js/scripts add JS function with link sometnih like
JavaScript:
var listdata = Fabrik.getBlock('list_copy_id').options.data
jQuery.each(rows, function(rowid, row) {
 // echo the value of yourtable___yourelement to the console
//    fconsole(listdata);
//    console.log(ids); //outputs an array of the selected row ids
//    console.log(rows);

    var id = (row.yourtable___yourelement_raw);  //usually row  id


    var url = ('index.php?option=com_fabrik&view=details&format=pdf&formid=37&rowid='+ id ); //formid = your "copy" form id

    window.open(url, "_blank");

});

You can have as many templats you need.
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top