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

Adding formula to subreport makes data disappear

Status
Not open for further replies.

jlkjr

Technical User
Apr 5, 2010
29
US
I have a subreport that calculates attendance for students. It shows up fine on the original report (I didn't write it). I've been trying to speed up our process by separating grade levels into different reports, but when I copy this subreport into the new report, it comes out showing only text objects and drawing objects. I have isolated the problem to one of the formulas in the subreport, but I cannot seem to find any way to resolve the issue. Any help would be great. Thank you.
 
Hi,
Just curious - why subreports instead of grouping on the Grade level? When possible, it is better to avoid subreports.

You can format the group to have new pages before and after so you can print separate grades.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Did you try exporting the subreport from the original report as a .rpt file (File->Save Subreport As...)then adding it this way to the new report (Insert->Subreport).
Also, check to make sure the data-linking is correct between the sub and the main report.


As a side note, I agree with Turkbear that if you can do it without a subreport that will give you better results overall (in my experience: fewer places for typos/errors & quicker overall runtime)
 
I inherited this report from the previous tech. I am not sure but I think I am the fourth person to use this report. I have tried recreating the subreport as main report with the same results.
 
Local NumberVar daysAbsent:= {@Excused Absence Q1} + {@Unexcused Absence Q1};
Local DateVar startTerm := date ("08/21/2009");
Local DateVar endTerm := date ("10/23/2009");
Local DateVar Array holidays := MakeArray(date ("09/07/2009"));

Local DateVar startDate;
Local DateVar endDate;
Local DateVar minDate;
Local DateVar maxDate;
Local NumberVar dayCount;
Local NumberVar counter := 0;

minDate := date(minimum({StsAttndDayDtl_1.StsAttndDayDtl_1_Date}));
maxDate := date(maximum({StsAttndDayDtl_1.StsAttndDayDtl_1_Date}));

if minDate = maxDate then
(
Select (minDate)
Case Is < startTerm: startDate := startTerm
Case Is > startTerm:
if minDate < endTerm then
startDate := minDate else
startDate := date(dateAdd("d", +1, endTerm))
Default: startDate := minDate;
) else
if minDate = startTerm to endTerm then
startDate := minDate else
if maxDate = startTerm to endTerm then
startDate := maxDate else
startDate := startTerm;

startDate := date(dateAdd("d", -1, startDate));

if isNull({StsAttndDayDtl_2.StsAttndDayDtl_2_Date}) = FALSE then
(
minDate := date(minimum({StsAttndDayDtl_2.StsAttndDayDtl_2_Date}));
maxDate := date(maximum({StsAttndDayDtl_2.StsAttndDayDtl_2_Date}));
if minDate = maxDate then
(
if minDate < startTerm then
endDate := endTerm else
Select (minDate)
Case Is < endTerm:
if minDate > startTerm then
endDate := date(dateAdd("d", -1, minDate)) else
endDate := endTerm
Case Is > endTerm: endDate := endTerm
Default: endDate := date(dateAdd("d", -1, minDate));
) else
if minDate = startTerm to endTerm then
endDate := date(dateAdd("d", -1, minDate)) else
if maxDate = startTerm to endTerm then
endDate := date(dateAdd("d", -1, maxDate)) else
if minDate < startTerm and
maxDate < startTerm then
endDate := startTerm else
endDate := endTerm;
) else
endDate := endTerm;

dayCount := Datediff("d", startDate, endDate) - DateDiff("ww", startDate, endDate, crSaturday) - DateDiff("ww", startDate, endDate, crSunday) - daysAbsent;
While UBound(holidays) <> counter do
(counter := counter + 1;
if Not (dayofweek(holidays[counter]) in [1,7]) and
holidays[counter] in date(dateAdd("d", +1, startDate)) to endDate then
dayCount := dayCount -1;);

dayCount;


All formulas work in the subreport until this one is added.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top