?
Solved

Crystal report Detail section line count

Posted on 2009-07-01
9
Medium Priority
?
1,291 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Independent Software Vendors: 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!

Question has a verified solution.

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

1. Set up your parameter at the report level as usual, check the box Multi-value, and set the Data Type to String 2. Set the Stored Procedure Parameter to varchar(max)  --<---- This part here is the key to it's success Example:    @cst_key var…
Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

777 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