Solved

Crystal Reports--fixed field lengths for output

Posted on 2009-07-16
6
742 Views
Last Modified: 2013-11-15
I need to create a crystal report which will also be used for Export to an Excel file.  For the Excel file, it is required that each field be a specific length (see the attached template).  Is there a way in Crystal to set lengths of each field?
Your help is appreciated.
Thanks
IFAS-template.xls
0
Comment
Question by:mbroad02
6 Comments
 
LVL 11

Accepted Solution

by:
aelliso3 earned 350 total points
ID: 24873953
If you need a field that is always exactly 30 characters, you can use something like:

 Left ({table.field} + Space (30), 30)

 For different fields and lengths, just replace the field name and the two 30's with appropriate values
0
 
LVL 34

Assisted Solution

by:James0628
James0628 earned 100 total points
ID: 24875653
aelliso3's suggestion would probably be the first thing I'd try.  If all of your fields are strings, then create a formula like the one he posted for each field and put those formulas on the report.

 If some of your fields are numeric and you need a specific field length on those too, that might be trickier.  You can convert the numbers to strings, which will let you format them however you want (eg. with leading spaces or 0's), but will it be a problem if the numbers are converted to strings before they're exported to the Excel file?

 James
0
 

Author Comment

by:mbroad02
ID: 24878196
That works just fine--thank you.  But if I can get a bonus question answered in this:
I also need to remove the first 2 characters of the field I am formatting before I print it.  I create a field called INVOICE_NO, removing dashes from the CASE.DSCR and formatting the date (appended to the CASE.DSCR.
Then I limit the INVOICE  field to 16 characters.
BUT, before I print, I need to remove the first two characters (leftmost).


Example formula code:
stringVar INVOICE_NO :=  Replace({REAL_CASE.DSCR},'-','') & "-" & Totext({APPTPMT.PMT_DT},"MM/dd/yy");
stringVar PRINT_INVOICE := Left({@INVOICE} + Space (16), 16);
PRINT_INVOICE;

If you can assist--I truly appreciate it.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 50 total points
ID: 24879095
Use

Mid({YourField},3)

mlmcc
0
 

Author Closing Comment

by:mbroad02
ID: 31604377
Thank you for all of your help!!
0
 
LVL 34

Expert Comment

by:James0628
ID: 24883979
You're welcome.  Glad I could help.

 James
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.
How to increase the row limit in Jasper Server.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

16 Experts available now in Live!

Get 1:1 Help Now