Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: a grouping problem Post Reply Post New Topic
Author Message
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Topic: a grouping problem
    Posted: 05 Feb 2009 at 4:01pm
Hi All,
 
I have created three views on the SQL server 2005 database with following fields:
 
1. inst_view
Inst_code      Inst_desc
BNIT               Institution name
GCIT              Institution name
2. Inst_faculty_view
Faculty_code   Inst_code    Faculty_desc
ABS                  BNIT            Advanced Building skills...
AE                    GCIT           Childhood Stdudies
 
3. Inst_faculty_fund_view
fund_code                  Inst_code    Fund_desc                               xtra_code
0708_BR_ABS             BNIT             0708_BR_Advanced Building...      1015
0708FNY_AE_ADL_D   GCIT             0708FNY_Access Education......     4050
 
The requirement of my report is to group by Faculty in the layout like:
 
ABS     Advanced Building skills
          0708_BR_ABS                0708_BR_Advanced building skills    
          xxxxx_xx_ABS                xxxx_xx_Advanced building skills    
 
AE      Childhood Studies
           0708FNY_AE_ADL_D      0708FNY_Access Education...   
           xxxxxxxx_AE_XXXXX       xxxxxxxx_Access Education...
 
Note: All the fund code (part of the code) must match Faculty code. However there is no direct link between them except inst code. And there are same faculty codes as well as different lengh of code across all the institutions. I would like to find a way to group all the fund code under the faculty with specified institution.
I start with dynamic cascading parameter picklist based on the above three views. In the record selection I put some thing like:
faculty_code= right(fund_code, 3).
The result was not satisfactory: the records with 3 charcters length of fund_code are displayed in the report, while those the 2 characters length are not shown.
I would appreciate if anyone could advise on the above
      
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 05 Feb 2009 at 5:52pm
Rather than hardcoding the '3' in the formula, what about using Len({fund_code}) instead? That way it knows whether to check for 2 or 3 characters?

I have all the Crystal Reports funcitons documented in my Encyclopedia book. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Posted: 05 Feb 2009 at 6:26pm
Thank you, but the search code is not always at the end of the string:
0708FNY_AE_ADL_D ( This is one "AE" is in the middle of the string, while "ABS" is  at the end of the string as the above my examples shown 0708_BR_ABS). It seemed that I cannot use 'like' in compairing as:
faculty_code like '%fund_code'
any further help would be greatly appreciated.
IP IP Logged
ishan
Newbie
Newbie
Avatar

Joined: 16 Dec 2008
Location: Nepal
Online Status: Offline
Posts: 19
Quote ishan Replybullet Posted: 06 Feb 2009 at 3:50am
I don't think there is any other way than joining the views through inst_code. If your fund_code is associated with inst_code and every faculty_code is associated with inst_code then why not use it to create a link between facultiy view and fund view.

Is your requirement is so complex or am I missing something here.Wink

Ishwor
IP IP Logged
johnwsun
Senior Member
Senior Member


Joined: 28 May 2008
Location: Australia
Online Status: Offline
Posts: 179
Quote johnwsun Replybullet Posted: 16 Feb 2009 at 7:46pm

Hi Ishwor,

I'm very sorry to reply so late because I was busy doing other tasks assigned.
There is already a link between faculty view and fund view on the Inst code. However when I select an institution(parameter) then select more  than one faculty assoicated with that institution, the fundcodes are displayed in mixed  manner, e.g
 
ABS   Advanced Building Skills
                                                   0708_BR_ABS        (this belongs to inst A)
                                                   0708_BN_ABS        (this belongs to inst B)
with the above I used "faculty_code= right(fund_code, 3)" in record selection
However, some institutions have a faculty code with only 2 characters, and what is more, the faculty code being searched is not alway at the end of that fund code string(which is not very standard way of entering date from data entry staff, I cannot do anything about it).
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.047 seconds.