[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Crystal Reports

Posted on 2005-04-12
8
Medium Priority
?
322 Views
Last Modified: 2010-04-17
In Crystal Reports, i'm trying to take an entry in a database table and split it into multiple cells. I've successfully used split() to break the data into an array, but how do I stretch it to independent entries? Can I take individual parts of the array and link it to another table?

Example data:
RABCDEF  RGHIJKL  RMNOPQR

All are separated by a space. I used split({table.column}," ")  and then what else?
0
Comment
Question by:HackLife
  • 3
  • 3
6 Comments
 
LVL 3

Expert Comment

by:JamesPMCD
ID: 13765876
Here's one I just used.

I have a string field that stores a set of data extracted from a table as one string.
I have a set of three sub string I used to determin what position the breaks will be at and then I extact it into variables that I display through functions.

You could uses the same routine looking for the spaces.

'*******************************************************
NumberVar xPos;
NumberVar xPosD;
NumberVar xPosS;

SHARED StringVar xDesc;
SHARED StringVar xSerial;

xPos := instr(1,{fil_MRPOverRides.rsFields},"Desc :",1);
xPosD := instr(1,{fil_MRPOverRides.rsFields},"rowID :",1);
xPosS := instr(1,{fil_MRPOverRides.rsFields},"Serial :",1);

if xPosS > 0 then
    (
    xSerial := "  " & replace(mid({fil_MRPOverRides.rsFields},xPosS, len({fil_MRPOverRides.rsFields})),"serial : ","");

    xSerial := mid(left(trim(xSerial),len(trim(xSerial)) -1),5) ;

    if xPos > 0 then
        (   xDesc := replace(mid({fil_MRPOverRides.rsFields},xPos,XPosD - xpos-1),"Desc : ","") ;
        );

    trim(replace(xDesc,xSerial,""))  
    )
else
"";
'*************************************************************************
0
 
LVL 4

Author Comment

by:HackLife
ID: 13766531
Here's another example of what I'm trying to do:

table1:column1

abc def
abc def ghe
ghe
abc
abc ghe


table2:column1

abc me@me.com
def me2@me2.com
ghe me3@me3.com


I need to get the emails in table2 linked to each 3 letter indicator in table 1. The problem is that table 1 contains a bunch lumped into one cell.
0
 
LVL 3

Accepted Solution

by:
JamesPMCD earned 2000 total points
ID: 13771205
If its only three char then its easier. Use a loop to go through and divided each item into an array

Local StringVar array x := ["a","b"]; // or SHARED

redim x [(table:column1)/3)]

for i := 1 to len(table:column1) Step 3 Do
(
  x[i] := mid(table:column1,i,i+3)

);

The the array can be used to linke to another table or sub report.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Author Comment

by:HackLife
ID: 13775185
how do you link?
0
 
LVL 3

Expert Comment

by:JamesPMCD
ID: 13775261
That a little more fun.

Running this array in a sub report you can create a table. then link back to the main report using the formula
0
 
LVL 4

Author Comment

by:HackLife
ID: 13778486
Interesting... i'll have to give it a try. thanks
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression

873 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