Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Printing a song book - Minimizing printed pages

Featured Replies

The following script should do what you want. It may not always produce the optimum page arrangements, but it should be reasonable. Field names that begin with lowercase 'g' are global fields. Your print layout should should have a sub-summary part sorted by pageNo that pagebreaks after each occurrence.

code:


#Before running, all records (including the omitted ones) must have the PageNo field cleared

# and the current found set should be the songs that are to be printed.

Set Field [gPageNo, 0]

#Sort the file by number of lines per song in increasing order

Sort [sort Order: NumLines (Ascending)] [Restore sort order, no dialog]

Loop

#If there are no records left, then all songs have been assigned a page number.

Exit Loop If[status(CurrentFoundCount)=0

#Start next Page

Set Field[gPageNo, gPageNo + 1]

#Start with the longest song which will be at the end of the found set.

Go to Record/Request/Page [Last]

Set Field[PageNo, gPageNo]

Set Field[gRemainingLines,41-NumLines]

Omit Record

#Loop through all records until a small enough song is found to fit the remaining space on the page.

Loop

If[NumLines<=gRemainingLines]

#Found one, so assign the current page number to it, and then continue.

Set Field[PageNo, gPageNo]

Set Field[gRemainingLines,gRemainingLines-NumLines]

Omit Record

End If

#Quit searching if there are less than 2 lines remaining on the current page.

Exit Loop If [gRemainingLines<2]

#Otherwise look for another song to fit on the page.

Go to Record/Request/Page [Previous, Exit after last]

End Loop

#Now do next page

End Loop

#Perform a find to get the found set back

Perform Find [Request 1 (Omit): PageNo=][Restore find requests]

#Finally, perform a subscript that sorts by PageNo, goes to the print layout, and prints the songbook

Perform Script [PrintSongBook][sub-scripts]

  • Newbies

Hello, I have a database of songs that I occasionally make into song books (5 to 30 songs per book). I would like to minimize the number of pages printed without having to order the songs manually.

I have a calc field that calculates the number of lines in each song. Some have 6 lines, some have 40, the maximum number of lines on a page (with my text settings) are 41.

Is there a way to group songs by sums of 41?

I'm not sure if I've worded this in the clearest way, but this is my best shot. Your comments are welcomed.

Eide crazy.gif

[ February 04, 2002, 01:03 PM: Message edited by: Eide ]

  • Newbies

Wow!

Thanks a bunch, it took a while to implement, but the script works pretty well. I tweaked with a few of the numbers/text sizes/etc. but you pretty much nailed that one. Thank you for your time and effort!

Eide

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.