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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubReport Linking Question

Status
Not open for further replies.

Tynkr

Programmer
Aug 7, 2003
13
US
I am running Crystal ver 10.0.10.735
I have a date parameter on the main report.
I have created a formula that manipulates the date from the main report parameter for a period prior (prior mtd,prior ytd etc..) and using that formula date to link to the sub report and the Oracle Command. when I use the change subreport linking and use the formula to link the reports, the subreport seems to disappear from the main report.
 
Why not just recreate the date parameter and same date manipulation formula in the subreport and link the parameter from the main report to the same parameter in the subreport.

-LW

 
By "the subreport seems to disappear from the main report." do you mean that it drops the subreport from the main report, or that it doesn't do the linking, or?

Your version is newer than mine, so you're probably OK there.

I'd try inserting the subreport into another blank report and see if that works, it could be that either your main or subreport are corrupt.

-k
 
If I remove the "Formula" and use the parameter to Link the report and sub report it works as expected (wrong results though). The sub report just doesn't present itself in preview (not even the text fields) .when i use the "show current parameter values" in the subreport is shows no parameters or values.
 
Ahhh, I see.

Well then you should post the formula.

Also make sure that you're using either the Oracle native connectivity or the Crystal supplied Oracle ODBC driver.

-k
 
The formula has been defined as
Global DateVar DayDate:={?Day_Date}; //this being the main report parameter

Global NumberVar TYear:=Year(DayDate);
Global NumberVar TMonth:=Month(DayDate);

Global DateVar LastDayofMonth;
if Remainder((TYear - 1996),4) = 0 then
(LastDayofMonth:=Date(TYear,TMonth,[31,29,31,30,31,30,31,31,30,31,30,31][TMonth]);
)
else
(LastDayofMonth:=Date(TYear,TMonth,[31,28,31,30,31,30,31,31,30,31,30,31][TMonth]);
);

if Remainder((TYear - 1996),4) = 0 then
(LastDayofMonth:=Date(TYear,TMonth-1,[31,29,31,30,31,30,31,31,30,31,30,31][TMonth-1]);
)
else
(LastDayofMonth:=Date(TYear,TMonth-1,[31,28,31,30,31,30,31,31,30,31,30,31][TMonth-1]);
);

LastDayOfMonth;
I will review the driver now. Thanks
 
I guess the intent is to get the last day of a month, so try:

dateserial(year({?Day_Date}),month({?Day_Date})+1,1)-1

BTW, you don't need to state global on variables, the default is global.

Now link on this parameter and go into the subreport->Report->Selection Formulas-Record and change the linking to <= as it will set up a = join, which probably isn't what you want. Not sure though.

I think what you're experiencing is that the subreport isn't returning any data, so it is blank (not disappearing).

If that isn't it, state what the formula is supposed to be doing.

-k
 
Thanks for the Date 'Bit. The formula was created by another developer. The portion of the month to date in the formula is to return a single count total from the DB (Dimension and Fact Table) in Oracle. This date value is being used in the parameter field that is used in the SQL Command and not in the record selection expert. make sense?
So, there are several sub-report returning a single value from a differnet period in time and the assumption was that using the formula to link the parameter would work instead of using Oracle to calculate the dates needed.
 
I verified the "driver" is Oracle Server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top