Comments (4)
It's something that would be nice - for the moment, if you're wanting fields from a relationship, you need to create your own AdvancedReport (or DataObjectReport) subclass and manually add in the fields the user can select by
- Override getReportableFields() to add in the field value the user can select
- Override getDataObjects() to provide your own logic for selecting the data objects to include in the report.
from silverstripe-advancedreports.
Thank you for your assistance.
I've started building my own obeject. Everything looks good but when
I go to run preview on the report I get this error:
error_log(/var/log/silverstripe): failed to open stream: Is a directory
error_log([22-Sep-2011 06:28:48] Error at
advancedreports/code/dataobjects/AdvancedReport.php line 359: Uncaught
Exception: Abstract method called; please implement getDataObjects()
(http://localhost/hiho2/admin/advanced-reports/DirectoryReport/14/preview)
,3,/var/log/silverstripe,)
Line 57 of LogFileWriter.php
I've modified permissions on /var/log/silverstripe to 777. I've also
chown and chgrp to www-data. Nothing fixes it.
Can you advise what advanced report is trying to do here?
Thank you.
Steve
Quoting nyeholt
[email protected]:
It's something that would be nice - for the moment, if you're
wanting fields from a relationship, you need to create your own
AdvancedReport (or DataObjectReport) subclass and manually add in
the fields the user can select by
- Override getReportableFields() to add in the field value the user
can select- Override getDataObjects() to provide your own logic for selecting
the data objects to include in the report.Reply to this email directly or view it on GitHub:
#1 (comment)
from silverstripe-advancedreports.
The important bit is
Uncaught Exception: Abstract method called; please implement getDataObjects()
Your report subclass needs to implement this method to return the actual data objects that will be displayed in the report. Check the DataObjectReport class for an example.
from silverstripe-advancedreports.
K. That is fixed.
Now my final issue. I'm trying to include fields from a hasmany table that relates to my primary table.
I modified getReportableFields to reference one of my other tables. In the example code below I have a primary table "Family" and another table "Individual". The relationship that relates them is "Individuals". So here is the code:
protected function getReportableFields() {
$fields = array(
'ID' => 'ID',
'Created' => 'Created',
'LastModified' => 'LastModified',
);
if ($this->ReportOn) {
$dbfields = Object::combined_static($this->ReportOn, 'db');
$addtl=array('Individuals.FirstName'=>'Individuals.FirstName');
$fields=array_merge($fields,$dbfields);
$fields=array_merge($fields,$addtl);
$fields = array_combine(array_keys($fields), array_keys($fields));
....
The field is displayed but comes up blank when I generate the report. How do I get the report to pull the selected field value from a hasmany relationship?
}
from silverstripe-advancedreports.
Related Issues (9)
- PDF Rendition on Advanced Report - No JAVA HOT 1
- Silverstripe 3? HOT 7
- looks like this have been mentioned, getting data from has_many relationship. HOT 1
- Preview opens two new tabs/windows
- Unexpected behaviour on generate
- position of input fields in the form HOT 2
- Unexpected behaviour on preview
- Extend module ability to arbitrarily pull in content from other relation types (has_many, many_many, has-one) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silverstripe-advancedreports.