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

subreport linking confusion

Status
Not open for further replies.

gabster

Programmer
Oct 23, 2001
192
US
Hello everyone...

I thought that a subreport is totally dependable on the main report data.

I found out in one of my reports that's connected via ODBC to an SQL server that the subreport sends its own SQL query.

I do not want that! I just wand the subreport to be linked to whatever data was brought in by the main report's query.

Anyone can help, please?

Thank you,
Gabi.
 
Subreports in CR are always independent SQL statements. What are you trying to accomplish? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Ken,

Thanks you tones for the answers...

I am connecting via ODBC to an SQL server that our company is just developing ( see ). The database server is called M3 (is written in MUMPS language)

What I am trying to accomplish is:
1. To select the last (newest) patients records from a database (using a certain account # as reference - in my case 6580).

2. Also I have some parameters that I am using.

I hoped that once the data is brought in by the main report, the subreport would just process it's own output (I have a selection formula there too) from the main report's data.
But I understand from whet you are telling me that this is not possible since the subreport sends its own SQL query to the database.
This explains why I always saw a double request on the SQL server...

Is this a smart concept? I am trying to learn too... Wouldn't be easyer and faster if the subreport would take the data already brought in by the main report?

Also ultimately but most important I am trying to speed up the whole process by forcing as much as I can down the server...

Right now, I receive ALL records, and only then the "Patient.Patient_# >= 6580" is applied.

I tried to override the selection formula by hand editing the SQL formula. Sometime worked, sometime not.


What I really would like to learn is some smart concepts about making my reports efficient (processing as much as it could on the server).

Thanks again for putting up with newbies like me...

Gabi.




I have an example ready to be downloaded @:
ftp://pattersongray.com/misc/dnc/New_Patient_listing_SQL.rpt
 
How are you defining the "LAST" patients?
How does the reference relate to the patients?

What do you want to do with these patients once you have them? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
By saying LAST I mean the last patients records up-to-date from that Account # up. In other words if someone wants to now the newest patients that were registered.

Example if the Last_Active_Patient account # is 6581:

Acct # Name
6581 CROCKETT,LESLIE
6582 HYATT,TINA
6583 MEROE,TED
6584 WELLS,RICHARD
6585 etc.
6586 etc.
6587 (last recorded patient).

What I'm basically doing, is just creating reports in CR of already made reports done by an office management software.
So I am just doing the same report but done with CR instead of that program.

Once I have them (the patients) I just want them displayed just as this text file:

ftp://
Hope this helps explaning my issue...

Thanks,
Gabi.
 
Sorry, one rule that I follow is that I only review files for my customers. For TT, I limit myself to what is in the post.

So far, from your description it sounds to my like all you need is a selection formula that says:

Patient Account Number -
Is Greather than or Equal to-
{your prompt}

That gives you the 'newest' accounts.

What is the difference between the main report and the subreports?
Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Hi kenhamady,
i have a similar problem.
I'm have a subreport that uses the same stored-procedure as the primary report and it prompts twice.

The primary report prints the details of all the individual rows of data returned, but the sub - report does a summary of totals by grouping the same data by class type and returning total cost for that class type (sum(cost)). Both the primary report and subreport use the exact same prompts and SQL statement. (The sub-report is in the Report Footer if the Primary Report)


My question is how do i pass the 4 prompts fields from the primary report to the subreport with out having to enter them again.

I am unfamilar with crystal report so if you could explain with some detail how to do it or direct me to some free technical guides available on the net that would also help in solving this problem.

Also if there is a work around for this problem, like creating a multi-pass report could you inform me of that to.

regard
Radman
 
Radman,

If you use a cross-tab in the main report you wouldn't need the subreport at all. If you need further help, please start a new thread. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top