Solved

Crystal Reports--fixed field lengths for output

Posted on 2009-07-16
6
756 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
[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
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 35

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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 101

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 35

Expert Comment

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

 James
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

636 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