Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Showing custom data in a SS_Report


Go to End


2 Posts   1997 Views

Avatar
mco

Community Member, 14 Posts

11 June 2010 at 10:23pm

Hi,

I try to list up custom information in a Report which does not exist as DataObjects in the database.

In generall I'm using the newq DataObjectSet function and push the objects using new ArrayData into it. That doesn't seem to work in a Report...

Here is my code:

function sourceRecords($params = null) {
	$ret = new DataObjectSet();
	$record = array(
		'title' => 'Some Value',
		'value' => '23'
	);
	
	// Commenting the following line works, but of course, there are no results in the report
	$ret->push(new ArrayData($record));

	return $ret;
}

function columns() {
	return array(
		"Title" => array(
			"title" => "Title",
			"link" => false,
		),
		"Value" => array(
			"value" => "Value",
			"link" => false,
		),
	);
}

Calling the report, ends in a "Error loading page" message. There is nothing in the PHP Error logs...
Any ideas?

Thanks,
mcoco

Avatar
mco

Community Member, 14 Posts

22 June 2010 at 2:56am

hm... no ideas out there? I don't get it running...