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

Underlay and Group Footers

Status
Not open for further replies.

suzey

MIS
May 30, 2002
29
0
0
AU
Hi Everyone,

I hope someone can help. I have a small report, that I use to export data.

On the report I have had to put a subreport to bring back one field. I had already tried to do it in the report, but it takes too long to run.

So, the subreport gets some data, then I bring that data back into the main report, and display it.

My problem is that I need to display the returned data from the subreport alongside the other data. So all in one straight line (because I'm exporting it to excel), but because the subreport is evaluated after the detail, I have to pass the value back into the group footer.

I get all the correct data, as long as I keep the returned value in the group footer.

So, I thought I could easily fix this by using the 'underlay following section' on the details, so the details and group header would be shown alongside each other. Unfortunately this does not appear to work. I've tried lots of different combinations to try and get the underlay to work.

Does anyone know if this could be a problem with our installation? Has anyone used this successfully on a group footer (it works fine on headers), or does anyone know any other way I could do this?

Thanks



Sue
 
Why does the sub report have to be evaluated after the details section ? If the sub report is run once for each group why not place it in the group header.

If this doesn't suit oyur situation try posting the layout of your report showing what's in the different sections.

HTH

Gary Parker
Systems Support Analyst
Manchester, England
 
Gary,

The report is basically order details,ie : order no, specification, nothing fancy really.

The subreport, looks at the history of the order, and brings back a date based on certain criteria.

I did try putting it all in the report instead of a subreport, but the tables are too large, and it took too long.

I don't really need to have a group on the report, as all the information is currently in the details section.

I thought that when crystal refreshed the data, it does the main details first, then the subreports, then the groups.

I've tried to put the returned value from the subreport into the details section, but it brings back the value from the record before. I've also tried changing the formula that returns the value, with an evaluate after, but this still brings back the value from the record before if it is in the details section. I even thought it might work in the group footer, but again this is the value from the record before.

If I could get the underlay to work, this would solve everything. I was also concerned as to why they would put this option on, but it does not appear to work.

Any help would be greatly appreciated.



Sue
 
Sue

When passing values between sub reports and the main report, all you need to make sure of is that the sub report is placed in a section before the returned value is required.

If you place the sub report in the Report header the sub report will run before the main report is built, this will allow you to place a formula in the details section to diplay the variable value.

HTH

Gary Parker
Systems Support Analyst
Manchester, England
 
it's always quicker to get a join query with derived queries than run through a sub report.

Can you give the content and relation of the two tables like (SQL Server)

ordersTable
orderId,
specifs
...

orderHistoryTable
orderID,
eventType,
eventDate,
...

relation by orderId
get eventDate for orderId where eventType='Sending'

The query will be in this case :

select
ordersTable.orderId,
specifs,
eventDate
FROM
(
orderId,
specifs
from
ordersTable
) as ordersList
left join
(
select
orderId,
eventDate
FROM
orderHistoryTable
WHERE eventType='Sending'
) as selectedOrderDate
on ordersList.orderId=selectedOrderDate.orderId

if you have indexes on each orderId field and eventType it will be a matter of seconds for large tables

--------------------------------------------------
[highlight]Django[/highlight] [thumbsup]
bug exterminator
tips'n tricks addict
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top