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
Solved

Crystal report Detail section line count

Posted on 2009-07-01
9
1,288 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with running SSRS Reports thorugh ISA2006 2 214
SQL Report Builder Options 6 102
CRM 2011 Missing Fields in Dataset 13 91
Crystal Reports Sub Report 4 90
Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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