Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple pages per record
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00034658
Message ID:
00035806
Vues:
60
>>>>>>>>Hi,
>>>>>>>>
>>>>>>>>I'm creating an application that prints a surveys each being one record and spanning 2 possibly 3 pages (with comments).
>>>>>>>>
>>>>>>>>Using the report form designer, is there any way to do this (other than creating 2 separate reports which are run one after the other - tacky)?
>>>>>>>
>>>>>>>
>>>>>>>Can u pls be more clear ?? Why u r creating 2 reports ? Comments is afield ?? Using the report designer u can create one report only and have a look at the stretch property..
>>>>>>
>>>>>>Perhaps you are answering my question.. I do not have much experience with the report designer (have manually created reports in Foxpro DOS).
>>>>>>Each record's data, the way it is formatted, cannot fit on one page and spans 2 pages with the possibility of overflowing onto 3.
>>>>>>Since I do not know how to make the designer do this, I kludged it with 2 reports, one printing the 1st part and the other the 2nd.
>>>>>
>>>>>yeah, now its a little bit clear, actually the same thing can be achieved by creating 1 report only.
>>>>>
>>>>>whenever u put any field in report, right click and click on properties, here apart from doing other things, there are 3 options stretch with band.... there if u will select it the field will automatically expand, if the width is more then the specified size.
>>>>>
>>>>>hope this helps, If u face any other problems then reply me...
>>>>
>>>>Vinod,
>>>>thanks for the reply, unfortunately it does not solve my problem
>>>>my report list the scores for 60 questions (1 line for each including the question descriptions ) which takes 2 pages in total.
>>>>Each set of 2 pages is one record.
>>>>
>>>>I am currently useing 2 reports each displaying half the record. What I need to know is whether there is a way to tell the report designer to span 2 pages.
>>>>
>>>>rgds Ashley Orton
>>>
>>>Seems like you have 60 in one record for the answer. you should have had a child table to the question table and then the report printing would have been easier. However you can still solve the problem by writing a UDF which concatenates all sixty questions into a memo field of a temp table with carriage returns after every answer and put this memo field in the detail band with stretch = .t.
>>>
>>>best of luck
>>>Abdul Ahad
>>
>>Or, if you want a little more flexibility over your layout, you can concatenate your question label text with your answer values, then maybe concatenate a few of the questions together, perhaps with carriage returns between them, until the number of report controls stacked vertically on the page is less than the number of lines per page which your chosen font allows. Each control is made to stretch vertically and float as the band expands. FoxPro won't know that these controls are going to stretch when you are laying out the report. The key is to not let FoxPro know that you're planning a two-page report. Also, you have to not mind where the page breaks end up. If you do mind that, you will have to do what I was taught here to do and create a cursor, then run the report off the cursor. The cursor is a UNION SELECT with an additional field 1 AS listorder for fields on page one, 2 AS listorder in the second part of the select for fields on page two. Since you said that your
>report
>>is sometime 2 pages, sometimes 3, I don't think you are minding so much where the pagebreaks go, and you won't have to do that.
>>
>>I have VFP3, but I gather here that VFP5's report writer is not very different. I am often frustrated with the limitations of the report writer. When my users eventually ask that their reports be written to files that they can fax, I may abandon it altogether.
>
>Thanks,
>
>Unfortunately I do not have the luxury of being able to concactenate text. The user requires the 1st 2 pages to exactly duplicate the originating questionaire; the 3rd page, if required, canb contain overflow comments.
>Looks like there is no proper way to do this....
The UNION SELECT is the proper (though ugly) way to do this. First,

SELECT ALL keyfield, 1 AS listorder, page1field1, page1field2,...,memofield, "" AS page2field1, "" AS page2field2,... FROM myalias INTO CURSOR tmpreport WHERE &whatevercriteria UNION SELECT ALL keyfield, 2 AS listorder, "" AS page1field1, "" AS page1field2,...,memofield, page2field1, page2field2,... FROM myalias WHERE &whatevercriteria AND NOT EMPTY(page2somefield)

You can expand this to account for three pages instead of two. The NOT EMPTY(page2somefield) will prevent a page 2 being made for records that have nothing in page2somefield.

Then select the cursor and run your report from it. Your report will have a detail band of constant height, filling ONE page. Your report controls for both pages will be superimposed on this one detail band, making an ugly mess, but it can't be helped. These controls will NOT stretch or float. Each one gets PRINT WHEN listorder = 1 or 2, depending on which page it goes on.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform