Crystal max-date from sub-report

I would like to do the following:

I have a main report which will display certain totals.  Also I need to find certain dates from other tables using sub-reports.  Sub-report: reads table-B.  For every record-type "B" on Table-B, I need to find the latest date from these records.  Then I need to bring this max-date back to the maijn report and print on the group-footer line.
I know how to use shared variable, but I don't know how to store a "maximum date."

Can you help?
Thanks
mbroad02Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wykabryanCommented:
ok.. so you know the hard stuff.. add date to the detail line, then right click insert summary and choose max at the report foot level. Now, since you know how to do a shared variable. set the shared variable to the report footer max(fieldname).
0
mbroad02Author Commented:
Ok, I have done many shared variables, but I was not aware that I could pass the summary value from the footer to another report.   I am trying to do this, but get an error (see attached Word doc) . I place the date in the detail line (hidden) create a summary in the footer for max(date).  Then I create a formula with a shared variable which stores (and passes to main report) the max-date. Am I doing this correctly?
Variable-setup-error.doc
0
wykabryanCommented:
see attached.
Save the date.xls in c:\
save the simple.txt as simple.rpt


date.xls
simple.txt
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

wykabryanCommented:
Thanks Mlmcc. the attachment notes didnt say anything..

mbroad02 see this attachment for the report. It was designed in CR10.
simple.rpt
0
mbroad02Author Commented:
I have my report formatted as you have suggested, but have a problem (nothing is displaying on main report).  By the way, when I display the data on the subreport, both the MAX field and the formula passing the max to the shared variable display the date.

See attached.

Thank you
Date-Subreport.doc
0
mlmccCommented:
Where is the subreport?

Is that section suppressed?
If so then the subreport doesn't run

mlmcc
0
wykabryanCommented:
also, you need to have the WHILEPRINTINGRECORD; unsuppressed. This must show up in every one of your shared variable formulas.


0
mlmccCommented:
Actually that isn't required.  Any formula with a Shared variable is automatically set to WhilePrintingRecords pass.

I always use it to simply document it.

mlmcc
0
wykabryanCommented:
hmm.. never knew that.. I always do it as practice.. it make sure that it is executed.. Never know when the next patch is going to break something like that..
0
mbroad02Author Commented:
Folks--No, the subreport is not supressed, I just had it hidden.  The sub-report was working and displaying data.  I saw a comment above saying that my attachment didn't say anything.  I am confused.  Wasn't this helpful in allowing you to understand my problem?   What other documentation would help in debugging this situation?  A report definition?

In your sample, you have nothing but the subreport report-header supressed.  This would cause every line in the sub-report to print, which I don't want.

HELP!
0
wykabryanCommented:
right, i just wanted to show you how to get the subreport max date to the main report. The order of which it is displayed on the main report is important. You must show the subreport then the variable call. If the subreport is in groupfoot1a then the formula must exist in groupfooter1b.
0
mbroad02Author Commented:
The subreport is located in the main report detail section.  The formula which returns the variable is located in the group footer.  I do this hundreds of times but I can never seem to remember the placement, what can/cannot be supressed/hidden, etc...
Thanks
0
wykabryanCommented:
when using shared variables you can not hid or suppress the subreport.

so how do you get it to appear without making it appear?? unhide it, then go into your subreport and change the color to white. Then get rid of the subreport borders by right clicking on the subreport and format subreport, border tab.  In my example I left the top border for you so you can see where the subreport is..


date.xls
simple.rpt
0
mbroad02Author Commented:
I understand what you are saying, but there are two issues here:
(1)  No matter how "white" or small I make the subreport, since it reads many date records, if the sub-report is not hidden, it will put a large blank section each time it runs.
(2)  I am NOT hiding or supressing the subreport and it is still not passing the varibale value.

I have attached this report (CR 10).  It is only a start of a report but the fields and subreport of which we have spoken are there.

See what you think.
Thanks
0
mbroad02Author Commented:
Whoops--forgot to attach the report---here it is-----
Case-Progress-Extract-Dates-0111.rpt
0
wykabryanCommented:
right in the subreport the detail section is being displayed. You can suppress the detail section in the sub as long as it does not contain the shared variable. In my example it takes up very little space on the main report but there is more than 5-6 lines per group.
0
wykabryanCommented:
0
mbroad02Author Commented:
I truly appreciate your help.  The field is now displaying.  however, as you can see on the attached, since the subreport must read hundreds of detail records to get the max date, the detail section on the main report is a large blank section, which is not acceptable.  how can I have this not show??

Thanks
large-detail-space.doc
0
wykabryanCommented:
did you see my last attachment.. This should take care of it for you.
0
mbroad02Author Commented:
Yes, in fact the DOC print-screen I just sent was that of your version (had a lot of blank space)...
0
wykabryanCommented:
heheh.. right..

insert new section in the group footer. then drag the groupfooter b above groupfooter a (this will reduce the time of dragging and dropping each column). Then move the subreport into groupfootera. suppress detail line.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mbroad02Author Commented:
VIOLA!!!!!   Simple but very effective!  thanks so VERY much for all of your asistance!
0
wykabryanCommented:
sure no problem.. easy breeze..
0
mbroad02Author Commented:
Excellent help.  Went above and beyond!!  A pleasure to have assistance like this!! Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.