I started using the demo version of the Reports.JS library yesterday - and so far, by and large, I love it. I was easily able to add complex reporting functionality to my app. I'm very much excited about continuing to work with the library and see what all I can do with it. I do have a few questions - and they are around best practices for data models.
1) I currently am using a single data set for my data model. It is based on an AdHoc query engine I wrote. This ad-hoc query engine is such that the source data is purposely full of cartesian products - which are then filtered out on display. I was able to get the library up and running very quickly using this process. However, I am not finding a way that I can restrict the output to only show unique data (based on the fields used in the report)?
For example:
Code: Select all
Last Name | First Name | Movie | Award
-------------------------------------------------------------------------------------------------------------------------------------------------
Mouse | Mickey | Steamboat Willie | Oscar Nomination
Mouse | Mickey | Steamboat Willie | Oscar (Best Animated Short)
Mouse | Mickey | Jack and the Beanstalk | Oscar Nomination
Code: Select all
Last Name | First Name | Award
-------------------------------------------------------------------------------------------------------------------------------------------------
Mouse | Mickey | Oscar Nomination
Mouse | Mickey | Oscar (Best Animated Short)
Code: Select all
Last Name | First Name | Award
-------------------------------------------------------------------------------------------------------------------------------------------------
Mouse | Mickey | Oscar Nomination
Mouse | Mickey | Oscar (Best Animated Short)
Mouse | Mickey | Oscar Nomination
My data source is JSON - and it is served from a REST API. I would much prefer to split the data apart into its component pieces - and set up the pulls from the database that way. In the long run, I suspect that will be much more efficient.
However, I am not finding any documentation on setting up datasets - particularly when it comes to relationships between them. I need to do this in code (vanilla JS) - (I'm on a .NET platform - but I would prefer not to use the .NET controls). How does one go about defining two related datasets in the JavaScript code? I can define them separately - but I'd like to also define the relationships.
Third - Currently, I am loading a sample dataset and letting the tool figure out the Schema. This is fine - but it's not user friendly. Is there a way for me to define the schema up front - and then pump in the data later? This will reduce the need for things like "root" being all over the place.
Thanks - if any of this isn't clear - please let me know. I'll do my best to clarify!
d8