Jump to content
Server Maintenance This Week. ×

Getting data out of FileMaker to print externally (from within FM)


Wodin

This topic is 4591 days old. Please don't post here. Open a new topic instead.

Recommended Posts

The subject might be a bit confusing :) Sorry.

EDIT: Please, if you think I'm just doing it wrong or you have any other ideas regarding this, let me know. Thanks.

I have a FileMaker script that builds up some HTML+Javascript to generate a table and display it in a web viewer. Now I want to be able to print the data instead of just displaying it in the web viewer.

The reason I'm doing it in a web viewer is because I'm doing a lot of massaging of the data in Javascript before generating the table. Previous attempts to do something similar in FileMaker were abandoned. Anyway, I'm also generating graphs in a similar way and the graphs at least need to be in the web viewer because that allows tooltips etc. that FileMaker charts don't support. It also works on the iPhone this way, unlike the built-in charts.

So, the problem is printing the tables (I'm not trying to print the graphs).

If you print a layout containing a web viewer, the web viewer is a fixed size, not matter how much content it contains. Also, FileMaker prints any scroll bars the web viewer might contain (and printed scroll bars are not very useful.) The whole web viewer appears to be rendered as if to screen using a fixed size and then printed like that. This explains the scroll bars and also the fact that any CSS specific to printing is ignored, because the web viewer acts as if it's rendering to the screen rather than printing. All of this means that you cannot print more than one page of content. Or if you make the web viewer larger on the layout you might end up with blank printed pages if your content only fits on one page.

A workaround on Windows is to use something like window.print(); from within the Javascript code in the web viewer. This works pretty well. Unfortunately I can't get it to do anything on OS X. It appears that the web viewer ignores the window.print(); statement. Maybe for security reasons it disables some things? I've seen suggestions to call FileMaker's Set Web Viewer[url: "javascript:window.print()"] script step, but this also does nothing for me.

I'm using FileMaker Pro 11 and I've been testing on OS X 10.6.

There's no real reason to use the web viewer when printing. So it seems that producing the HTML+Javascript (or something else if it will be easier to work with) and using an external program to print it might be the solution. e.g. saving the HTML+Javascript to a file and then telling Safari to load and print it. Or perhaps producing a PDF and calling Acrobat Reader or Preview to print it.

Does the above sound feasible? Any other suggestions?

If producing output for some external program to print sounds like the way to go, how should this be approached? It would be best for this solution to work on Windows and Mac, but since I have a workaround for Windows, a Mac-specific solution would be acceptable too.

So in summary, I want to click on a button in FileMaker which would result in the data being printed, but just printing the FileMaker layout does not work properly. How can I do this external to FileMaker, but still from within FileMaker, or what other ideas are there?

Thanks in advance.

Edited by Wodin
Link to comment
Share on other sites

  • 2 months later...

This topic is 4591 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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