I would like a link in each of my organic groups where Forena would replicate some of my views and create a pdf document with a page per OG user.
I've looked through the documentation and module but my SQL knowledge is quite primitive and I don't see anything related to using the current NID in queries.
I think the Views Show Query module would allow me to copy the relevant queries into Forena while I learn the SQL.
So my question is, does the above sound possible and would copying the SQL queries that views produces be enough to get me started?
Below is a view using field collections and a screenshot of the views_show_query pasted into Heidi. There are two arguments given to the view. "1422" and "1243".
SELECT field_sts_grades_fc_field_collection_item.nid AS field_sts_grades_fc_field_collection_item_nid, field_collection_item.item_id AS item_id, field_sts_grades_fc_field_collection_item.title AS field_sts_grades_fc_field_collection_item_title, field_sts_grades_fc_field_collection_item__field_data_field_exam_class_reference.field_exam_class_reference_target_id AS field_sts_grades_fc_field_collection_item__field_data_field_, field_sts_grades_fc_field_collection_item__field_data_field_grade_date.field_grade_date_value AS field_sts_grades_fc_field_collection_item__field_data_field__1, field_sts_grades_fc_field_collection_item.created AS field_sts_grades_fc_field_collection_item_created, users_field_data_field_sts_grades_ref__realname.realname AS users_field_data_field_sts_grades_ref__realname_realname, 'node' AS field_data_field_grade_date_node_entity_type, 'field_collection_item' AS field_data_field_sts_grades_ref_field_collection_item_entity, 'field_collection_item' AS field_data_field_grade_decimal_field_collection_item_entity_, 'node' AS field_data_field_exam_class_reference_node_entity_type
FROM
field_collection_item field_collection_item
LEFT JOIN field_data_field_sts_grades_fc field_data_field_sts_grades_fc ON field_collection_item.item_id = field_data_field_sts_grades_fc.field_sts_grades_fc_value
LEFT JOIN node field_sts_grades_fc_field_collection_item ON field_data_field_sts_grades_fc.entity_id = field_sts_grades_fc_field_collection_item.nid
LEFT JOIN field_data_field_admin_students_class_ref field_sts_grades_fc_field_collection_item__field_data_field_admin_students_class_ref ON field_sts_grades_fc_field_collection_item.nid = field_sts_grades_fc_field_collection_item__field_data_field_admin_students_class_ref.field_admin_students_class_ref_target_id AND (field_sts_grades_fc_field_collection_item__field_data_field_admin_students_class_ref.entity_type = 'entityform' AND field_sts_grades_fc_field_collection_item__field_data_field_admin_students_class_ref.deleted = '0')
LEFT JOIN entityform field_admin_students_class_ref_node ON field_sts_grades_fc_field_collection_item__field_data_field_admin_students_class_ref.entity_id = field_admin_students_class_ref_node.entityform_id
LEFT JOIN field_data_field_sts_grades_ref field_data_field_sts_grades_ref ON field_collection_item.item_id = field_data_field_sts_grades_ref.entity_id AND (field_data_field_sts_grades_ref.entity_type = 'field_collection_item' AND field_data_field_sts_grades_ref.deleted = '0')
LEFT JOIN users users_field_data_field_sts_grades_ref ON field_data_field_sts_grades_ref.field_sts_grades_ref_target_id = users_field_data_field_sts_grades_ref.uid
LEFT JOIN field_data_field_grades_exam_set field_sts_grades_fc_field_collection_item__field_data_field_grades_exam_set ON field_sts_grades_fc_field_collection_item.nid = field_sts_grades_fc_field_collection_item__field_data_field_grades_exam_set.entity_id AND (field_sts_grades_fc_field_collection_item__field_data_field_grades_exam_set.entity_type = 'node' AND field_sts_grades_fc_field_collection_item__field_data_field_grades_exam_set.deleted = '0')
LEFT JOIN field_data_field_exam_class_reference field_sts_grades_fc_field_collection_item__field_data_field_exam_class_reference ON field_sts_grades_fc_field_collection_item.nid = field_sts_grades_fc_field_collection_item__field_data_field_exam_class_reference.entity_id AND (field_sts_grades_fc_field_collection_item__field_data_field_exam_class_reference.entity_type = 'node' AND field_sts_grades_fc_field_collection_item__field_data_field_exam_class_reference.deleted = '0')
LEFT JOIN field_data_field_grade_date field_sts_grades_fc_field_collection_item__field_data_field_grade_date ON field_sts_grades_fc_field_collection_item.nid = field_sts_grades_fc_field_collection_item__field_data_field_grade_date.entity_id AND (field_sts_grades_fc_field_collection_item__field_data_field_grade_date.entity_type = 'node' AND field_sts_grades_fc_field_collection_item__field_data_field_grade_date.deleted = '0')
LEFT JOIN realname users_field_data_field_sts_grades_ref__realname ON users_field_data_field_sts_grades_ref.uid = users_field_data_field_sts_grades_ref__realname.uid
WHERE (( (field_sts_grades_fc_field_collection_item__field_data_field_grades_exam_set.field_grades_exam_set_target_id = '1422') AND (field_sts_grades_fc_field_collection_item__field_data_field_exam_class_reference.field_exam_class_reference_target_id = '1243') ))
ORDER BY field_sts_grades_fc_field_collection_item__field_data_field_ ASC, field_sts_grades_fc_field_collection_item__field_data_field__1 ASC, field_sts_grades_fc_field_collection_item_created ASC, users_field_data_field_sts_grades_ref__realname_realname ASC, field_data_field_sts_grades_ref.field_sts_grades_ref_target_id ASC