Jump to content

OT : Anyone Know Crystal Reports?


PaulyWally

Recommended Posts

  • Members

I really don't know what the hell I'm doing because I've never used Crystal Reports before. But I do have SQL and programming background. I just don't know how to do this in Crystal and there is very little info in the help file and online about this.

 

I am trying to create a report with several subreports in it. I would like to select some data on the main report page (to display in the header, for instance) and then query the subreport(s) using some of the data that was returned from the query on the main report. For example:

 

 

MainReport query:

SELECT ID_Field FROM Retards WHERE LastName = 'Bush'

 

SubReport1 query:

SELECT * FROM PhoneNumbers WHERE ID_Field = result from previous query

I am guessing I need to use variables within the report. And from what I've found, I will need to use "Shared Variables" so they can be used across subreports. But again, not a lot of information on how to actually do this.

 

It also doesn't help that I'm used to writing actual code. Trying to do this {censored} through a GUI is just plain irritating.

Link to comment
Share on other sites

  • Members

My security system writes it's reports based on Crystal. I was hoping there was going to be some info in it. I swear that when I used to run reports that it would some the actual query within the report...but it doesn't seem to do that in this new version.

 

Otherwise...I can't help. Sorry...

Link to comment
Share on other sites

  • Members

 

I've never been able to successfully run a query within a query in Crystal.

 

 

I'm not really nesting queries. Each subreport has it's own query, and they are all working fine.

 

I'm just having a hell of a time figuring out how how variables work in Crystal. I want to declare a variable on the main report, and pass that variable on to the subreports.

 

Make sense?

Link to comment
Share on other sites

  • Members
I'm not really nesting queries. Each subreport has it's own query, and they are all working fine.


I'm just having a hell of a time figuring out how how variables work in Crystal. I want to declare a variable on the main report, and pass that variable on to the subreports.


Make sense?

Right, but each report is its own query and you want to run one report off the results of another (unless I'm not understanding you properly).Maybe check out this example?http://diamond.businessobjects.com/node/448Might get you pointed in the right direction.

Link to comment
Share on other sites

  • Members

 

Right, but each report is its own query and you want to run one report off the results of another (unless I'm not understanding you properly).


Maybe check out this example?




Might get you pointed in the right direction.

 

 

Yeah... I see what you're saying. And after further messing around with this, I no longer think that approach is entirely necessary.

 

What I can do (and is probably a lot easier) is to declare a variable on the main report, prompt the user for the data, and then pass it on to each subreport. So the value doesn't really need to come from another query.

 

I think that link might get me going on this. We'll see.

 

Thanks!!

Link to comment
Share on other sites

  • Members

 

If you get stuck, drop me a PM. I'm happy to take a look. Something might jump out at me if I see your actual formulas.


cheers.

 

 

Thanks! I think I got it!

 

I can create a Parameter called "varLastName" that prompts the user for data. I then link "varLastName" to each subreport Parameter that needs it. No need for formulas at all.

 

Woohoo!!

 

Thanks again!!

Link to comment
Share on other sites

  • CMS Author

Declare a shared variable before each formula that uses it. If you don't declare the shared variable in every report that use it, Crystal returns an error that the variable does not exist.

 

"Shared ID_FIELD StringVar" would be your declaration in each report, just change "ID_FIELD" to whatever you want to call the variable.

 

 

Edit: I see you got it. Cool.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...