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

How to column a data field in Details sections 3

Status
Not open for further replies.

varadha72

Programmer
Oct 14, 2010
82
US
Hi,

Could someone help me here. I have employee ID and employee name fields in details section.
The requirement is after every 20 rows both the emp id and emp name must be displayed right next as a new column continuing the emp id and name.

eg:
Currently
EmpID EmpName
1 Adam
2 Boon
3 Charlie
4 Chisty
5 David
6 Ella
7 Frank
8 Hunt
9 Jack
10 Micheal
11 Mitchelle
12 Nancy....

SHOULD BE DISPLAYED AS
Details Section
EmpID EmpName EmpID EmpName
1 Adam 11 Mitchelle
2 Boon 12 Nancy ....
3 Charlie
4 Chisty
5 David
6 Ella
7 Frank
8 Hunt
9 Jack
10 Micheal
 
You can set up columns in Crystal Reports. I has been years since I have done it. The columns would be a fixed size, so it might take some trial and error to get the right number of rows.
 
I know that I can turn on the "Format with Multiple Columns" in section expert and set the values in "Layout". But I was wondering if anyone can help me resolve this by formula, because I have constrain on space, what I mean is I have more space as columns rather than rows. I need only 10 rows, then the next value must be populated in the next column. This setup of only 10 rows is causing me issues. Hence I want to use some formulas.
Please someone help me here.
 
Do you need a total of only 10 rows printed in one page?
 
Hi Betty

I need a total of 10 rows and 2 set of columns printed on a page.
 
In Section Expert, check Format with Multiple Columns.
In Layout tab, set width to 4 in (you may have to adjust it according to your data).
Set Printing Direction to Across then Down

In Details Check New Page after. Condition
[tt]Remainder((recordnumber),20) = 0;[/tt]

I believe this is what you are looking for.
 
Hi Varadha,
Forgot to mention something in the previous post. I am not sure if the order of the records is important. The code will print record 1 in column 1, record 2 in column 2, record 3 in column 3 and so on. Also the code is good only if you need only 10 rows in a page.
 
Thanks Betty for your help, it works as expected and also prints first all data in first column then prints the second column as expected. ie 1-10 records in column1 then 11-20 records in column2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top