Forums: Conditional report - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Conditional report Rate Topic: -----

#1 User is offline   hokah 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 30-January 10

Posted 30 January 2010 - 08:07 PM

Hello.

How to create a conditional report page with user selecting dates and company(from a dropdown list) and then it calculates a summary from the main table?

table main
company_id
cost1
cost2
cost3

table company
company_id
company_name

it sums the main tables selecting records by date and sums costs.

I have no idea how to do that.
0

#2 User is offline   Jane 

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 7278
  • Joined: 13-June 06
  • Gender:Female

Posted 02 February 2010 - 01:31 PM

Hi,

you can create report on the Datasource tables tab, tehn join these tables on the Edit SQL query tab.
To filter records in the report use advanced search page.
best regards,
Jane Endaltseva
e-mail: support@xlinesoft.com
0

#3 User is offline   hokah 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 30-January 10

Posted 04 February 2010 - 12:00 PM

View PostJane, on 02 February 2010 - 03:31 PM, said:

Hi,

you can create report on the Datasource tables tab, tehn join these tables on the Edit SQL query tab.
To filter records in the report use advanced search page.


Hi,

Thanks for the idea, but I want to create something more user-friendly. Something like a tables 'add page'. Where user selects start_date, end_date and company and program automatically summaryses costs without the need of saving a record.
0

#4 User is offline   Jane 

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 7278
  • Joined: 13-June 06
  • Gender:Female

Posted 04 February 2010 - 01:32 PM

Hi,

I'm not sure that I nderstand your question.
Where do you want to summarize values: on the add page or on the list page?
best regards,
Jane Endaltseva
e-mail: support@xlinesoft.com
0

#5 User is offline   hokah 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 30-January 10

Posted 04 February 2010 - 02:13 PM

View PostJane, on 04 February 2010 - 03:32 PM, said:

Hi,

I'm not sure that I nderstand your question.
Where do you want to summarize values: on the add page or on the list page?



Where is not so important.
I guess another way would be to make a new table 'sums' with fields:
date_start
date_end
company
sum

then the user on the tables add page, fills the first 3 fields and saves a record
there should be a php event after record added that will calculate summary into the
sum field.?
0

#6 User is offline   Jane 

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 7278
  • Joined: 13-June 06
  • Gender:Female

Posted 05 February 2010 - 12:07 PM

Hi,

to calculate values on the add/edit pages use Before record added/Before record updated events on the Events tab. All entered values are in the $values array. Here is just a sample:
$values["FieldName1"] = $values["FieldName2"]*$values["FieldName3"];

best regards,
Jane Endaltseva
e-mail: support@xlinesoft.com
0

#7 User is offline   hokah 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 30-January 10

Posted 09 March 2010 - 08:35 PM

View PostJane, on 05 February 2010 - 02:07 PM, said:

Hi,

to calculate values on the add/edit pages use Before record added/Before record updated events on the Events tab. All entered values are in the $values array. Here is just a sample:
$values["FieldName1"] = $values["FieldName2"]*$values["FieldName3"];



Hi,
need some help with php synatx. Table where the calculations are like in the image.
Posted Image
user selects conditions, FILIAAL, ALGUS_KP(starting date) and LOPP_KP(ending date) which select records from table 'sinine'.
date values are selected in the tbale 'sinine' from field TELL_KUUP. L_LAEKUNUD is calculated from table 'sinine' from fields SUMMA, SUMMA1, SUMMA2.
L_MAKSTUD is calculated from table 'sinine' fields HIND1, HIND2, HIND3.
L_KASUM is calculated from current table sum of L_LAEKUNUD - L_MAKSTUD.
and the L_PROTSENT is percent of that.



Kaarel
0

#8 User is offline   hokah 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 30-January 10

Posted 14 March 2010 - 05:46 PM

Maybe something like this works?

$result = mysql_query("SELECT * FROM sinine WHERE FILIAAL = $values[FILIAAL] AND LAEK_KUUP >= $values[ALGUS_KP] AND LAEK_KUUP <= $values[LÕPP_KP])
while($row = mysql_fetch_array($result))
{
$values["L_LAEKUNUD"] = $row['SUMMA'] + $row['SUMMA1'] + $row['SUMMA2'] 
}
return true;

0

#9 User is offline   Jane 

  • Advanced Member
  • PipPipPip
  • Group: Admin
  • Posts: 7278
  • Joined: 13-June 06
  • Gender:Female

Posted 17 March 2010 - 01:16 PM

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with detail descrition of what you want to achieve.
best regards,
Jane Endaltseva
e-mail: support@xlinesoft.com
0

#10 User is offline   hokah 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 30-January 10

Posted 22 March 2010 - 06:42 PM

How to validate if fields value is set? For example to check with php syntax if user has set a value to field.
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users