Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: db field displays all data together Post Reply Post New Topic
Author Message
server_sap
Newbie
Newbie


Joined: 09 Mar 2011
Location: Germany
Online Status: Offline
Posts: 14
Quote server_sap Replybullet Topic: db field displays all data together
     Posted: 09 Mar 2011 at 10:29pm
Hi All ,
 
I am using CR2008 , i am making an report in which i need to separate a field to next line , for example :
 
*fieldcontent
*fieldcontent
*fieldcontent
 
but right now it prints all togther like this:
 
*fieldcontent,fieldcontent,fieldcontent
 
how can i do that , any help suggestion would be helpful.
 
Regards,
 
Server_Sap
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 10 Mar 2011 at 3:27am

You could use the Split() function and state all parts in one formula with chr(13) between them, then set the field CanGrow to 0.

 
Split({table.field}, ",")[1]
& chr(13)
& split({table.field}, ",")[2]
& chr(13)
& split({table.field}, ",")[3]
|< /\ '][' ( )
IP IP Logged
server_sap
Newbie
Newbie


Joined: 09 Mar 2011
Location: Germany
Online Status: Offline
Posts: 14
Quote server_sap Replybullet Posted: 10 Mar 2011 at 3:47am
Hey Buddy , Thanks again ,
 
your formula worked but i have one problem now this field actually should be in connection with field above , i will explain you how,
 
i have one master module lets say ' ITILv3'  and i have 3 submodules as follows :
 
*ITILv3 Foundation
*ITILv3 Foundation Bridge
*ITILv3 Service Management
 
so i want them to display this way :
 
ITILv3 :
*ITILv3 Foundation ( note it corresponds to master field above )
*ITILv3 Foundation Bridge
*ITILv3 Service Management
 
But right now my problem is:
 
ITILv3 :
*Internal Auditor according to ISO/IEC 2000 ( its from another master  
  module not from ITILv3
*ITILv2 Foundation ( also not from that master module )
*ITILv3 Service Management
 
so in short right now its printing this way :
 

ITIL®v3 :

• Internal Auditor in ITSM according to ISO/IEC 20000,ITIL® v2 Practionioner Agree
   and Define,ITIL® v3 Foundation Bridge,ITIL® v3 Foundation in Deutsch

• Internal Auditor in ITSM according to ISO/IEC 20000,ITIL® v2 Practionioner Agree

   and Define,ITIL® v3 Foundation Bridge,ITIL® v3 Foundation in Deutsch
 
now with your formula i was able to split the submodules in separate line , but do you know i can use mastermodule in that formula so it prints submodule only for that mastermodule ?
 
Thanks again in Advance buddy
Server
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Mar 2011 at 3:48am
a more generic solution would be
local stringvar array arr := split({table.field}, ",");
local stringvar result := "";
local numbervar index;
 
for index := 1 to ubound(arr) do
(
  result := result + arr[index] + chrw(13) + chrw(10) ;
);
 
result
 
 
just a thought
HTH
IP IP Logged
server_sap
Newbie
Newbie


Joined: 09 Mar 2011
Location: Germany
Online Status: Offline
Posts: 14
Quote server_sap Replybullet Posted: 10 Mar 2011 at 4:26am
hey guys,
 
will try tom and let you know .
 
Thanks :)
IP IP Logged
server_sap
Newbie
Newbie


Joined: 09 Mar 2011
Location: Germany
Online Status: Offline
Posts: 14
Quote server_sap Replybullet Posted: 10 Mar 2011 at 8:54pm
Hi Guys,
 
I tried both formulas , they work but still as i explained i have 2 different fields from 2 different stored procedures
1. MasterService and 2.SubModules
 
so field submodule should correspond to its masterservice field ,
 
MasterService:
 *Submodule
 
or is it because both fields are from 2 different stored procedures in same db ?
 
Regards
Server
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 11 Mar 2011 at 3:21am
I don't recall/see that it was from 2 stored procs, but CR treats them as tables and so they can be linked.  Sorry, I didn't understand the example as it was a bunch of fields that I have no knowledge of, so I assumed that all the datasources were the same...namely 1 table.
 
That the submodules are not aligning to the master, would seem to indicate a linking issue...that the submodule table is not joined to the master table correctly, and so you are getting results that don't make sense.
 
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