Hello everybody,

I'm trying to create a crystal report from my C# code. I call it the 
way that I saw in a tutorial, but it seems that the parameter is not 
passed, although, when I look in debug mode, the parameter gets a 
value. Could anybody help? I've got a parameterfield in the report 
called: pfCustomer

Now the code I use to set the parameters to the report is the 
following:

// new report document object 
                        ReportDocument oReport = new ReportDocument
(); 

                        // loading the ItemReport in report document 
                        oReport.Load(reportLocation);

                        // set the selected report as the source
                        crystalReportViewer1.ReportSource = oReport;

                        // all the parameter fields will be added to 
this collection 
                        ParameterFields paramFields = new 
ParameterFields(); 

                        // the parameter fields to be sent to the 
report 
                        ParameterField pfCustomer = new ParameterField
(); 

                        // setting the name of parameter fields with 
wich they will be recieved in report 
                        pfCustomer.ParameterFieldName = "pfCustomer";

                        // the above declared parameter fields accept 
values as discrete objects 
                        // so declaring discrete objects 
                        ParameterDiscreteValue dcCustomer = new 
ParameterDiscreteValue();

                        // setting the values of the discrete objects
                        dcCustomer.Value = reportParameters
["Customer"];

                        // now adding these discrete values to 
parameters 
                        pfCustomer.CurrentValues.Add(dcCustomer);

                        // now adding all these parameter fields to 
the parameter collection 
                        paramFields.Add(pfCustomer);

                        // finally add the parameter collection to 
the crystal report viewer 
                        crystalReportViewer1.ParameterFieldInfo = 
paramFields;

I hope anyone can help me!

Thanks in advance!
Koen





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/XGgtlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Microsofts_C_Sharp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to