Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Count Shared String Variable Post Reply Post New Topic
Author Message
Gary J
Newbie
Newbie


Joined: 30 Mar 2009
Location: United States
Online Status: Offline
Posts: 7
Quote Gary J Replybullet Topic: Count Shared String Variable
     Posted: 07 Apr 2009 at 7:32pm
This is the actual formula in the Main Report:

if {@eSIS CourseCode}={@TableRule CourseCode} or
{EMPCODES.CODE}={@HQ EmployeeCode} then ToNumber("0") else ToNumber("1")
------------------

This is the variable for {@eSIS CourseCode}:
//@MainFormula
//Course code from eSIS subreport
//{eSISdata_csv.COURSE_CODE}
//Shared variable

WhilePrintingRecords;
Shared stringVar eSISCourseCode;
eSISCourseCode
 
--------------------

The variables {@TableRule CourseCode}and {@TableRule CourseCode}are constructed the same as above from subreports.
The field {EMPCODES.CODE} is from the Main Report.
 
When trying to Count number 1 in the Main report, an error is received that this cannot summaried.  Suggestions please.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Apr 2009 at 7:42am
why not just use a shared variable and increment it every time there would be a '1' and then display it?
 
In the top piece of code, I don't see a shared variable or an assignment.  While we're at it, if you want the number 1 or 0, just display them, why go through the work to convert a fixed string to a number?  Call me lazy.
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