Re: List form for reporting

2018-05-03 Thread Chip Scheide via 4D_Tech
Print Form



- I create a master form, which looks like a print selection form.
- Duplicate, it for each part I need to print (header, break, footer, 
detail etc),
- set the break lines according to the section being printed (Print 
Form prints everything between header line and detail line)
- I name the sections Form_Name_h, Form_Name_d1, Form_Name_d2, 
Form_Name_f etc. 
- each Print_Form_ method (below) will use the appropriate form 
section. The various Print_form_ methods (below) will collect what 
ever related record data, fill variables, do calculations, summations, 
etc

your code will look something like this (entirely fake code:

For (Primary Records to print)

  Repeat  // print at least one page for each primary record (not 
required to be done this way)
$Pixels_Printed:=$Pixels_Printed + Print_Form_header
$Pixels_Printed:=$Pixels_Printed + Print_Form_subheader // if there 
is one

// print the detail line(s) for this record
While ($Max_Report_Body_Pixels > $Pixels_Printed) & 
(Not($All_Details_Printed))

 // run out of room, print footer, print new page headers
 if ($Max_Report_Body_Pixels < $Pixels_Printed)
   Print footer
   Page Break
   $Pixels_Printed:=$Pixels_Printed + Print_Form_header
   $Pixels_Printed:=$Pixels_Printed + Print_Form_subheader // if 
there is one
 end if
  $Pixels_Printed:=Pixels_Printed + Print_Form_Detail
end while

// fill page to print footer at bottom of page
for ($Max_Pixels_to_Print - ($Pixels_Printed + $Footer_size))
  Print_One_Pixel_Blank_Form
end for
Print_Footer   // print footer, end of report
  until ($All_Details_Printed)
  next record([primary_table])
end for

hope this helps
Chip

On Wed, 2 May 2018 17:20:34 -0700, Noah via 4D_Tech wrote:
> Good afternoon!
> I need to develop a print report that I was hoping would be a as simple as
> PRINT SELECTION, however what needs to be printed is not in a single table
> (there are at least two tables to get the information from).
> 
> The tables are called [Projects] and [Approvals]
> 
> One project can have many approvals and each approval is tied to an
> account/fund (which is a non-unique attribute of the project). The projects
> have a unique key but that key is not present in the approvals table. The
> approvals records can be used to look up the associated project based on
> certain query-able fields (project name and status).
> 
> I was thinking that this might be accomplished with multiple breaks as
> shown in the documentation:
> http://doc.4d.com/4Dv15/4D/15.6/An-example-report.300-3836729.en.html
> 
> However, I don't have a ton of experience with list forms (aside from the
> last 3 days of investigations). I have gone through much of the
> documentation and experimenting with form creation, but have not been able
> to come up with a solution that I am happy with.
> 
> It would be nice to  develop a print form with the project information at
> the top of the page and the related approval records listed below (on as
> many pages as needed).
> 
> Something like that is shown in this video but they use the form wizard to
> achieve this:
> http://doc.4d.com/4Dv16/4D/16/Printing-forms.200-3246861.en.html
> 
> Can anyone provide some guidance on how I might be able to solve this
> problem?
> 
> Many thanks in advance,
> Noah
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

List form for reporting

2018-05-02 Thread Noah via 4D_Tech
Good afternoon!
I need to develop a print report that I was hoping would be a as simple as
PRINT SELECTION, however what needs to be printed is not in a single table
(there are at least two tables to get the information from).

The tables are called [Projects] and [Approvals]

One project can have many approvals and each approval is tied to an
account/fund (which is a non-unique attribute of the project). The projects
have a unique key but that key is not present in the approvals table. The
approvals records can be used to look up the associated project based on
certain query-able fields (project name and status).

I was thinking that this might be accomplished with multiple breaks as
shown in the documentation:
http://doc.4d.com/4Dv15/4D/15.6/An-example-report.300-3836729.en.html

However, I don't have a ton of experience with list forms (aside from the
last 3 days of investigations). I have gone through much of the
documentation and experimenting with form creation, but have not been able
to come up with a solution that I am happy with.

It would be nice to  develop a print form with the project information at
the top of the page and the related approval records listed below (on as
many pages as needed).

Something like that is shown in this video but they use the form wizard to
achieve this:
http://doc.4d.com/4Dv16/4D/16/Printing-forms.200-3246861.en.html

Can anyone provide some guidance on how I might be able to solve this
problem?

Many thanks in advance,
Noah
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**