This topic is locked

Bug in Report Search and two question on Reports

7/6/2008 6:44:49 PM
PHPRunner General questions
G
giles author

Bug in Reports (PHPRunner V4.1)

There's a small bug in Reports...

If a date field is used as one of the report Search fields and the date field is set to a simple date picker then the date criteria will have a time compoent of "00:00:00" added. This is ok for criteria of dates more than but not for dates less than. With the time component set to "00:00:00" only dates that are the day before will be selected.

(If this has been fixed in a later version of PHPRunner can I patch the fix back into V4.1?)
Also two questions on Reports...

  1. I need to include the Date search criteria on a Report. (e.g. Jobs Done between dd/mm/yyyy and dd/mm/yyyy). In this case the date is the only field in the report search. How do I get at that information? (I see that the search criteria is passed back to the Report page as a form but the only field on the form I I seem to be able to access is "a" (="advsearch"). The criteria seem to be put into a series of $_SESSION variables but I haven't been able to work out their names to access them. Any hints please.
  2. I am summing the totals for two fields in a report (cost and charges) and need to do a simple calculation [profit% = (charges-costs)/charges] with the two totals to display in the summary. How do I do this?
    Thanx in advance,
    Giles.

J
Jane 7/7/2008

Hi,
please see my answers below:

  1. it's not bug. Standart where clause for date field should include full date (with time). If you don't want to search through time just change field type to DATE (not DATETIME) in the database directly.
  2. check this thread:

    http://www.asprunner.com/forums/index.php?showtopic=5704
  3. to calculate two totals check following thread:

    http://www.asprunner.com/forums/index.php?...mode=linearplus

G
giles author 7/7/2008

Hi Jane,

Thanks for your fast repsonse...
Ahhh.. I see what you mean now...not a bug. It will correctly pick up records for that date as it is a date field.
Also thanks for steering me to the two links. On the calculated field in the total..
I've used:
$charge=$smarty->get_template_vars("global_totalCharge_sum");

$var = calc_function($charge);

$smarty->assign("mult_totalCharge_sum",$var);
That's worked fine for the global summary. Would you please advise what I need to use for the group summaries as these may occur multiple times in the report.
Thanks in advance,
Giles