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

shared stringvar

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

I have a subreport I want to link to my main report. I have a field in the main report that does not include the data in the subreports. Example: 5 territories in main report, 1 territory in sub, want to link, having troubles.
Tried sharedstringvar terr; etc. etc. , it's coming back as boolean. I used totext to change to string, still not working. I know this is an easy one, sorry to bother.

Anybody???

Carley

 
How is your main report grouped?? By territory?

Shared variables are used for the transfer of data between main and subreports....not linking.

There are 5 territories in the main report and one in the Subreport....why? Special case? Can it be a stand-alone subreport with no linking at all?

Need more details....Jim
 
Ngolem,

Thanks for the reply. My report is grouped by Company #, company product, and then product ID #.

Yes, this is a special case. This is a new Branch that has it's own excel database created by an outside source. Yes, can be stand alone as long as it brings back values from the parameters set up. Right now I have it in the Report Footer (b). So all the data will be at the end of the report which is okay, would like it co-mingle with the main reports data but not critical at this time.

All I would like to do is have the parameters--- Product Line, Territory, Branch Plant. The Branch Plant section doesn't seem to want to bring back my data from my excel spreadseet when I select by it's self. Set of parameters in main report to include my subreport's Branch. Make sense.

Hope you can help. Have a good day!!!

Carley
 
If you are getting a boolean check you aren't using = isntead of :=

= checks for equality, while := assigns a value. Confuses the heck out of VB guys and still causes the occassional problem.

Editor and Publisher of Crystal Clear
 
How would I do a shared stringvar and set up the parameters. No links are needed???

Thanks.

Carley

P.S. As you can tell, I'm a newbie. Sorry.
 
I don't think you want to use Shared variables in this case but rather linking may work.

let me understand the layout of your report....You have shown me the grouping but is the layout something like sales of a product by territory...like this

ProductID Territory 1 Territory 2 .... Territory 5

widget1 13 12 12


something like that?

Doesn't your subreport have the CompanyID, CompanyProduct and ProductID fields?

If it does then

ProductID Territory 1 Territory 2 .... Territory 5

{ProdID} {SalesT1} {SalesT2} {Subreport value}

linking the subreport to the CompanyID, Company Product and ProductID should pull in the data.

Or are you having Subreport problems?? It is tricky using an Excel spreadsheet as a database

 
Yes the linking works for Product line and Territory but when it comes to linking the branch plant, it just doesn't seem to want to link.

Any ideas? Pulling my hair out!!!

Thank You!

Carley :)
 
what is the problem with Branch Plant...are the main report/subreport fields not the same?
 
Ngolem,

Hi again. Branch Plant for example in Main Report = ABC, DEF, GHI, JKL, MNO. The subreport branch plant is XYZ. Thought I could just make a formula including XYZ in the main report then linking to subreport. Just not working, added XYZ to my parameters for Branch Plant in main report. Still doesn't work.

Thank you.

Carley
 
Is the bracnh code in the sub report hard coded to XYZ?

If so, why not just hard code the formula - or use a "Branch2" paramater in the Main Report, and link that down to the subreport.

You can't use Shared variables in record selection. They have to evalauted "WhilePrintingRecords" so it's too late for record selection.

What version of CR? If it's Cr8.0 or earlier then linking the Branch Parameter to the subreport will only pass the first value. If it Cr8.5 then the entire list will link. Editor and Publisher of Crystal Clear
 
ChelseaTech,

Hi, in the subreport report I have my branch plant field(XYZ) set up like this:
field like ?BranchPlant.
In my main report, all I did was setup the subreport branch plant in the branch plant parameter filed of the main report. I am using Crystal 8.5

Could you possibly guide me, don't know why I'm having so many problems.
Thanks.

Carley :)
 
{F4211.SDLOB} like {?Territory} and
{F4211.SDUPC1}like {?Product Line} and
{F4211.SDMCU}like {?Branch Plant}
This is just some of it. This is main report.

Could the problem be is that I use the parameters that are set up by the linking expert instead of setting them up myself? This is subreport.

{cr_samples_samples.TERR} like {?Pm-F4211.SDLOB} and
{cr_samples_samples.PRODLINE} like {?Pm-F4211.SDUPC1} and
{cr_samples_samples.BranchPlant} like {?Pm-?Branch Plant}

Any suggestions?

Carley

 
Tried to setup a different parameter for the XYZ data, not working.

Sorry.

Carley :)
 
Carley - hope I haven't missed the point...
Try setting up Parameters in the Subreport (call them the same name as your main report).
Go into the main report and click on Subreport links.
Select the Parameters from your main report and link them to the parameters in the subreport. If you look at the drop-down box on the bottom left of this screen, use the 'down' arrow to scroll down to the correct ?parameter. Crystal will try and make you choose the ?pm- parameter and it may look like your parameter isn't there, but it is if you scroll down.
Next, go back into the subreport and make sure that the Record Selection is correct. The ?pm- should not be here.

This will then allow the main report to select data from both the main and sub-reports.

Let me know how you get on.

JustineB
 
HELP..................did exactly what you said, still not working.
 
I am still having trouble imagining the layout of your report is it like what I described....is a "Branch" the same as a "territory"...or am I missing something?
 
Parameters:
Territory (working fine)
Branch Plant (not working)
Product Line (working fine)

Users decide they want just subreport branch plant, select, no data appears in report. ?????????????????

Thanks.

Carley
 
how about trying this in your subreport

{cr_samples_samples.TERR} like {?Pm-F4211.SDLOB} and
{cr_samples_samples.PRODLINE} like {?Pm-F4211.SDUPC1} and
({cr_samples_samples.BranchPlant} like {?Pm-?Branch Plant} or {cr_samples_samples.BranchPlant} = "XYZ")

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top