Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Filling the blank spaces with dots Post Reply Post New Topic
Author Message
Mellison
Newbie
Newbie
Avatar

Joined: 20 Nov 2009
Location: India
Online Status: Offline
Posts: 15
Quote Mellison Replybullet Topic: Filling the blank spaces with dots
    Posted: 27 Jun 2010 at 8:28pm
Hi,
    i have a text object in my report which is used to display the String that is retrieved from the DB.Now my problem is that at the end of the String i will have to fill it with dots for the last line alone.For example
    
Patient alcohol history...................

                             "Patient alcohol History" is the string that i got from the DB.The string can be more than one line also in that case i will have to fill the last line empty spaces with dots.How can i do that
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 27 Jun 2010 at 8:58pm
you can add the dots after the field.
{tbl.patientstatusfield}+"......"
 
 
or you can try this:
(assume length of patient_status field is 30 characters)
1. create a variable that contains 30 dots, same as length of patient_status
xdots="....." 
 
2. create a variable for patient status
pxstatus={tbl.patientstatus}+left(xdots,len(xdots)-len({tbl.patientstatus})
--> this will print the dots flexible based on length of patient_status.
 
and put 'pxstatus' variable on the report.
1. right click this variable
2. choose 'Format field'
3. click on 'Common' tab
4. check on 'Can Grow' and put the max line as you need.
 
 
 
hope it help.
 
 


Edited by Emir_W - 27 Jun 2010 at 9:04pm
Emir W
IP IP Logged
Mellison
Newbie
Newbie
Avatar

Joined: 20 Nov 2009
Location: India
Online Status: Offline
Posts: 15
Quote Mellison Replybullet Posted: 27 Jun 2010 at 11:19pm

Thanks for the Reply Emir,

                        I have tried the second idea earlier but that wouldn’t work since the space consumed by alphabets are not same in the report for example space consumed by alphabet “i” is much lesser than the space consumed “w”. so literally calculating the no of dots might give a result like this

 

 

Patient alcoholic History………

……….

 

Patient condition 24 hours

After surgery……………………….

……………

 

                                    But where as the dot should end on the last line itself like this

 

Patient alcoholic History………

 

Patient condition 24 hours

After surgery……………………….

 

                                    First suggestion also has the same issue.Is there any other solution for this problem.

 


Edited by Mellison - 27 Jun 2010 at 11:19pm
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 28 Jun 2010 at 12:21am

absolutely, when you print the field it will give you different width for each character except if you using Courier font.

using my first option it will print some dots (as you type in the formula) at the end of line.
but if you using the 2nd option then the dots will print only to replace the rest of the line replacing the spaces.

my point on second option is if the len for patient status is less then 30 characters, let say only 23 characters, then the rest 7 characters will printed as dot.
let say the field for patient status is 100 characters.
then, variable xdots will contains 100 dots.
and data for patient status contains only 40 characters (regardless 'i', 'w', etc.)
then when you print variable pxstatus it will print the patient status it self and followed with 60 dots.

or.. can you put your formula here so we can see if there's something need to change?
 

thx.
 
Emir W
IP IP Logged
Ygnacio
Newbie
Newbie
Avatar

Joined: 30 Jul 2010
Online Status: Offline
Posts: 3
Quote Ygnacio Replybullet Posted: 30 Jul 2010 at 9:37am
Hi,

I have the same problem: I need to print some contracts directly to PDF in crystal.

The report has a big paragraph (it may fill several pages) in a textbox with fixed text, database fields, formulas, some words are in bold, etc.

In the last line of the paragraph, it must be filled to the end with hyphens while there are spaces in the line, for example:

   XXXXXXXXXX
   XXXXXXXXXX
   XX-------------



I can not use a fixed font like Courier, the report must be printed with Arial size 11 font, all the text must be full justify and the size of the paper is Folio (8.5 x 13")

Any solution?

I'm using Crystal Report Ver 10.0.0.533


Thanks
 


Edited by Ygnacio - 30 Jul 2010 at 9:43am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.