TOPIC: Column report second column subreport
#692
Column report second column subreport 3 Years, 6 Months ago
Hi

I'm trying to display some detail records in a column beside the parent.
Ive examined multi column label reports but they are applicable only to same row data, what I need is a way to Append the query format to a particular column.
What I tried is
Code:


Before(data) {
return Object('Horz',
  Object("Vfields"
         "name", "place" ,"phone","email","comments"')
   Object(QueryFormat{
     Query() {return "memberService where member is " $ Display(.Hdr.member))}
    Output: (Row service_ID)
    }
   Hdr:data
   }
  )
}



And the query format never gets processed...
Normally the .Append method is called directly (passing in the query format) But if the query is inside the HorzFormat it doesnt appear to work...

Any ideas or hints would be great...

Thanks
Z
Any ideas ?

Post edited by: andrew, at: 2007/02/12 23:48
 
 
#697
Re:Column report second column subreport 3 Years, 6 Months ago
Sorry, there is no easy way to do this.

QueryFormat is a "generator" which means it gets called repeatedly to return more of the report. Generators can go over multiple pages. Simple formats have a fixed size and have to fit on one page.

Generators can only be used at the "top" level - they can not be nested inside other formats normally.

One option would be to write a format that would read the associated records and build a "normal", fixed size format. (As long as you do not need it to run over multiple pages.)

I have been thinking that it may be simpler to build the entire report in memory, but is that feasible for really big reports? (hundreds of pages). Or maybe you could build "sections" of reports in memory. Although that does not totally solve the pagination problem - because you can print arbitrary stuff at arbitrary positions there may be no place where you can put a page break without cutting something.

Post edited by: andrew, at: 2007/02/12 23:48
 
 
andrew
 
#704
Re:Column report second column subreport 3 Years, 6 Months ago
Thanks Andrew, I used the quick and dirty way by adding a series of objects to a Object("Vert") then including this object inside the second column.

This works but I found that the second column was aligned along the bottom :ohmy: , The reason for this I found was that the HorzFormat print method. Specifically:
y = orgy + totsize.h - totsize.d + size.d - size.h

Which forces the alignment along the bottom, which is fine for column headings but not so good for me :unsure:

By making my own HorzFormat I was able to correct the issue by simply aligning all columns along the orgy like
y = orgy

It be nice if the HorzFormat included a flag for this...
Should I add the request feature on sf.net ?

Z
 
 
#706
Re:Column report second column subreport 3 Years, 6 Months ago
Glad you got it working.

It is probably trying to align by baseline (i.e. based on d = descent). This works well for text, but not so good for things that don't have a natural descent, like images or composite objects. GridFormat has a top option for this issue.

We haven't really been using the request system on SourceForge. And because no one uses it, I never look at it! There is now a wish list on the Wiki as well.

If it is easy, just send me the change and I will put it in, assuming it is a new option and will not break any existing code.
 
 
andrew