Adding columns dynamically requires adding fields dynamically and this cannot be done with FileMaker.
Closest way to come to what you describe is to set up multiple cross tab report layouts and then the script you run after setting the date range in the global fields would select the layout designed for that number of columns. The columns can be one row filtered portals so that two 5 column reports for different date ranges can use the same layout.
This looks like the next project on my list. Fixed number of Rows but variable columns (and my last column needs to be a data entry for new data) I still am trying to think of a "simple" design that will work.
Let me know if you do find such a simple method. For "simple" it's better, if possible, to swap rows for columns so that you can dynamically add rows (records or groups of records in your found set) instead of trying to dynamically add columns.
Such columns in FileMaker are fixed, the only way to vary the number of columns is to either leave the right hand, unused columns empty or to use multiple layouts with different numbers of columns.
There are three typical methods used to get data from different records (or summary data based on multiple records) into such columns:
Calculation fields that refer to related records where the relationship controls what records are used to compute a value
Calculation fields that use ExecuteSQL to access the needed data. This data can be a single value or table like list of data similar to a "read only portal"
Thanks for the inputs!
I'm currently looking at CrossTab reports, but will check out the typical methods you suggested.