Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal report Detail section line count

Posted on 2009-07-01
9
Medium Priority
?
1,292 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 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

824 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