Solved

Crystal XI passing parameters to multiple sub-reports

Posted on 2014-01-06
8
883 Views
Last Modified: 2014-01-13
Main report and two sub-reports... Main Report prompts for OrderDet.OrderNo, the Quote Costs sub-report prompt for OrderDet. JobNo and the Job Matl sub-report prompts for POReleases.JobNo.

OrderNo example: 110954
JobNo example: 110954-01

The -01 signifies the top level assembly JobNo to which WIP activity and costs are rolled up.

I'd prefer to enter a single OrderNo parameter but could live with entering the OrderNo and a single JobNo passed to both subreports; but would like to avoid entering 3 parameters.

The JobNo will always end with -01
Is it possible to prompt only for the OrderNo and pass that parameter to the two subreport parameters and add the -01 suffix to them?
Job-Cost-Actual-vs-Estimate.rpt
0
Comment
Question by:Lee Ingalls
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 39760564
The easy way is to not have the subreport prompt for anything and link it on the field/value you want.

You could create a formula that adds the -01 to the orderno parameter and link that to the parameters in the subreports.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39760568
To link to a subreport parameter make sure you select it from the list.  Don't just accept the parameter the linking expert selects which will be something like ?pm_OrderNo

mlmcc
0
 
LVL 8

Author Comment

by:Lee Ingalls
ID: 39762907
I've been beating head against this one since last night...

The main report uses parameter OrderDet.OrderNo
The two subreports use a JobNo parameter

Keep in mind RHa also contains a copy of the subreport so I can pre-run for the shared currencyvar povalue.

All I end up doing is adding additional parameter prompts. This one is kicking my ass!
Doc7.pdf
0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 500 total points
ID: 39763401
Try this version

mlmcc
Job-Cost-Actual-vs-Estimate-rev1.rpt
0
 
LVL 8

Author Comment

by:Lee Ingalls
ID: 39765266
Thank you mlmcc. I have a concern that Job Matl Subrpt2 is no longer returning the correct povalue. I was expecting the amount to be $17,902.61 but the report with the updated subreport links is returning a povalue of $8,141.25 based upon the OderNo/JobNo parameters. I'm in the process of comparing the two version to try and determine what's causing some of the PO details to be excluded.

I started the report from scratch so that I can eliminate some of the old report artifacts and will try your subreport links.
0
 
LVL 35

Expert Comment

by:James0628
ID: 39766154
In your original "Job Matl Subrpt2" subreports (one in the report header and one in the report footer), your record selection formula only compared the parameter with POReleases.JobNo.  mlmcc added tests on PODet.JobNo in one subreport and OrderDet.JobNo in the other.  Maybe those fields have different values (like the "-01" that you mentioned) in PODet and OrderDet, so that excludes some records.

 James
0
 
LVL 8

Accepted Solution

by:
Lee Ingalls earned 0 total points
ID: 39766431
James, we're on the same track... I had just finished my "eureka" moment when I saw your post.

I had started re-writing the report from scratch eliminating some of the unnecessary artifacts in the report... writing the main report and each sub-report separately.
 
What was getting excluded were POValues which had multiple Job Numbers, ie, 110954-01 and 110953-01, completely different job numbers to the same vendor on the same PO.

mlmcc's was excluding some POValues and my re-write of the report was doubling some Vendor POValues... focusing on the entries that were being excluded or multiplied I realized we were purchasing the same items from the same vendor PO, for multiple jobs... POReleases was the key.

RFd:  Job Matl Subrpt2,  I changed the record select formula from OrderDet.JobNo =  the parameter prompt to POReleases.JobNo = parameter prompt. I also changed my @Value formula to use {POReleases.Qty}*{PODet.UnitCost} instead of {PODet.Qty}*{PODet.UnitCost}

Just need to make a minor tweak to get the shared currencyvar povalue formula to pass the the amount back to the main report.

You guys are awesome! Persistence paid off.
0
 
LVL 8

Author Closing Comment

by:Lee Ingalls
ID: 39776120
mlmcc's was excluding some POValues and my re-write of the report was doubling some Vendor POValues... focusing on the entries that were being excluded or multiplied I realized we were purchasing the same items from the same vendor PO, for multiple jobs... POReleases was the key.

RFd:  Job Matl Subrpt2,  I changed the record select formula from OrderDet.JobNo =  the parameter prompt to POReleases.JobNo = parameter prompt. I also changed my @Value formula to use {POReleases.Qty}*{PODet.UnitCost} instead of {PODet.Qty}*{PODet.UnitCost}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question