Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FORMULA FOR COLUMNS 1

Status
Not open for further replies.

Preetham16

IS-IT--Management
Dec 28, 2006
32
DE
Hello Experts !

I am very new to CRYSTAL REPORTS and I currently have a main report which looks as follows
and need a Summary report for the same as a Subreport.


Date of Activity : 13.02.2006
--------------------------------
S.No Name Type
------ ------ ------
1 John Doc
2 John Doc
3 John Clinic
-----------------------------------
Date of Activity : 14.02.2006
--------------------------------
S.No Name Type
------ ------ ------
1 John Clinic
2 John Doc
3 John Pharma
4 John Pharma
-----------------------------------
Date of Activity : 15.02.2006
--------------------------------
S.No Name Type
------ ------ ------
1 John Clinic
2 John Doc
3 John Pharma
4 John Pharma
-----------------------------------
Date of Activity : 16.02.2006
--------------------------------
S.No Name Type
------ ------ ------
1 John Clinic
2 John Pharma
3 John Doc
4 John Doc
4 John Clinic
-----------------------------------


The Report above is grouped with DATE and the DATE field genearted with a TTX.

The field S.nO. Name and Type are generated in a SUbreport through other DB tables....

I need a Summary report which is a SUB REPORT within the main report. Which should give an output like BELOW

Date Doc phar Clinic Total
------------------------------------ -------
13.02.2006 2 0 1 3
14.02.2006 1 2 1 4
15.02.2006 1 2 1 4
16.02.2006 2 1 2 5
-------------------------------------- -------
Sum Total 6 5 5 16
--------------------------------------- -------
-------------------------------------------------


The problem what I have now is that I am not able to get the DATE Field from this TTX table related to the Other tables which I have.


''Pharma Formula

DIM apoSum as Number
Dim Result as Number
if {CDBPHAC_BP_GRP_T.DESCRIPTION} STARTSWITH "Pharma" then
formula = apoSum + 1
Result = Formula
end if


'' Doc Formula
DIM artSum as Number

if {CDBPHAC_BP_GRP_T.DESCRIPTION} STARTSWITH "Doc" then
formula = artSum + 1
end if


''Clinic Formula
DIM cliSum as Number

if {CDBPHAC_BP_GRP_T.DESCRIPTION} STARTSWITH "Clinic" then
formula = KliSum + 1
end if


I need the DATE FIELD which I cannot getit and also the TOTAL could anyone tell me a FORMULA
how I can ADD THE TOTAL COLUMN ...


I have dragged these formula fields I wrote a code for the field Type to
sum up but I cannot see the SUB REPORT itself. Please help me out::

Cheers
BVK
 
If you're wanting to use Subreport data in the main report, use a Shared Variable. For a date, put a formula field in the subreport like
Code:
Shared dateVar 
V_Today := {LoadStatus.LastDLoad}
To access it in the main report, create another formula field with
Code:
Shared dateVar 
V_Today := V_Today

Note that the shared variable is only available in the section after the section which contains the subreport.

Also take a look at Crosstabs, Insert > Crosstab.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hello Madawc
Thanx first of all but I dont need to use the Subreport data in the Main report. I just need the SUMMARY of the MAIN REPORT in the SUBREPORT but the SUBREPORT should look like the one below

Date Doc phar Clinic Total
------------------------------------ -------
13.02.2006 2 0 1 3
14.02.2006 1 2 1 4
15.02.2006 1 2 1 4
16.02.2006 2 1 2 5
-------------------------------------- -------
Sum Total 6 5 5 16
--------------------------------------- -------
-------------------------------------------------

May be you have an idea for this.. / may be if my question is clear...(as I have sensed that the previous question is a lil confusing ;o(

Cheers
Bvk
 
It would be ideal if the CODE is BASIC SYNTAX and not Crystal SYNTAX.. am USING CR 9 --

Thanx again in advance..
 
Edit > Subreport Links can be used to pass values from the main report to a subreport

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi Madawc,
Could anyone please tell me the STEPS am using CR9. How I can pass the Values from Main Report into SUBREPORT. Thanking in advance..

Cheers
BVK
 
I see you've started another thread for this and then solved it, fine. If you need to pass data back to the main report, use Shared Variables. The SEARCH function here will give you the details.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top