Has anyone written a routine that will caculate and insert spaces to “simulate” justifed margins. This is a real big deal in trying to automate documents like letters and contracts where the “powers that be” require justifed margins. I need the programimg capability of navision reports so an ODBC document would require editing and is not a real solution.
What you try to achieve is quite tricky in a low-level language like C and impossible in Navision: You have to get the device contents of the printer and the truetype specifications of the font in order to determine how many pixels one space character takes in a given font-size: (Pascal Example:) GetTextMetrics (PrintDC, Metrics); FontHeight := Metrics.tmHeight + Metrics.tmExternalLeading; FontWidth := LoWord (GetTextExtent (PrintDC, ’ ', 10)) Div 10; Are you sure you really need that? Why can’t you use the normal justification-properties in Navision Reports? Marcus
Bear in mind, too, that Navision defaults to Helvetica, which is a non-monospaced font (i.e., not every character is the same width.) And, just to make things more confusing, Helvetica is not one of the standard Windoze fonts: usually, the closest equivalent to Helvetica on the client machines is going to be Arial. And then you get into the whole issue of whether the report is going to use the printer’s fonts or the computer’s fonts… You COULD change all the text boxes to Courier, but that’s a pain the rear end! ------- Tim Horrigan