If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Multiple Subselect in pdf reports

02-27-2013, 08:45 PM

Creating a subselect within a subselect using FPDF and Scriptcase? Here is the case I am trying to solve. Each invoice contains within it multiple work orders that have 1 to many line items. I've gone as far as I can with modifying my CODE in FPDF even using the Events to load variables but you cannot modify a subselect WHERE criteria based upon the current subselect onRecord event. You can use it within the primary select statement but you cannot modify a subselect SQL statement.

Visual representation:
Customer Invoice
Pagebreak
- Work Order A - use the primary key from the workorder table (pkey: iniid)
--- Line Items (1:M) - use the primary key from the workorderdetails table (pkey: woiid).
--- woiid: 10547
- Work Order B - use the primary key from the workorder table (pkey: iniid)
--- Line Items (1:M) - use the primary key from the workorderdetails table (pkey: woiid).
--- woiid: 10548

These will only allow you to change the primary SQL select statements.

The trick is how to change the 2nd subselect where clause.

Any tips or feedback on how to change the WHERE clause of subselect SQL statement as it iterates through the first subselect statement? Hence this would change the WHERE clause of the subselect statement within the first subselect statement?