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
Koen, are you not listening?

I explicitly say that NOT to add any band.
All you need is distinction of more groups with the field defining the group. No more bands!

Bye, Olaf.

Olaf Doschke Software Engineering
 
I only suggested to start a simple new report with two bands so you see EVEN WITHOUT ANY BOXES, they print in an order you most likely never would have anticipated. They print alternating, interleaved, not one after the other. So additional bands are no solution to your problem anyway.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
Thanks for the idea.
I will now produce two reports and combine them. Trusting and convinced there is a impossibility in the by me proposed layout.
Regards,
Koen
 
No, also not what I said.

Mark shows multiple blue boxes are possible, doesn't he? That's not done with a band per group or box. That's done with a field to define multiple groups with multiple values.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
Your tip to make use of the blue boxes as shown by Mark do not make me happy.
I will go for 2 reports: one with boxes one without. Combine them to one report.
Thanks for your suggestions.
Regards,
Koen

Naamloos7_oq7rdv.png
 
Just remember GROUP BY in SQL is something completely different from groups in reports. And you don't make a band per box.

Otherwise, I don't know how else to make things clearer to you, Mark has posted a lot of screenshots together with report layouts to demonstrate.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
I know for sure the difference between Group by in SQL select and group by in reports.
Have you seen how the blue box bottomline is composed?
I dont know how to tell you that Mark has confirmed the layout I was after is not workable and I dont know why you keep on hammering on a different thing each time. This unknown fact about the 2 group by clause was never discussed in this topic before? What makes you think I did not know?
Regards,
Koen
 
The topic changed as we experienced and tested a few things on the go, that's just natural. And the group by thing vs report groups: Well, you wanted two boxes underneath each other, didn't you? You don't need 2 detail bands for that matter, but two groups in the data.

Anyway, do as you think you're getting to your goal.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi,
An additional illustration how erratic VFP handles its reports (NO fields - only static controls)

Design

CaptureReportDesigner_5_c6en1z.png


Output

CaptureOutPut_6_zvkyfz.png


hth

Mark
 
How are the objects floated? I'd expect such a page high box, if the ends of it are anchored to page header and footer. Anyway, you can only get lines to stay fine when not leaving stable grounds and it's not even very clear what the limits of this stable ground are.

I just recently had problems with a legacy OCX based in VB5 which crashed with an unspecific "Overflow" error most of the times after something was printed, even if just previewed. Maybe some Windows update broke something with winspool or VFPs report engine breaks something or gdiplus has changed and we see first effects of the legacy state of VFP. As said I remember this working differently but so far I also had no calls from customers of previous days for which I created reports with boxes. Might also already be replaced by something else and they are in the hands of other ISVs. Also, in many cases I only used horizontal lines to separate groups.

The simplest solution is surely like Koen to go other routes instead of forcing it into one report. My goto alternative would always be word or if office isn't available for automation create HTML output.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Hi,
Olaf said:
you wanted two boxes underneath each other, didn't you?
No that's not my design. Don't know where you got that opinion. There is a message in this thread explaining what my proposed layout is, please reread carefully.
To create a HTML output will surely possible, however I will go for a report created VFP in which case I can, by using FoxyPreviewer, leave it up to the final user in which format the report is to be saved, a very elegant option in FP.
Although the HTML output in this case is not the most elegant as boxes and lines with a fine hairline thickness are rendered in lines of 2pix instead of 1 only. The PDF and MS WORD conversion works in this respect correctly. Save the report in Excel results in an mess. So for those users who want to save into Excel an other option should be used. Vilhem created a very fine class to save a cursor into XLS or XLSX. For that output the boxes layout is not applicable.
So to conclude:
To created a report in the by me desired layout I shall have to make two reports which to be combined. To create an Excel output a separate procedure must be composed.
Thanks everybody who helped me with several very useful tips on this one.
Regards,
Koen
 
Koen, as far as I remember you put a detail2 band there just to sketch what you want, just a label to see how that prints, and later wanted to put a second list of data there.

Now let me just do as you ask and look back what I find about your desired layout...

Koen said:
I just want to add a second detail band with some text and labels inside.
Problem is that when you add a second band the boxes on the first band are affected.

