Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two pages per record
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00023111
Message ID:
00023408
Views:
29
>>>>I need to print a lot of text fields on a page for each record, then print a memo (when not blank) on the following page. There will also be a page header. If I make the detail band longer than the page, it tells me so and refuses to print. If I group the data so that every record is a group, and put the memo field in a group footer, the memo field prints before the detail band. Maybe I'm missing something obvious, but I can find no way to make every record print on two pages.
>>>
>>>Duplicate records:
>>>SELECT key,1 as listorder,field1,field..,SPACE(254) as memo From Table1 Into Cursor tmpReport UNION SELECT key,2 as listorder,"" as field1, "" as field2....,memo From Table1
>>>Then print group report (group by key,listorder) with each group starting new page.
>>This table has about 50 fields. Is there a way to get them all into the SELECT statement that is more clever than saying
>>
>>SELECT keyfield, 1 as listorder, field1,field2...field10,;
>>field11,field12...field20,;
>>...
>>field41,field42...field50,SPACE etc.?
>>If not I can live with it.
>
>You can use AFIELDS()
>=AFIELDS(aNames)
>cString=""
>for n=1 to ALEN(aNames)
> cString=cString+aNames[n]+","
>endfor
>*** and use cString: SELECT &cString. ....
It almost works, but I forgot to mention that I only want page 2 to print if there is something in the memo field. (I didn't bother with =AFIELDS() because I found that cString went way over 254 characters. There seemed little point in making cString1, cString2 etc.) I also discovered that I would get a "not UNION compatible" error if I tried to use SPACE(254), SPACE(4), or "" as memo, so I put the memo field "as is" in both parts of the SELECT. In order to get rid of unnecessary page two's, I added a WHERE !EMPTY(memo) to the second SELECT. That clause gave me a cursor which only repeated records that had !EMPTY memos. I put all my text fields in the group1 header and put the memo field in the group2 header. However, the report still insists on printing the group2 page for every record, even though most of these records have an empty memo and listorder=1.

I don't understand why FoxPro doesn't make it easier to do this. I should think a multiple page per record fixed-format report would be a routine task.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform