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!

Container Report/Sub Reports/Date Parameters

Status
Not open for further replies.

edteck

MIS
Feb 23, 2000
47
IE
1 How do I display date parameters automatically in a crystal report?
e.g. 'My Report'
'Created between date and date
2 I have a container report with 4 sub reports, therefore five date tabs. I do not wish to have to input the timespan 5 times. I tried to link the date parameter fields but this did not work. the main report is ok but it does not pick up the sub-reports at all. Any suggestions?
 
1. See the FAQ on common formulas. One describes how to display different types of parameters in CR, by version.

2. Create the appropriate parameters in the subreports, and then link the main report parameters to each of the subreports corresponding parameters. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Question 2 first: I'm not expressing myself very well. I have inserted date paramaters in the 4 sub reports and tried to link them to the date parameter in the main report but this does not work.

 
This will work when you have it set up correctly.

Lets take the first subreport as an example.
Describe the parameters in both the main report and the first subreport. The settings should be identical.

Then describe exactly how the parameter is used in both the main report and the subreport.

Also, describe the error or failure are you experiencing. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Yes, the sub reports link to the container report's date paramaters when correctly set up. However, I still have a problem with dates. When I select a range of dates to input the information it retrieves is different by 1 day or two from the information which I could retrieve directly from a server report.



 
Is there a pattern?
Same in all reports/subreports?
Are you converting a dateTime to a Date in the report (Check file-Report Options)
Post the selection formula for a report that is failing.
Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
I regret I must back-track. The sub-reports are not linking with the container report.

The container report produces the correct information each time. Taking one sub-report as an example, it will either not display any information at all, or show all the info I want except that it is not picking up the date paramaters.

Container report date paramaters: Value type =date, range values; browse table MYTable, Browse Field DateIn; default values. Sub report date paramaters: as above.

In sub report 2, the table and fields are different.

[The entire report, container + subs work correctly with 5 date tabs.]
 
"the main report is ok but it does not pick up the sub-reports at all"
"the sub reports link to the container report's date paramaters when correctly set up"
"I regret I must back-track. The sub-reports are not linking with the container report."
"it will either not display any information at all, or show all the info I want except that it is not picking up the date paramaters"
Ed,
Are things changing, or is your description/understanding of the problem changing? Malcolm
Remember, if it wasn't for electricity, we'd be surfing the net by candlelight.
 
When I said "the sub reports link to the container report's date paramaters when correctly set up" I was suffering from a mirage.

What works: The container report produces the correct information. The container report with its subs produce the correct information as long as I input the date ramges into each tab,(5). So in essence I have the report I want except it would be very nice to be able to input the date range just once.

Here I have failed dismally to link the paramaters. I am minded to throw my hat at it, for the time being anyway.

 
I am very slow to adopt many of the features of SCR, because I have a very low tolerance for bugs/unpredictable results.
I don't fully trust date parameters, let alone date range parameters, let alone linking subreports on date range parameters.
Rather than a date range parameter, I would be tempted to move to using two date parameters, and applying a filter. I suspect the linking of the subreports would be more robust with this simpler approach. Malcolm
Remember, if it wasn't for electricity, we'd be surfing the net by candlelight.
 
Ed,

I am having the same problem. My main report has 4 sub reports. All are calling stored procedures that use the same parameters.

I tried linking the parameters to that of the main but get no results in my subs. Essentially my parameters are passed to SQL Server as NULLs. Have you found a way to pass the parameters from the main report to the subs?

Oliver
 
First, make sure the subreports (with parameters) work as stand alone reports.

I haven't tested this myself, but I also believe that SP date parameters are passed as string values and not dates. You could see if this sheds some light on the issue. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Ed,

I had trouble with the linking as well. When you are linking the subreport the default "Subreport Parameter to use" looks something like this ?Pm-?@dtFrom. It is hard to see, but if you click on the down arrow of the combo box for the parameter field, there is a small spinner. If you then scroll down you will see the correct subreport parameter (as it appears in your report setup). Once I realized there were other variables below the default in the link screen my subreports worked fine.

Oliver
 
Yes, Crystal wants to add its own parameter field in the sub, with an "equal to" rule in the select expert. I always add my own parameter in the sub, use it as needed in the sub, and then select it as you have described. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top