Well, first of all, a detail band only prints with a record of data, and in fact, two detail bands on a cursor with say 10 records mean printing 2x10 bands. So you can't use a detail band to only print a text/label once. That's where my interpretation of your misconceptions about the use of bands start. And I haven't forgotten I was suggesting to use the header of the next band to end the box and print something else. But a) Then that something else would be in another alias and you'd use the targetalöias of that band so it doesn't interleave with the printing of the main report cursor and b) I assumed you wanted to print another list of data, not just one line/summry, whatever.

Sorry, this was a cascade for misconceptions after misconceptions. I just gave the answers I gave in the understanding of the problem. And I gave some hints tested, some untested and later reverted. This thread shows all the behind the scenes of evolving something to a solution or giving up and finding alternatives.

And about your interpretation of my tip to use HTML: I wasn't talking of a HTML reportlisterner, not FoxyPreviewers HTML output option. I was already talking about alternatives of VFP reports. No report at all, instead outputting HTML, you can use a SCAN loop and Textmerge to create HTML, merge that into a HTML skeleton, even have Javascript inside for interactions or drawing on the HTML canvas, eg drawing boxes, if HTML tables won't suffice. Without any hassles of the VFP report writer. You can then show it as preview in a browser control instead of the report preview and you can use ShellExecute to print HTML to PDF or a real printer or whatrever. If the report engine doesn't fit the needs as easily, then other output mechanisms can solve the problem. Just like Word automation is another solution. HTML just has no requireement of an installed Office.

I don't know, maybe you're in some kind of a deadline stress. I don't condemn you, I just observe your misinterpretaitons and wrong assumptions and ask openly why.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Olaf,
my misinterpertations? Sorry for that. I merely wanted, for the record, to put it straight and correct what you assumed and seemed to recall.
No I dont want a second detail band with boxes. I want:
Koen said:
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.
No misunderstanding?
Regards,
Koen
 
Yes, and if you know a detail band is printed as often as there are records in the report driving alias or targetalias of the band, you can only make one assumption about the "text" in your quote:

Koen said:
...a second detailband with some [highlight #FCE94F]text[/highlight] and labels inside...

You can only make the assumption that this "text" will come from data and isn't just a one time text like a caption you already write at report design.

So for about the fourth time (?) You don't use a detail band for that, even if the text isn't just a fixed text string literal, then you use a report variable and print that, And you print that into a footer band.

Bye, Olaf.


Olaf Doschke Software Engineering
 
Olaf,
correct, Text is supposed to come from a cursor.field
Regards,
Koen
 
Fine, then we're back to printing a list of things. But you still don't seem to get the order of printing with two detail bands.
You don't get all records printed with detail1 band and then the last record printed in detail2 band. Two detail bands print alternatingly. Unless you specify the detail2 band get its data from another alias.

All you really need is data thath goes into another group. Now, you don't want the box surrounding that further data? Fine, simple, use the printwhen condition on the linens so they only print for the first group.

Bye, Olaf.



Olaf Doschke Software Engineering
 
Olaf,
Sorry, but it won't work. The moment you have a detail band with a box and a group by, you introduce a second band the first one gets mixed up. :(
Solution I found is to combine two reports: one with the box in the detail band and the second one for the other data.
I am extremely satisfied with this solution .
Regards,
 
Well, running in circles. You don't introduce a new band.

Just a question: How did you assume the report would know when to switch from detail1 to detail2?

There is no logical recno to switch or anything like that.
The box layout depends on printing

groupheader
detail1
detail1
detail1
detail1
gropufooter

Introducing detail2 you get

groupheader
detail1
detail2
detail1
detail2
detail1
detail2
detail1
detail2
groupfooter.

And, of course, that messes the layout.

Bye, Olaf.





Olaf Doschke Software Engineering
 
Hi Koen

There is a solution to your problem, but you'll have to process your data/organize them differently and it relies on Memo-Fields

CaptureOutPut_7_ogqlyp.png


In the zip-file you'll find the PRG, the DBF and the FRX/FRT files. You may of course adapt them to your needs.
hth
MarK

 
 https://files.engineering.com/getfile.aspx?folder=34b6ae75-bb0e-4550-91d6-bab7a0fd3f84&file=planning.zip
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top