471,089 Members | 1,628 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

Passing parameters into Crystal Reports

Hello everyone,
Does anyone know what code should i use in order to pass a parameters into
the Crystal Report's SQL command?
Any web site references is welcomed too!
Thanks
Tony
Nov 15 '05 #1
1 13625
MP
You can use this code as an example
....
public class ParGen
{
public ParameterFields Fields = new ParameterFields();

public ParameterDiscreteValue nombreEmpresa = new
ParameterDiscreteValue();
public ParameterDiscreteValue nombreCentroAct = new
ParameterDiscreteValue();
public ParameterDiscreteValue nombreUsuario = new
ParameterDiscreteValue();

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

ParameterField paramField2 = new ParameterField();
paramField2.ParameterFieldName = "nombreCentroAct";
nombreCentroAct.Value = mpsStatic.nombreCentroAct;
paramField2.CurrentValues.Add(nombreCentroAct);
Fields.Add(paramField2);

ParameterField paramField3 = new ParameterField();
paramField3.ParameterFieldName = "nombreUsuario";
nombreUsuario.Value = mpsStatic.nombreUsuario;
paramField3.CurrentValues.Add(nombreUsuario);
Fields.Add(paramField3);
}
}
..
ParGen repParm = new ParGen();
..
crystalReportViewer1.ParameterFieldInfo = repParm.Fields;

I hope this help...
If need more help post a replay...

MP

"Tony" <li***********@hotmail.com> wrote in message
news:Ot**************@TK2MSFTNGP10.phx.gbl...
Hello everyone,
Does anyone know what code should i use in order to pass a parameters into
the Crystal Report's SQL command?
Any web site references is welcomed too!
Thanks
Tony

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by raf_z | last post: by
1 post views Thread by Sospeter | last post: by
reply views Thread by lewindha | last post: by
3 posts views Thread by Dan Aldean | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.