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
Hi Koen,

Under "Properties" of the box click the "Stretch relative to height of band"

Capture_Properties_cb01kl.png


hth
MarK
 
Obviously stretching/floating helps, but what you got very likely was that way, because the band under the detail band was the page footer band, right? If you add further detail bands or a group and use those bands, the box ends at that level. Quite straight what you're asking for.

Bye, Olaf.





Olaf Doschke Software Engineering
 
Mr. MjMcsksrsm,
Olaf,

The option to set the stretch did not result in the desired result.
Funny (or not) this options in Stretch downward and the options in Object position are sometimes disabled. Don't know why.
What do I want to achieve:

A report with a given number of boxes in these boxes a textfield. The box should stretch over the bad and contain these boxes. Don't seem to be a difficult thing, except that the box does not stretch over the band, it remains its size.
See picture enclose. Also constructed a desired output.

And yes this detailband is just on top of the Page Footer.Adding an other detailband in between did not help.

Regards,
Koen
Naamloos2_vmtcap.png
 
 https://files.engineering.com/getfile.aspx?folder=01210f88-9e85-4202-ba59-aaae6867eb53&file=Naamloos2.png
Koen,
I think Olaf is on the right track, try adding a Data Grouping to your report and make sure your horizontal lines of the box are in the header and footer of the Grouping and the vertical line reach the header and footer as well. This should give you what you are looking for. Keep in mind that it can get tricky when the data breaks over two pages but I believe it should still do what you are looking for.

Hope this helps,


Ed
 
Hi Koen,

Data Grouping helps.

Capture_Band_vfoi8z.png


However Ed might be right if the data stretches over more than one page
hth
MarK
 
Hi,
Now I am facing the impossibility to add a second detail band.
This disturbs the boxes in the firts detail band completely,
Any clue what to be done so that I can have in my first detail bands boxes with several contents and below that, in the second detail band several rows with content?
If required, I have a test cursor and report avaiable to upload here.
Regards,
Koen
 
Well, use the same solution again: Let your new detail band have associated header/footer bands. Put the bottom line of the box into the header of the second detail band.
Obviously set the targetalias of the second detail band and have a relation between the alias of the first detail band and the second detail band.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi,
I suppose I have not explained correctly what my prolem is.
I dont want to make a second detail band with some boxes inside, like I have done on the first Detail band. I just want to add a second detailband with some text and labels inside.
Problem is that when you add a second band the boxes on the first band are affected.
I have uploaded an image showing on the left side a part of my report under development with 2 bands, next to that the result. Look at the boxes.
On the right side you can see the same report, now with only one band and the result next to that.
So problem is when you add a second detailband, the first gets messed up.
Obviously I am doing something wrong here, question is, 'how can I add an other detailband to my report without having the first messed up?
Regads,
Koen
Naamloos4_osv0hr.png
 
 https://files.engineering.com/getfile.aspx?folder=9e96f3c8-3cb8-47f9-9150-97c50575b4d1&file=Naamloos4.png
You should limit the vertical lines to the detail band and have upper and lower border right at the edges of the neighbor bands. Then the lines get the correct height.

But now, if you left design has the bottom line for Detail1 in Detail2 and you have multiple records for Detail2, that horizontal line repeats. And you solve that by letting Detail2 have associated header and footer bands, which are only printed once.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,

I have no records in Detailband 2 only 1 label.
I have no lines in the left nor right situation, I have a box. This box shows correctly in the design at right and gets messed up in the design at left, which is basicly exaclty the same as the right design, just only added a 2nd detail band.
If I have only one detailband, with a correct formatted box and set a tick in the 'associate header and footer bands'checkbox, my box get's messed up
When I add a 2nd detailband and set the tick also in either or first and or second band, my box get's messed up.

Regards,
Koen
 
If you only wamt to print a label below detail1 data, then add a footer to that detail band. A Detail band is always driven by data and printed as many times as there are records to print.

Besides that, use four lines, not a box. and keep each line inside a single band. So the top and bottom lines are at the edge of their band. That way the stretching of the vertical side lines works out.

Bye, Olaf.



Olaf Doschke Software Engineering
 
Olaf,
the four lines will result in the same unwanted result. And 'only a label' is in the test environment. In production the band will be filled with a textbox and data.
When I add a footer band, it will automaticaly also add a header band and what is worse, the box is meesd upfind
Any other suggestions?
It looks like I have to find an other layout, this does not seem to work in VFP.
Thanks for all your well-intended advice.
Regards,
Koen

 
It surprises me the box and lines crossing bands are printed with gaps or too long or bold, but if I respect my latest advice it works:
reportlayout_upo3gd.jpg


The box around order details (products and quantity) is made of 4 lines, not a box. And that looks this way:
reportoutput1_djyqdp.jpg


If I stretch the vertical lines in Detail 1 to cross over to header and footer this happens:
reportoutput2_sy6bpc.jpg


If I use a box from Detail1HEader to Detail1Footer this happens:
reportoutput3_ps4am3.jpg


I remembered Reports with elements covering several bands once worked better, but it becomes obvious boxes work worst, single lines work as long as you keep each one in a single band. And it helps to have header and footer as those are only printed once, so there is the top and bottom line.

This is done with Northwind data:
reportldata_u3dxxz.jpg

The relation between orders and orderdetails is done with OneToMany set to .T.

The other relations are normal.

The same principle should work, if you have a secondary detail band for a secondary list. If Northwind would have records about orderprocessing status history that could be printed in a separate box with another Detailband with associated headers and footers.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
would you mind to upload that correct report?
Regards,
Koen
 
You will be able to run this report no matter where you have VFP installed, as the "BeforeOpenTables" sets the Database property of the DE cursors.
If you modify the report you might need to once locate northwind.dbc.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,

Your example would work fine. Unfortunately this does not exactly comply to my situation.
You have a Groupheader1, GroupHeader2 with one field only and a Detail with nRecords.
I have no such only one Detail with a group on field.
What I would like is to have below that an other band (Detail2) with nRecords.
When I introduce an other band my boxes get messed up.
When I replace the boxes with 4 lines, same result: messed up boxes.
I have included a to test report 'Planning' with boxes and working fine. Now please insert a second detailband and you will notice what mess it resulsts.
I have also included a 2nd testreport Planningtest2 now instead of boxes lines.
The reports includes a dbfReport in the dataenvironment.
Please note in the report in the 2nd Band all data from cDag8 should be listed. If ness. I could construct an other data with 2 separate tables, one with fields cdag1 ~ cdag7 plus ID a.s.o. and second table with only cDag8 plus ID a.s.o. however there is no relation between those 2 tables except that they come from one and the same masteralias. So my report is not like your example a situation with relation between 2 tables it is a simple listing of fields.
Now if my desire to have the listing in a seperate band is not possible I shall have to look for an other presentation. 'Problem' field cDag8 does not have a field relation cagdeel.
Grr. I thought this would be an easy thing to do. Turns out to be an unmatched obstacle. However I haven't given up already.
Regards,
Koen
 
 https://files.engineering.com/getfile.aspx?folder=f17b2fe3-25ab-4b4d-9692-6bb30086a25d&file=planning.zip
Anyway, there is something buggy with the rendering.

It could work better with the usual idea of pulling all data into one report cursor with a query instead of making use of relations.

Maybe Monday.

B<e, Ola.f

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top