2 Replies Latest reply on Oct 24, 2012 1:31 PM by KenShick

    Custom Report Design Issue


      I am having trouble previewing and printing to PDF a totally custom report. This is not a Filemaker report. I gather information for a single client from a large database of clients and insert each section/paragraph of information into a very long text field. For example, there are paragraphs on Client Overview, Client Objective, Client Support, etc., all in consecutive order in this report field. Then I preview and print a PDF. At one time the report was of a length where it would fit in a field stretched to the length of a layout. Now the report is much larger and more flexible because it allows the user to pick the section/paragraphs and the order. So the report now exceeds the length of a layout. I have done many tests using multiple layouts but it’s never quite right. I get blank pages in preview and truncated text. It seems the only solution is to limit the length of the field to the length of a page but that is very difficult to do since I don't know which data the user is selecting and how long it is. FM11.3 Any ideas?

        • 1. Re: Custom Report Design Issue

          Hello, kes.


          You're experiencing a fairly common issue. I suggest you take a look at Bruce Robinson's Virtual List technique. There are a lot of applications of it, but in this particular situation, what you'd do is assign chunks of your text (as divided by carriage returns) to individual records on a List View layout. Here are the basics (at least one way of accomplishing the goal):


          1) Create a table in your database apart from the rest of the database. This table will contain at least one field: A calculation set to GetValue ( $$var ; Get ( RecordNumber )). You can assign additional fields if you need them, but I don't know offhand that you would.


          2) Create a number of records at least equal to the number of paragraphs you expect ever to need. (Although you can create new ones on the fly if you need to.)


          3) In the script you're currently using for the printing routine, take your very large field and set $$var equal to its contents.


          4) Go to a List View layout where you have your calculation field. Omit any records above the number of records in the $$var list (go to record ValueCount + 1, then Omit Multiple Records, say, 1000 or so). Print.


          So how does this work? By using GetValue, you're telling FileMaker to extract the text between carriage returns and insert it into the field. By using Get ( RecordNumber ), your basically telling FileMaker, "Whatever number record I'm on, that's the paragraph from the source text I want."


          So, record 1 contains the first paragraph, record 2 contains the second paragraph, etc. All generated in real time, on the fly. There's not even a need to sort the records, because FileMaker already knows 1 comes before 2, which comes before 3.   


          You'll need to make your List View layout field large enough to hold an individual paragraph, but that shouldn't be a problem. Let us know if this doesn't make sense.





          • 2. Re: Custom Report Design Issue

            Mike, I experimented with 150 records with a section or paragraph on each one. Then in preview they all slided up and looked fine. I am going to take a look at your suggestion to see if that adds something to the solution. Thanks, Ken