Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aligning multiple section of a line in report writer

Status
Not open for further replies.

sdocker

IS-IT--Management
Aug 12, 2010
214
0
0
GB
I am trying to include a line of text whose center portion is bold and underlined.
I get different results with an HP printer, a PDF printer and the report Preview.

They look something like this...I am trying to include a line of text whose center portion isbold and underlined.

I believe this is because the fonts they use are not exactly the same size. even through it is the same named font.
The font i am using is Arial.
Is there another font that perhaps would be more consistent over the range of printer drivers, or does anyone have any other suggestions?

Thanks,
Sam
 
You would certainly expect to see minor differences between a printer, a PDF and the screen. There are differences in resolution, and in font metrics. But these are likely to be very slight - usually not even noticeable. You might be able to overcome them by using a fixed-pitch font such as Courier New, but that might not be acceptable to your users.

Also, keep in mind that what you see in the preview depends in part on which printer is currently selected. Even if you never print the report, VFP uses the current printer driver to determine the font metrics. So if you preview it on one printer and then print it on another, you can expect to see minor differences. That might also be true of a PDF.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks Mike,

Unfortunately, the differences are quite significant. To the point where I end up with overlapping or a large gap.

I have ReportBehavior set to 80. Could that be part of it?

Sam
 
I doubt if ReportBehavior would make a difference, although it's worth trying it both ways.

You might also try using other fonts, just in case there is some defect on your Arial font (although that doesn't seem likely).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks,

It isn't a font defect. The situation occurs on many other machines.

Sam
 
OK, let's be clear about exactly what you are doing.

I assume your report has got three labels, all in the same line, right next to each other. The left- and right-most labels have a normal font. The one in the middle is set to bold and underline. Is that correct?

If so, what result are you seeing? Can you post a screen shot of it?

And in what way do the results differ between the print, preview and PDF versions?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

I forgot to mention.

The frx may look skewed but it prints nicely on an HP x576. It also looks OK in Report Preview, as long as the HP x576 is the default printer. (Current printer driver, as you mentioned.)

Sam
 
Sam,

I asked you to post a shot of the relevant fields in the report designer. What you posted is a Word document containing an image of some text. Is that image taken from the report designer? If so, it tells us nothing about how the fields have been set up in the report designer.

But, never mind. You wrote:

it prints nicely on an HP x576. It also looks OK in Report Preview, as long as the HP x576 is the default printer.

Are you saying that the problem only occurs on some other printer - other than the HPx576? If so, that strongly suggests a problem in the printer driver. You should check with HP to see if there is an updated driver.

I just read your FOXSTUFF article on Crystal reports. Could this be a possible solution?

Crystal Reports is much better than the VFP report designer in handling this kind of long flowing text. But switching to CR because of this problem would be a drastic solution. It will cost you a lot of time and effort (and some cash), and will require some fundamental changes to your application (and its user interface). Let's try to solve the existing problem before taking that step.

Mike





__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 

Here is the FRT file.

It works fine with the HP x576 because I manipulated the sections of the line based on the output appearance when using the HP x576. The problem arose with users using other printers.

As far as CR, the time is what concerns me most. The effort and cost are manageable. Also, I am under mounting pressure to move to visual studio, so learning CR will not be a total waste of resources.

Sam
 
 http://files.engineering.com/getfile.aspx?folder=f9ac74fa-7734-4f7a-8189-f2fa30ef3bd0&file=page3___-16.FRT
Sam,

Before I look at the FRX, I'll throw in some other suggestions for you to consider:

1. This report is clearly some sort of government form that is designed to be filled in by hand, on paper. The text that is giving you trouble consists of instructions for filling in the form. I wonder if that text has to be reproduced exactly the way it appears in the original. In other words, will the government department accept the completed form, with all the text as required, but without the one instance of bold and underlining that is causing the problem? After all, that won't affect the way they process the information on the form.

2. Consider doing the whole thing in two passes. First, use a word processor or desktop publishing program to print the fixed text, boxes, headings, etc. Since this will be the same in every case, you can print a stock of pages like that. Then, when you need to print the actual form itself, overprint those pre-printed pages with your report, which will only contain the variable items.

3. Consider creating an image to hold the long paragraphs of fixed text (a separate image for each such paragraph). Create the images using your favourite image-editing program (Photoshop, Paintshop Pro, Paint.Net, whatever). These programs allow you to type straight text into an image, and to make very fine adjustments to the formatting and positioning. Then place the images in the report, along with the variable data.

These are just ideas for you to consider. The ideal solution would be to find the cause of the problem and to fix it, but these alternatives might be worth keeping in reserve.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I guess I have to ask once again! What's the value of set("ReportBehavior")?

And also, is the "Save printer environment" checked (Report -> Properties)?
 
Mike,

Suggestion number 1 is the most viable. In fact, I have a call into the Government agency to talk about this. Thanks.

Number 2 won't work. This app is distributed to accounting firms and I can't burden them with special paper to load, etc.

Number 3 is being considered; but how do I know the variable data, which may be at the end of a line, will be positioned correctly with all printer drivers? Also, it may be easier to learn and use CR.


tbleken,

ReportBehavior is set to 80.
Save Printer Environment is NOT checked. I also hack the FRX files and clear the tag1 and tag2 fields and REPLACE EXPR WITH 'ORIENTATION=0' + CHR(13) + 'PAPERSIZE=1' + CHR(13) + 'COLOR=2'.


mjcmkrsr
Will be considered.

Thanks Everybody
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top