Solved

Crystal report Detail section line count

Posted on 2009-07-01
9
1,285 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
  • 5
  • 4
9 Comments
 
LVL 100

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 100

Expert Comment

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

mlmcc
0
 

Author Comment

by:simisudevan
ID: 24752418
No. I checked for \n and \r.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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 100

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 100

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now