ali raza

C#, .Net ,Asp.net and my thoughts

parameter passing to crystal report object

When you have to send parameter form asp.net code behind to crystal report then kindly used this syntex or statement to achieve the task
for example
 ReportObjectVariable.SetParameterValue(ParmeterName,value)
for example if  rpt is my report and i send value to customer key and objCustomer is my business object then the sample will be as follow 
  rpt.SetParameterValue(REPORT_SP_PARAMETER_CUSTOMER_KEY, objCustomer.MasCustKey)
More real word examples are as follow
  rpt.SetParameterValue(REPORT_SP_PARAMETER_MONTH, CType(Request.QueryString.Item("Month"), Integer))
 rpt.SetParameterValue(REPORT_SP_PARAMETER_YEAR, CType(Request.QueryString.Item("Year"), Integer))
rpt.SetParameterValue(REPORT_SP_PARAMETER_CUSTOMER_KEY, objCustomer.MasCustKey, "StatementHead.rpt")
 rpt.SetParameterValue(REPORT_SP_PARAMETER_CUSTOMER_KEY, objCustomer.MasCustKey, "StatementFoot.rpt")

 

 

One response to “parameter passing to crystal report object

  1. baurdotnet May 22, 2008 at 5:44 am

    Hi,
    how do you managed to format code text?
    or there is special tag in the wordpress. another from ‘code’ tag.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: