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

Passing parameter values to Command

Status
Not open for further replies.

ratjetoes

Programmer
May 24, 2002
30
NL
hi,

i'm a total newbie on crystal reports, and i've got a little problem passing the values of a parameter (created in crystal reports 9) to a command.

the command exists from a query like this:

select a.c, b.d
from c inner join b on c.x=b.x
where a.y=PARAMETER
group by b.d

how can i assign the values from the ParameterFields parameter to the Command (query)? i think this has to be done in the formula workshop or something like it.

another problem i've got is using 2 command objects in one report. cause of the nature of 1 of the query's i can't link them together. what i want is using a cross-tab for one (works) and get general data from the other command object, but i don't get it to work.

one last question, do you know a good site with good tutorials (especially on the formula fields/sql expression fields topics)?

t.i.a.,
ratjetoes.
 
Are you passing values from an application?

Make one report for each command and put one into the other as a subreport.


Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
nope, i'm using crystal reports to access the reports.

greetz,
ratjetoes.
 
I would still take one report for each command and put one into the other as a subreport.

I am not sure I understand the parameter question, but to get a parameter into the command you create the parameter inside the command window, and then double click the parameter to put it into the correct place in the command text.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
solved the parameter problem, was kinda stupid i simply used the wrong syntax.

will try the subreport.

tnx 4 the help.
 
Hi ratjetoes.
I'm having the same problem as you had
with passing parameters in a SQL Command.
I used the code as follows but still don't know how to access the parameter in the report:


public class ParGen
{
public ParameterFields Fields = new ParameterFields();

public ParameterDiscreteValue ncarrierID = new
ParameterDiscreteValue();


public ParGen()
{
ParameterField paramField1 = new ParameterField();
paramField1.ParameterFieldName = "carrierID";
carrierID.Value = this.carrierID;
paramField1.CurrentValues.Add(carrierID);
Fields.Add(paramField1);

}
}
..

ParGen repParm = new ParGen();
..

crReportViewer.ParameterFieldInfo = repParm.Fields;


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top