Solved

Crystal report Detail section line count

Posted on 2009-07-01
9
1,290 Views
Last Modified: 2013-11-15
I have a detail section and i want to count the line number.i got this using the formula
whileprintingrecords.but my problem is my detail section a single record have multiple lines.It is not counting
Eg: Item        Description                 Count
       1             First Line                        1
                      Second Line
                       Third Line


It should show 3
0
Comment
Question by:simisudevan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 24752210
You can only count records unless you can parse the field and determine the number of lines.

mlmcc
0
 

Author Comment

by:simisudevan
ID: 24752278
I use this formula ,but it is not counting


whileprintingrecords;
stringvar sample := replace({SP_GET_PROPOSAL_PRINT_DETAILS;1.PRODUCT_DETAILS},chr(10),chr(13));
StringVar Array tmpArry := Split(sample,chr(13));
 UBound(tmpArry);
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24752358
Are you sure there are chr(10) characters in the string?

mlmcc
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:simisudevan
ID: 24752418
No. I checked for \n and \r.
0
 

Author Comment

by:simisudevan
ID: 24752518
Is any other parse method to find the line count? My detail section content is just string.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24759627
Is the line wrap because the field is narrow or because there are characters causing a new line.

If the former there is no sure fire method of getting it since it is determined by the characters and the spacing.

mlmcc
0
 

Author Comment

by:simisudevan
ID: 24761043
If we know the number of characters per line ,can we find total lines? please give me a solution.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 500 total points
ID: 24766213
You can get a rough idea.

Length({YourStringField}) / CharacterWidthofBox

I did something similar so I could add blank lines to in your case the number so it would appear as

Eg: Item        Description                 Count
       1             First Line                        
                      Second Line
                       Third Line                       3

Since I was using a proportional font it worked about 95% of the time.  If you only have the one box to worry about estimate its width as say 15.  One way to get the approximate width is to just have text with no spaces as
NowIsthetimeforallgoodmenandwomento

Try that in the box of the same width to see how many characters are displayed.  You can then use that number to see if it works.  Adjust the number as necessary to get a better estimate.

mlmcc
0
 

Author Closing Comment

by:simisudevan
ID: 31598673
Thanks i
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question