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

compression the columns

Status
Not open for further replies.

ameedoo3000

IS-IT--Management
Sep 20, 2016
222
0
0
EG
Hi all
I have a two-column report - the first column for boys and the second column for girls
How can any column be pressed to reach the required number of students on the same page?
For example, the number of boys is 25 and the number of girls is 15
What is required is how the column of the boys should be Automatically presses by the fact that all the boys are in the same column and page as the girls? Is this feature available in Fox Pro?

Best Regards
Ahmed
 
I don't understand what you mean by "Presses". Are you trying to have the font size of each column be different in the report, dynamically? So boys font size is 8 and girls font size is 14 so the columns are the same height when printed side-by-side?


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

"Everything should be made as simple as possible, and no simpler."[hammer]
 
From what I get you could either define a two column table with enough records to store the longer list of either boys or girls, foresee all columns twice and fill in line after line with empty values for the shorter list. That's not the usual way to join, as boys and girls are not directly having a matching condition, so you may do a [tt]SELECT girls,*, boys.* FROM pupils girls LEFT JOIN pupils boys ON .T. WHERE boys.class='X' AND girls.class='X' AND boys.gender='M' AND girls.gender='F'[/tt] (or however the gender is stored in your data).

Otherwise, VFP reports support columns, so you could create report groups for boys and girls (tell the report groups are defined by different pupil.gender) and print them in separate report columns, by letting a group start in a new column. Then the report data will be boys followed by girls records instead of joining them and the report group definition will sort them in their column.

Bye, Olaf.


Olaf Doschke Software Engineering
 
What I mean is whether it is possible to have one group on one page, no matter how many rows of data.
 
Are you saying you simply want to start a new group on a new page?

If it's as simple as that, just go to Report Properties / Data Grouping. Select the group in question, then select "Group starts on new page."

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Excuse me
I want to have a whole group on one page and not another page.
 
You want to have each group on one page, right? Tha's what happens if you specify "Group starts on new page".

I don't know what else you want, if you want any group size to remain on a single page this is not what VFP can do, you can't have a list of 200 rows on one page by automatically adapting font size, you can only define groups starting on separate pages and when ensuring the report layout and font size is small enough the largest group you have fits on one page you have any group on one page.

Bye. Olaf.

Olaf Doschke Software Engineering
 
Ahmed, the solution I suggested will do what you want: "to have a whole group on one page and not another page". But, of course, if the group does not fit on the page (because there are more rows of data than there are physical lines on the page), there's nothing you can do about that.

How you handle that situation is really a business decision, not a programming one. You've got to decide whether you want to allow the group to go over to the next page, or to present the information in some other form, or what.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yes, all that has been said is true and I know it well
Does this apply to the group if it is one column within several columns in the report?
 
If you define columns in a report, you automatically have the new option to let a group start in a new column instead aside of new page.

It's still unclear whether you have groups, which are just too large to fit in one column or page or whatever you want as maximum group size, you can't have VFP compress data into a single column or page, you have to look out for the largest group you have or you think is possible and layout your report with sufficiently small fonts. Anything larger will flow to the next column/page and then the next group would cause another switch to the next column or page, that's just normal, isn't it? You don't force fit a list of 500 names onto a single page, that group then has 5 or more pages.

If I assume pupils class lists, there will be a maximum fitting into a classroom, so you have your upper limit, it's not that hard to define report lines small enough to fit say 40 names in one column and so have each class list in separate columns.

Bye, Olaf.

Olaf Doschke Software Engineering
 
and how can i do "automatically adapting font size" in the group ?
I apologize for the inconvenience and lack of clarification required enough
 
I thank you dear Olaf and Mike
I have another question: if you have students in the first grade (boys 40 and 20 for example), i have set the report to 40 students per group
Is it possible to automatically embed the font size if the number is less than 40 students per group so that the font size is bigger and clearer?
 
Just notice the main thing you have under control at runtime is what data is printed, the expression. Does the report designer allow you to specify a field for the font size? No, so it's not dynamic. Can you size the detail band with an expression? no.

VFPX has introduced some tags similar to HTML to influence looks at runtime, but you'd still have a report control with a certain height, and so you'd end up with either larger but overlapping girls names or gaps between lines in boys names. That HTML styling has no influence on detail band height.

What you want can easily be done in Word, there font and line height also correspond with each other, you forget this is not the case in reports, the line spacing is mainly given by the detail band height. You can always open an FRX as table and change some things like font sizes and band heights before running the report, but that will be the value for the whole report run, even if you could act on the FRX while it runs, the report engine reads in the design at start and works on that.

With Word automation, it's simply setting the font size for a column. You can do anything dynamically this isn't driven by data row by row as a report, you're in full control to create a paragraph followed by a table with 3 columns, a graph, an embedded excel sheet and what else word offers.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top