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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to correctly make a box on a VFP-Report 2

Status
Not open for further replies.

Koen Piller

Programmer
Jun 30, 2005
841
NL
Hi,

I need to make on a report a box containing nNumber of fields.
When I set the top line of the box just above the detail band and the bottom line of the box
just over the bottom of the detailband I get a box high as the detailband the records which fit into that box are printed inside the remaining outside.
Increasing the box with just 1 pixel in height will result in a box spanning the whole page.
See picture enclosed. (Have enlarged the picture of the box in the report designer here, to make things more clearly.
Anybody who can advise me how to arrange a box with all the records, inside?
It seems to me this is also an old similar matter, which was by that time solved with instructions of Mike.
This one I can't get it working.
Regards,
Koen
 
 https://files.engineering.com/getfile.aspx?folder=fd5fac8a-587c-45e9-b7b4-5c10be198046&file=Naamloos.png
Olaf,
Fortunately my tst form using a one dbf only, no relations involved.
Maybe.....
Have a nice weekend
Koen
 
Hi,

There seems indeed to be something buggy when rendering boxes - Labels and H-Lines are positioned correctly, boxes are not. I tried both ReportBehavior 80 and ReportBehavior 90 - no difference
This is the design

CaptureReportDesigner_osoghp.png


and this the output

CaptureOutPut_bwybph.png


Maybe Cathy Pountney knows a way out

hth

MarK
 
Olaf,
I am so sorry, and feel also sorry you gave me the impression you did not explore the two test reports I have uploaded:
planning.frx works with boxes: fine
The boxes are placed according to the tip of Mark here.
planningtest2 works with lines: a mess

Now I want to insert another band under my Detail1. Try it with planing.frx, I get a mess
No need to do this with planningtest2 as it is already a mess.

The screenprint from your last mesage is not so clear to me. What are lines and what are boxes and what goes wrong where as the whole thing looks like a mess to me.

Yes if Cathy would jump in and help that whould be great, or Lica Nichols, however it seems she is not active in advising anymore. :(
Maybe it is a good idea to post this question on aToutFox hoping that Francis wull notice my request. Or do you have a better idea?
Regards,
Koen

 
Hi
It gets even worse when you work with rounded rectangles!

Design:

CaptureReportDesigner_gcuj2c.png


Output:

CaptureOutPut_bxwq2y.png


hth

MarK
 
Hi,

After playing around with the Report Designer I found out that a rectangle is NOT rendered correctly when traced between the DetailHeader and DetailFooter. Rectangles are rendered correctly in Groups, Columns and also Pages

ReportDesigner:

CaptureReportDesigner_1_sxgfsi.png


Output:

CaptureOutPut_1_stwp6i.png


hth

MarK
 
Mark,

When you take my planning.frx (uploaded July 5th at 21:40) would you be able to enhance it with an other band, without the boxes being messed up?
Or otherwise show me how to construct a report with:
1)a ground textboxes in a box
2)below that a listing of text boxes (not in box 1)
The data is plain simple, one cursor only, if requested I could construct a second cursor with data for 2) This 2cnd cursor has no relation to the maincursor.
Basic, basic - no 'complicated' relations and so on.
Regards,
Koen

P.S. My test reports are with fields in Dutch wordings, if you want I could compose a new test now with 100% English wordings. And maybe we should start a fresh new topic as this one gets toooo long with much side problems which are not relevant to my basic problem.

 
Hi Koen,
1)
ReportDesigner with 3 columns - Rectangles over Page, Column and Group - H-Lines in DetailHeader 1 and DetailFooter 1

CaptureReportDesigner_2_hwknky.png


Output

CaptureOutPut_2_sbbcmz.png


2) Unfortunately VFP does NOT render the boxes correctly if you stretch them form DTHeader to DTFooter - you have to adopt Olaf's suggestion 4 lines - 2V and 2H

hth

MK
 
Hi Koen

Or otherwise show me how to construct a report with:
1)a ground textboxes in a box
2)below that a listing of text boxes (not in box 1)

ad 1) This does not work (from my experience) since you'll have to stretch the box from Detail Header to Detail Footer. You may want to adopt Olaf's suggestion - 2V and 2H lines - or have a box around the set of textboxes in the Detail bands. But then each set of data will be "boxed" (see below)

CaptureOutPut_4_ccenv1.png


hth

MarK
 
...

My explanation to all this: since Multiple Detail Bands are only around since VFP9, "MS" probably forgot to test this possibility (Box from DTBandHeader to DTBandFooter) and we have to rely on a workaround.

hth

MarK
 
Hi Koen,

Please don't stretch the V-lines over the Header and Footer bands (see below) - and everything should work fine.

CaptureReportDesigner_3_eqihw4.png


hth

Mark
 
Hi Mark,

thanks for all these Tests. Koen, that was him picking up, not me.

Taking the final words: Using multiple is problematic. I see that using Detailbankd Footer and HEader or not, using single lines instead of a box also doesn't help. So I don't see a fix in that problem, unless you can do with just one Detail band and rather do more groupings or otherwise reorganisation of the report sections.

Or use something like Word automation creating a docx and printing that.

A solution you might have is neither using boxes nor lines but just a reportlistener with its Render method. Looking into how foxypreviewer uses that might give an insight, then you'd draw lines with GDI+ functions. Maybe based on indicators in the source DBF pointing out to your specific reportlistener when to begin a box (drawing the top line) and from then on until the end signal printing side line segments in whatever current detail height up to the bottom line.

Aside of the hint on foxypreviewer I don't know how to straight from the top of my head and you might put that down and rather use another alternative, as that's simpler to apply than digging into reportlisteners and gbi+ drawing. It sounds trivial, but surelys has its hurdles also with DPI and not drawing too long lines. As far as I know you are getting a render event for each control of the report and not for each record of the dbf, and I don't know whether the graphics object you get at hand is the current page, the current band or even just the rectangle forseen for the control. That also doesn't make it simple.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Mark,

Your tip results in single boxes containing only one record. Not the desired boxes containing all the records.
Please change my planningtest2.frx to confirm my findings.

Regards,

Koen
 
Well, Mark already shows, that you can only have multiple element boxes with groups, so everything has to be done with grouping.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi Koen,
What you intend to do is NOT feasible! Either you have to drop the second detail band and put those information into the group footer or find a different solution.

Design

CaptureReportDesigner_4_yt5pqe.png


Output

CaptureOutPut_5_bidjev.png


Please do also read Olaf's comments.
hth
MarK
 
One more thing about the behavior of two detail banks: They'll not print like groups. You don't get 5 records of detail1 and then 5 records of detail2. detail1 and detail2 print alternating. That's also causing the messed box drawing with two or more detail bands. What you want is more groups. You want the detail band to be different per group or subgroup, then mahe multiple report controls at the same postion of the sam detail band and use their printwhen. But don'T introduce new detail bands.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
Interesting, but please baar in mind, I cannot create a second band when I have in my fiest band a box, with groups. Box or 4 lines, no difference, they get messed up as soon as you insert a second band. The question is not why but how to, either a bug/feature os mis coding.
Koen
 
Hi Olaf,

That's also causing the messed box drawing with two or more detail bands.

I doubt this. Then the Controls in the DTBandHeader and the DTBandFooter would not print correctly either. However they do (please see below). Furthermore the messed box drawing also occurs with ONE band only. I think it is simply bad coding from the MS-Team.

CaptureOutPut_3_dhvqas.png


MK
 
Koen

you introduce a new band to print something beneath the previous, don't you? But as I said two detail bands (both within the same group) print alternating. You print record1 band1, record1 band2, record2 band2, record2 band2,.... thus you get messed box lines. You never get a secondary box with a secondary detail band.

Mark all the time shows how multiple blue boxes get into an overall red box, simply by having more groups in the data.

I assume (don't know) in the box you plan with detail2 band you don't want to print the same fields of your cusor. Either you still do, make it a single field even if it should contain different data, as long it's all string data you can first print names then tasks or whatever. If you want to print other fields, then you can add new report controls into the same detail1 band put them at the same position and only print one of them depending on which group is currently printed.

But the way a second band is processed is ciorrect, that's not a bug, that's never changing, you thing first all data is printed with detail1, then all data with detail2, but it's alternating. Simply startt a new simple report and have 4 sample records and see for yourself.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
have you tried what you propose here on my test Report form I have uploaded? The one with the boxes?
Have you seen how nice it prints?
Have you than just introduced a second Detailband? Do not even put anything not even a label nor textbox in that new band!
See what happens?
Regards,
Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top