Jump to content

Reporting system with dynamic dataretrieval


NikkiLoveGod

Recommended Posts

Hi all,

 

I'm at the verge of my skills with the next dilemma, and need help from fine ppl like you.

 

I need to build a highly flexible reporting system that has a "default" way of forming a report, and then there's a possibility for overwriting the default way. The main idea is that I have a default definition file that says something like

<?php
$datas = array("category" =>  array(array("type" => "value", "value" => "this_value"), array("type" => "value", "value" => "another_value")),
"another_category" => array(...));
?>

 

and I include this definition file in a report file, which then includes a second file, a datafetcher which is then somehow supposed to get that value with a defined way. The trick is, that I might have 100 of these variables, and some of them, or all of them, have to be redefinable by another included file, another datafetcher. These customized datafetchers are there because I might want to create a same report to multiple targets which varies in their datas locations.

 

Ofcourse there's other "types" also, like "filters", which gets the same data as the normal "value" types, but filters it somehow.

 

I'm having hard time figuring out how to do this. How should I get the value for "this_value" and "another_value". Idea is to get an array looks something like this:

 

<?php
$datas = array('category' => array('this_value' => 1234, 'another_value' => 4321),
....);
?>

 

So it should first take into account what type the value is, then start building it accordingly, and then what value it is so it know what to get. Both of these should be overwritable.

 

Should the way to get the data be some functions like this_value(); another_value();? Then how would I take the type in account? Or overwriting as I can't redeclare functions (procedural). Or maybe some switch -conditional that has the case's included in order?

 

Im probably sending very confusing message here, but I am confused :D If you could give me your 2cents and point me to the right direction, it would be awesome! Or some reference data where I can learn more would be cool too.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.