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

Reports. Can Summary Band be made optional at runtime?

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,305
FR
I have a report where the customer would like a summary page - detailing a variable number of records (probably no more than 5/10 or so) but only if there are any records to show.

I can make the band, and make the contents visible only if there are details to show, but I get a blank page if there are none - not good because that is the same cost to them as a single (colour) photocopy and the customer would prefer not to waste paper.

I could make 2 reports, one with and one without the summary band, I could make a single report (which is what I have done for now) by joining two together (one which is just the summary band) at run-time using the NOPAGEEJECT option when there are details for the summary

I suppose I could even shove the .frx out to disk locally and hack it to remove the summary band at runtime...

But I just wondered if I was missing a trick, is there a way to programmatically make the summary band optional at runtime?

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Hi Mike and Griff,
Mike, I do agree with you, but in the case of what I needed the report to do, it was really the only option (writing it in code). I forgot about PCL and how useful it is too, and as you say Griff, printers do still have it at their hearts.
My 2 cents on this was just to show there are more options. Some are better than others for sure, but it is an option. I actually liked writing in the HP/PCL and to your point Mike about WYSIWYG, it was back in the DOS days, so we didn't have that benefit anyway. :)

Just an alternative, in the event someone was looking for more options.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Point taken, Scott. In fact, back in DOS days I also used to write directly to the printer, although it was just as likely to be in the Epson control language (ESC/P) as in HP's. Up to a point, you could make the code portable between printers by storing the control codes in variables and inserting those into the lines of text. You also had to deal with page headers and footers, page numbering, and so on. But it was certainly do-able.

I think there was also a rudimentary report design tool in some versions of FoxPro for DOS, but I don't recall ever using it.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

The RW was introduced with FoxPro 1.0. It was ported from Foxbase/Mac. (And it remained relatively unchanged until the reportlistener was added.)

Prior to that, in Foxbase, the report writer was basically the dBase report writer. They even replicated one of the bugs that would lock up your system if a header expression got complex enough.

We've always had a report writer.

Dan
 
I remember it and used it in FPD2.x for some things. My occasion in that case was there was no way to add white space to a page between sections without knowing what the output would be first. So it would get generated to file, check the number of lines, then add white space (blank lines) between sections so that they were all balanced across the page (single page output). It kept those with a lesser experience from appearing to just have a 1/2 page resume...
It was interesting, and I've never had a need for it since...
But the report writer couldn't do it.

Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
You could stick in a UDF() as the report expression and have it return as many CRLF as you need, mark it stretch with overflow. Done it many times back in the day. Things were easier when it was all character output. [bigsmile]
 
Dan,
Interesting, but how do you know how long it is unless it's been generated first... so that was the issue I had. I needed to know how big it was going to be (edit boxes had a max length, but some would be empty, some might have only 1 short sentence). So we had to generate the text file first, determine the number of lines, then shove white space (as a UDF) in between the paragraphs to balance the page as a whole. It was a fun challenge that I've not encountered since, nor seen anyone else do. (Not that it might not exist). My whole point was that sometimes the report writer can't meet the requirement, and then getting creative, writing to HP/PCL is not that bad an alternative.


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 

Even if you set, for all contents in summary band, the properties "Print when" -> "Remove line if blank" to "check"?
Dear Griff, I am only a newby regards to you so I ask you to not mind, but may be...

All the best,
Eugen
 
Griff,

This has been an interesting thread, with some useful digressions (not least on GDPR). But I was wondering if you had decided how to solve the original problem?

The reason I ask is that I have been reading up on the Mind’s Eye Reporting Engine. I noticed that it has the ability to add multiple reports to a single report job. That might work for you, as it would let you have a main report and a separate summary report. Unlike with VFP's NOPAGEEJECT, it would let you preview the combined report as a single entity. Also unlike in VFP, the different reports can have different orientations (probably not so useful in your case). You can also send the combined report to a PDF.

These features probably won't justify the purchase price in this case, but I thought I'd mention the possibility in case you are still looking for a solution, and also for the benefit of anyone who might be interested.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike

Well, I have implemented the two report and NOPAGEEJECT option, it is in production and I await the user actually using it - I have a new rep at the client's office and he seems to be having a little trouble with the idea of end user testing/feedback, in that he will now probably wait three months for it to be mega urgent and then tell me I have left a comma or full stop off the print out.

That and I can't invoice until he says it's good...



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top