Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: display one field detailed item of sub r Post Reply Post New Topic
Author Message
jasvinder
Newbie
Newbie
Avatar

Joined: 16 May 2012
Location: India
Online Status: Offline
Posts: 5
Quote jasvinder Replybullet Topic: display one field detailed item of sub r
     Posted: 16 May 2012 at 2:46am
I want to display one field detailed item of sub report, horizontally

i have my customer details in main report and his pending bills in sub report. and their are three to four pending bills and i want to display all pending bills in one line.

custid custname billamt pendingbills
C0001 AAAA     1032    2020
                                  3030   
                                  5050
                                  4040

i want like following

custid custname billamt pendingbills
C0001 AAAA     1032    2020 + 3030 + 5050 + 4040

Please help me out this
                           
                     

Edited by jasvinder - 16 May 2012 at 2:48am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 16 May 2012 at 3:18am
write a formula that runs in the detail section of the subreport like:
shared stringvar pending;
 
pending := pending + " + " + {table.field};
 
in the group footer display the pending variable like:
shared stringvar pending;
pending
 
IP IP Logged
jasvinder
Newbie
Newbie
Avatar

Joined: 16 May 2012
Location: India
Online Status: Offline
Posts: 5
Quote jasvinder Replybullet Posted: 16 May 2012 at 7:09pm
Thanks a lot for your kind reply.
just for 2 pending amounts after applying the formula output is like

+2020+3030+2020
+2020+3030+2020+3030+2020
i want pending amt like 2020+3030

i don't have group section in my report,
so where to display pending variables.

and which section should i suppress.

Please help me out for the same
thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 17 May 2012 at 6:26am
local numbervar x := instr(pending, {table.field});
 
if x = 0  then //this does a simple basic comparison
  pending := pending + " + " + {table.field};
else ( //check for 10 in a string of 1010 + 2020 + 3030  --should be added
         // more complex logic, but i will leave it to you to figure out...as it may be a case that never occurs
)
 
you would suppress the detail section, and if there is no grouping you can put the display in the report footer.
IP IP Logged
jasvinder
Newbie
Newbie
Avatar

Joined: 16 May 2012
Location: India
Online Status: Offline
Posts: 5
Quote jasvinder Replybullet Posted: 18 May 2012 at 3:06am
Thanks for reply and solution.
now it is showing in one line.
but
1 it is repeating same result for the following customers also (they don't have any previous bills)
2 if the following customers have pending bills, then it adds previous customer's pending bills to it.

Please suggest me.
Thanks

Edited by jasvinder - 18 May 2012 at 6:25pm
IP IP Logged
jasvinder
Newbie
Newbie
Avatar

Joined: 16 May 2012
Location: India
Online Status: Offline
Posts: 5
Quote jasvinder Replybullet Posted: 18 May 2012 at 8:58pm
i got it,
shared stringvar pending;
pending :=" ";

by adding it in report footer.

thanks you very much for your valuable time. i will see you soon with some new problems.

thanks again.
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