Trying to load a report with a URL

I am trying to create a link that will load a specific report. Currently, to open a report I go to internal/admin/academics/reporting/dataslicer.php, click on the “Reports” button, and select a report from the list.

The link to each report is the same: internal/admin/academics/reporting/dataslicer.php#

I know that each report has a unique number and that when a report is clicked, it does the following:

<a href="#" onclick="loadReport(11111); return false;">Report Name</a> == $0

I thought I could load the report by using the URL: internal/admin/academics/reporting/dataslicer.php?loadReport=11111

Is it possible to load a report via URL, or am I wasting my time?

Thanks

The code is using a javascript function named loadReport() to do the work. It would take examining that code to determine how the actual report is requested/produced.

1 Like

I think this might be it:

	}

	function loadReport(piReportID){
		showLoading();

		$('#content').load('/internal/admin/academics/reporting/dataslicer.php', {ninjaView: 'FILTER', task: 'LOAD_REPORT', reportID: piReportID}, function(){
			hideLoading();
			$.jGrowl('Load complete.');
		});
	}

	function deleteReport(poThis, piReportID){
		poThis.parent().parent().addClass('deleteconfirm');
		if(confirm('Are you sure you want to delete this report?\n\nThere is no undo.')){
			$('#content').load('/internal/admin/academics/reporting/dataslicer.php', {ninjaView: 'REPORTS', task: 'DELETE_REPORT', reportID: piReportID}, function(){$.jGrowl('Report deleted.');});
		}
		else{
			poThis.parent().parent().removeClass('deleteconfirm');
		}
	}

	function standingProgramChange(poThis){
		var oThis = $(poThis);
		var ninja_condition = oThis.closest('.ninja_condition');
		var $submit_button = $('.js-data-slicer-submit-button');
		disableButton($submit_button);

		$.ajax({
			url: '/internal/admin/academics/reporting/dataslicer.php',
			data: {task: 'getConditionHTML', condition: 'STANDING', termID: $('select[id$=_term]', ninja_condition).val(), programID: oThis.val()},
			success: function(sResponse){
				$('.ninja_condition_loading_parent', ninja_condition).html(sResponse);
				enableButton($submit_button);
			}
		});
	}

The code is using the jquery .load method. Since the data is an object, this is making a post request to get the report data.

You could make post method forms or the server-side code could be modified to use a get request.

1 Like

Just so I’m clear, there’s currently no way to access a specific report through a URL? Is that correct?

Correct. Requires either a change to the server-side code or producing a post method form, and even then the output may not directly be usable if there’s code on the page styling or formatting the output.

1 Like
Sponsor our Newsletter | Privacy Policy | Terms of Service