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!

Report width throughout

Status
Not open for further replies.

Steve-vfp9user

Programmer
Feb 5, 2013
334
0
16
GB
Hello all

I am trying to set the width of a report for its complete length including header, details and footer.

When I change the setting to 6cm via Report Properties (the report is going to be like a narrow till receipt), it changes the detail band width but not the header or footer bands.

I did try to create a label but this has the same effect as the report and I also looked at using Page Setup > Paper Size > but the nearest to 6cm is enevelope C8 which isn't on the list of options.

When you click on the header or footer band, you only have the option to change the height not the width of the band.

How do I set the page of a report to the same width throughout?

I'm using VFP9 with service pack 2.

Thank you

Steve Williams
 
Setting the page width in Report Properties doesn't actually change what is printed. It just changes the design area that you see on the screen. It will still print the entire width of the page, as seen by the printer driver. It is up to you to make sure that your data all fits in the left-most 6 cm the page. That applies equally to the detail band and the various header band.

If you are printing some sort of till receipt, then presumably you are using a printer that is capable of printing that width of paper. If so, then the page sizes available in the Page Setup dialogue (as opposed to Report Properties) should have that width available. If you are not seeing that, are you sure you have selected the correct printer driver?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I just now did a search for one of the less common Page Sizes which I found in my Print Setup - Page Size.
I found it listed in the system's Registry as a DsDriver - printMediaReady and DsDriver - printMediaSupported entries for each of the printers that I can use.

I am not sure what would happen if I were to ADD another entry to that for a different size page, but that is where the page size values you see are coming from.

Regardless of having found these, I agree with Mike above, if the specific selected printer is not supporting the paper size you need, then either limit what and where you print on the VFP Report Form or select another printer.

Good Luck,
JRB-Bldr
 
See it that way: The detail band width is not page width, but column width. And the detail area is the only one where VFP enables columns, the header and footer sections are never split into columns. These bands have the paper width and the only way to really change that is adding more paper types, that info is taken from the printer driver.

I guess the whole report width also is in the FRX table somewhere, but I wouldn't care. I also defined a report for a thermal printer, I simply shrank the height of footer and header to 0, and didn't use them.

And what you set as column width determines what you see for design, that isn't replicated if you turn up the number of columns, but turn that number up first instead and you automatically get detail bandwidth = paper width/columns. Now that shows the meaning of that width. Paper width is still assumed as wide as header and footer bands are.

Bye, Olaf.
 
I had a hard time myself with the report for that thermal printer. At first, I even didn't have the printer itself nor driver. I think it helped once I had the driver installed, to set it as default so it showed as the reports printer (if you do check the checkbox to "Save printer environment") for the time I designed it. In fact, with such reports only designed for that one printer, it can also be kept that way.

See if you do so and set up the paper, that the printer might even set your report to the exact width. I don't work on that application anymore and have given it off my hands, but IIRC I still had the wider header and footer and it still worked.

A thing that was tricky is, I had to have a margin, though I needed to print on the whole width of the paper. The margin was because a ribbon was wider than the paper. This was not thermo-transfer paper just getting black at places it is heated, but a thermosensitive ribbon transferred to some high gloss paper and the wider of the two determined the printer "paper" width. There was a mode for automatic measuring that and that was done with a photosensor sensing an LED. Of course that only shines through when it neither is blocked by the paper nor the ribbon, it always measures the wider part and that becomes the "paper" width.

Bye, Olaf.
 
Another very informative post Olaf for which I'm grateful. Fortunately, I do have the thermal printer but still waiting for the paper rolls to arrive! Hopefully once they do, I can try it out.

I will post back once I'm up an running.

Appreciate all the posts on this thread.

Thank you

Steve Williams
 
All

An update on this.

I have managed to take on board the advice from the posts on this thread and when I preview the report, it is to the required width.

That being, I have the till receipt printer and now some paper rolls (60mm) however, when I print the desired receipt it prints as if the length of the report is A4.

I am hoping I can explain and show on here what I mean.

In the header I have the address, transaction number and all the other required fields etc - Perfect
In the footer are the relevant fields including the totals of the transaction and footer message - Perfect
The details band is the issue I need to resolve. At the moment it looks like this:

Header info 1
Header info 2
Header info 3
Header info 4

Prodcuct 1
Prodcuct 2
Prodcuct 3

Big gap from here to the footer







Footer info 1
Footer info 2
Footer info 3
Footer info 4

So with the above in mind, I need to have no gap between the last product item and the footer:

Header info 1
Header info 2
Header info 3
Header info 4

Prodcuct 1
Prodcuct 2
Prodcuct 3

No gap here after last product

Footer info 1
Footer info 2
Footer info 3
Footer info 4

I have tried setting the fields in the detail band to "Fix relative to bottom of band" but that has no effect.

How can I shrink that gap?


Thank you

Steve Williams
 
Steve, have you set an explicit height for the detail band (in the Data Band Properties dialogue)? And have you set a value for "Start details set on new page when less than" (same dialogue)?

I'm not sure that those settings are the cause of the problem, but it might be worth a quick check.

Also, are there always exactly three products per receipt? Or is that just in your example? In fact, is there a fixed length for the receipt, or does it just grow and shrink according to the number of products?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike

"Also, are there always exactly three products per receipt? Or is that just in your example? In fact, is there a fixed length for the receipt, or does it just grow and shrink according to the number of products?"

There is no set amount of products as this will vary depending on the transaction so I cannot set the detail band to an explicit height. No other changes have been made to the report.


Thank you

Steve Williams
 
Yes, I can see how that would be a problem. VFP expects the page of a report to be a specific height (as well as a specific width). In this case, it is obviously assuming that the height is equivalent to the height of your header and footer bands and that of six lines of product information. If you only have three products, it inserts some blank lines to make up the difference (and to ensure that the footer is in fact at the foot of the "page").

The only solution that comes immediately to mind is to dispense with the page header and page footer completely. Instead, put the required data in a group header and group footer. That would work because the group header and footer bands "float" on the page. Might be worth experimenting.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Sounds like a plan Mike!

I'll give that a go and post back

Thank you

Steve Williams
 
Regarding the report, I added a "Report has title band" and moved the header info into that band.

I then added a "Report has summary band" and moved the footer info into that band.

The detail band was unchanged.

When you view the report now it is working as it should with no gaps however I need to test it whilst the printer is connected and I'm hoping the NOEJECT command at the end of REPORT FORM etc will do the trip as the printer itself has a tear off.

I'll post back tomorrow and let you know the outcome.

Appreciate the posts and advice all.

Thank you

Steve Williams
 
I've just managed to try it out now with the printer connected and it works perfectly so if my last post helps with a solution then there it is.

I appreciate the time you guys give to reply.

Thank you

Steve Williams
 
Steve, delighted to hear you've got it working. I can see how Title and Summary bands would work as well as group headers and footers.

You mentioned NOEJECT. In fact, that has no effect at all. It is only present in the language for backward compatibility with earlier versions. In any case, I don't think you need worry about the tear-off - as you have probably already found.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike

My logic behind NOEJECT was thinking that the length of the report might keep going however, you're right, it makes no difference and I am happy with the end result.

Appreciate the inspiration and advice from this forum.

Thank you

Steve Williams
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top