TOPIC: Blank pages, page not fitting in a vertformat
#421
Blank pages, page not fitting in a vertformat 3 Years, 10 Months ago
Hi

I was pretty much baffeled by this untill I realized that the vertical format does not produce a generated output but a grouped output.
A nice feature to add to the vertical format would be a flag indicating if the data should be groupped (default) or allowed to break across multiple pages.

For the impatient the following code should do the trick (A bit of a hack from the QueryFormat)...

Code:


// Copyright (C) 2000 Suneido Software Corp. All rights reserved worldwide.
Generator
{
OutputFormat:false
New(@args)
{
.Params = _report.Params;
.quedFmts = args;
.append_data = args.Member?('data') ? args.data:false
.font = args.Member?("font") ? args.font : false;
args.Delete("font")
.outputformat = .Val_or_func('OutputFormat')
}
// handle queuing
More()
{
.list = Object()
if (!.quedFmts.Empty?())
{
fmt = .quedFmts[0]
.quedFmts.Delete(0)
.Append(fmt)
}
if (!.list.Empty?())
for (fmt in .list)
super.Output(fmt); // Generator Output
// so lack of output isnt taken as eof
.list.Delete(all:)
}

Append(@args)
{
list = Object()
data = args.Member?('data') ? args.data : .append_data
for (fmt in args.Values(list:))
{
if (Object?(fmt) and fmt.Member?(0) and String?(fmt[0]) and
fmt[0].Substr(0,1) is "_")
{
name = fmt[0].Substr(1).Capitalize();
fmt = .outputformat[name](fmt, data);
}
else
{
if Object?(fmt) and !fmt.Member?('font') and .font isnt false
fmt.font = .font
fmt = _report.Construct(fmt);
if (Object?(fmt) and fmt.Member?("Data") and fmt.Data is false)
fmt.Data = (fmt.Member?("Field") ? data[fmt.Field] : data);
}
.list.Add(fmt);
}
}
}



Z

P.s.
Sorry about the smillies, they should be a : with a ) Grrrr :)
 
 
#422
Re:Blank pages, page not fitting in a vertformat 3 Years, 10 Months ago
Yeah, this is an annoying problem. Although in some cases it is what you want - if the entire Vert does not fit on the page you want it to get bumped to the next page. (Which leads to the problem if the Vert is bigger than a page.)

It probably would not be that hard to check if a format was bigger than a page and give a more helpful error message.

InputFormat might be what you want in this case.

This is also the reason for having both WrapFormat and WrapGenFormat. Although I see WrapGenFormat is not documented :-(

One issue is that a Vert could be inside a Horz or a more complex layout in which case it is very hard to make it behave like a generator and automatically split over pages.
 
 
andrew