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

Subreport blank: Link parm to formula field (main) / Suppress prompts

Status
Not open for further replies.

LWTri

Programmer
Jul 13, 2006
45
US
Hi lbass, great feedback. Up for helping another?

We are trying to keep our report running efficiently by putting all the logic in stored procedure (all filtering). Trying not avoid putting the global filtering in the report itself.

Linking an EventID subreport parm to a formula field in main report (that is set to a constant), to force EventID value for subreport WITHOUT prompting user. We definitely don't want to prompt user because each subreport has a different forced EventID value, and can't just set a single value in main report.

When you link subreports using regular parm (subreport) to parm (main report) linkage, the subreport shows up just fine. I also need to display a Shared Variable that I set up in subreport in the main report. I have it working when I link subreport using regular parm-to-parm linkage.

But, as soon as I change linkage to parm-to-formula (parm in subrpt, formula field/constant in main)... which was Crystal's actual suggestion on how to force parm values without prompting users in their Knowledge Base... the subreport shows nothing. It appears blank, and you have to double click on the blank box to get into the subreport. Therefore, it also does NOT RETURN any useful information, including the shared variable back to main report.

Do you know how to utilize this PARM-TO-FORMULA technique (parm in subreport, formula in main) or another method of forcing parm values, AND make the subreport APPEAR to the main report so it recognizes shared variables, etc?

Please help. THANKS SO MUCH!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PARM/FORMULA INFORMATION:
Subreport: EventID parm = number type
Main report: Event ID formula = ToNumber(5004)

The formula should have worked with just the 5004 constant, but wanted to ensure that crystal used it as number, not string.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Lbass, by the way, frustratingly, I'm not able to currently test anything. We're dealing with slow contract process w/ B.O. and our Developer app literally expired this morning. Trying to keep up w/ the debug and research online and whichever way I can while waiting for the extension to go through. Any ideas would be appreciated meanwhile...thanks.
 
In the main report, are you using any actual database fields? When I tried this, the subreport did not appear unless I added a database field in addition to the formula to the report canvas. This could even be a field added to a suppressed report header.

-LB
 
Good guess. Nope, I'm not using ANY database fields. I'm not using ANY data source at all in main. It's purely a highest-level interface page, grand total page type of main report.

It would look like this:

Successful Logons: 40
Failed Logons: 3
Successful Logouts: 52
...
...

Each event 'label' above (ex: "Successful Logons") is an OnDemand subreport to click on, which brings user to a multi-level (multi-group) drill-down report, allowing user to look at totals on each grouping, as well as drilldown/detail. On the main report, each total per event above is a number returned from subreports as individual shared variables. I manually created parameters and formula fields in main report to link to subreports (which have parms automatically imported from stored procedures). I didn't need any data source for main report. Do you think we'll need it in order to force the subreport to show (per your discovery) and shared variables to be recognized in main report?
 
Each OnDemand subreport is in it's own report footer section in main. Each event type above (ex: Successful Logons) has an associated EventID, which I'm passing manually (as number constant in formula field in main) to each subreport using the formula (main)-to-parm (sub) linkage.
 
Not sure, but yes, perhaps. You don't have to display any fields from the datasource though, as I mentioned above.

-LB
 
In your first comment, it looked like you added a "database" field (even if in a suppressed header). To clarify, do you mean that I won't need to add a field from any type of data source (ex: try using any ol' "special field")... or do I need to use a field from some data source, but just not "display" it (suppress it)?
 
I imagine it wouldn't hurt to use any arbitrary data source in the main report just to pull in a field, since the subreports will access the individual data sources that are needed nevertheless. Do you know if this slows down performance at all vs. no data source in main when not needed? Curious.
 
I don't think adding a datasource where you put one field in the report header will change performance.

-LB
 
Thanks a great deal, lbass. Dying to test this... B.O.'s finally working on our extension. I'll let you know if the test works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top