Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Same field with different values Post Reply Post New Topic
Author Message
Menwil
Newbie
Newbie
Avatar

Joined: 23 Sep 2011
Location: South Africa
Online Status: Offline
Posts: 2
Quote Menwil Replybullet Topic: Same field with different values
     Posted: 23 Sep 2011 at 2:19am
I have the following problem.
 
Scenario:
 
I extract data from a ERP system when a Customer or Supplier changes or gets added to the system. I have a automated Crystal report that runs once a day to pull that data and then I save to txt and the data can then be uploaded bu other systems for approving etc.
My Crystal report contains a hard coded header with some info and in the detail section I have the customer/supplier details. When a supplier/customer changes/added I only write the key field (supplier/customer number) to a log file. Crystal then picks up this log file and within the report I get the other information from the database like addresses, contacts etc. There are also custom fields added to the ERP system on the supplier/customer pages. These custom form fields are for State Codes and names and Country Codes and names that gets selected from a mandatory lookup list.
 
Problem:
 
There are 2 custom form fields namely: 1. ISO001 and 2. ISO002
This writes to 2 tables within a ISAM db.
 
Table 1 = ADMFORMDATA
Table 2 = ADMFORVALIDATION
 
ADMFORMDATA will contain the following:
 
FORMTYPE  KEYFIELD  FIELDNAME  ALPHAVALUE
CUS             0000001      ISO001         US
SUP             0000010      ISO001         CA
CUS             0000001      ISO002         NY
 
ADMFORVALIDATION will contain the following:
 
FORMTYPE  FIELDNAME  ITEM  DESCRIPTION
CUS              ISO001          US      UNITED STATES
SUP              ISO001          CA      CANADA
CUS              ISO002          NY      NEW YORK
 
I need to print in one line both the ISO001 and ISO002 fields based on the customer/supplier number that is the keyfield in ADMFORMDATA.
I put the whole detail line in a text field because I have to do a lot of formula/conditional suppression.
My problem is that when I added the ISO002 custom field, the report does not print these 2 fields on one line, but splits them into 2 lines.
 
Any help would be so much appreciated.
 
Regards,
 
Menwil Gordon - South Africa
 
 
 
 
 
ERP Consultant : Syspro
Cell : +27 82 851 5531
menwilg@greencage.co.za
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Sep 2011 at 3:34am
what I would do is:
create several formulas
1) reset usually in group header
shared stringvar iso:="";
"" //hide the reset
 
2) increment -  usually in details
shared stringvar iso := iso + "," + {table.iso};
""// hide, but not really needed
 
3) display - usually in group footer
shared stringvar iso;
mid(iso,2)  //trims the leading comma
 
with these formulas deployed to their respective sections, I would then suppress the detail of the report, and move all of the display logic into the group footer. 
 
why?  CR won't merge 2 rows together, it will display the 2 rows (as you noticed), but since the group footer is only printed once per group, you can do the merging in the formula and display the concatenated string.
 
HTH
IP IP Logged
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