1 of 1 people found this helpful
I had a client with some complex reporting requirements - a financial statement. The statement was broken down into 6 distinct areas; we had different tables, different search criteria, required fields and a few other wrenches tossed into the works. They wanted the statement to print on a single page if possible.
What I ended up doing was breaking the report into each logical section.
The script performs the search for section 1, exports the required information to the temporary directory and then imports it into a dummy table. After each import I set a "section" field so that the records get grouped into their respective area on the statement. We do that for each of the different sections - all going into the same dummy table. In some cases we'd be doing additional calculations on the imported data, in some cases not.
What we ended up with is a simple sub-summary report, sorted by the section field. That, combined with judicious use of conditional formatting and layering fields fields allowed us to effectively turn on or off fields that were needed in each section.
You could do something similar, building virtual lists instead of the export/import. Gather all of your data, stuff it somewhere (fields, variables) and then find a way to format it nicely for the creation of your PDF.
If you're using FM12 the ExecuteSQL script step may help you as you can grab data regardless of context.
Hope that points you in the right direction.
1 of 1 people found this helpful
Load the data you need to display to global variables that you can display as merge variables in the printed document. Go to a layout based on a special-purpose single-record table. You can conditionally show or display the different pages as sub-summary parts on that layout by sorting (and not sorting) on the fields necessary to reveal each sub-summary part. The sort fields don't have to be anything meaningful — just something for the sub-summary parts to target.
Good ideas coming! Thank you both.
David - this does sound familiar! I have done such an export->import into temporary tables and it does the trick albeit somewhat slowly and at somewhat high developer effort. In places I've done this I end up feeling sad (altho admittedly I don't know if I really should!) that there's overhead for record creation/deletion - increasing the file size. But, I might give this a go.
Jeremy - This seems to take David's idea and helps address the Export->Import slowness and file size issue. A twist (in a good way) on the concept.
For either of you - or others - I do have the need to present 2 kinds of data in the output that might be tricky with these techniques (easy peasy in HTML); tables and images. Some tables have variable #s of columns, some of which might also like to have advanced cell formatting like conditional headers, cell borders/shading, formatting of the text like centering, bolding etc. You get the idea.
Any ideas on handling tables with either technique?
The other challenge is with images. During the Inspection they can take photos of violations. From 1 to n pics of specific problems. With the html that wasn't too bad, export the image and make image hrefs. With David's temp table techique it's doable (I think...!) with container fields and importing those into the temp table's records but would not be workable with Jim's global variable technique (is that right?)
Any thought's on these challenges?
Thanks again! Mark
Message was edited by: mark.stuller Sorry Jermey - I had Jim, 'cause someone named Jim talked to me as I wrote this post!
Mark, I'm hoping you find the exact right solution because I have a similar project coming up this winter.
I haven't really started but I had bookmarked this for an ISO FTP client.
The notion is to create a web page and email the end user the appropriate URL.
I'd like to give an update to folks interested in this.
I have taken Jeremy's concept pretty far with pretty good success. So far. That is the concept of a single record 'utility' table with global variables (not global fields) to hold and display the data. Constructing those variables from the data then switching to a layout based on the utility table. Sorting to hide/show subsummaries as needed dependent on the contents needing to be displayed. It works pretty well. A bit different and *somewhat* easier than exporting the data from all the various tables the data naturally resides in and then importing back into a single utility table for display.
I do have a couple of sticking points yet to be adequately addressed. If people have ideas I'd appreciate them!
- I need/want to be able to apply 'extended' formatting to the contents of the global variables. i.e. while you can set font styles like bold and underline, applying paragraph styles is not possible. Say I want to have centered, bolded and size 14 text in a variable's 1st paragraph then switch to left justified, hanging paragraph unbolded size 12 text format for a bulleted list. I can accomplish the bolding and font sizing effectively, but the paragraph formatting isn't possible. My workaround is to create different global variables for each paragraph style needed. Doable but I have dozens (hunderds?) of global variables where I could get by with far fewer if I could control paragraph formatting. Plus the placement and management of all those global variables on the layout is tricky at best!
- Tables/cells. There's a variety of tabular data that needs to be presented. Products being recalled for Food Safety violations for example. With Global variables, cell formatting like borders and shading isn't possible (is it?). As a workaround I've created a relationship from that utility table back to the records in the table where those records exist and display them in a really (really) long portal that shrinks-to-fit. That's in one of the sub-summaries so it appear/disappears as needed. Of course you all immediately noted that the 200 row portal that shrinks if they only have 3 rows is ok...until they have 201!
So these two items are the sticking points I've found and worked around semi-successfully so far. Any ideas or thoughts are seriously welcome. Thanks and I hope this has helped others.
Everything you want to achieve can be layed out using CSS and html tables...
Thanks Lyndsay. Been there already tho.
I tried that first in fact, as it would allow for exactly the control I need.
Printing a webviewer or outputting a webviewer layout on iOS unfortunately doesn't work out. iOS webviewers are fine for *display* but the output quality is horrible. Now if I could render global variables that contained html directly on the layout....that'd be cool!