tags:

views:

85

answers:

1

We are getting correct output for crystal report using dataset which does not have a sub report.But it does not work for subreports? How to pass crystal report's sub reports parameter values using dataset through coding in vb.net? We are using Msaccess as back end

Please help

A: 

Im not sure exactly what you are asking, but here is a way of setting a creating, setting and passing params to a crystal report

Load up a standard dataset from your db. Use the DateSet.WriteXmlSchema to create an Xml Schema. Use the visal studio tool Xsd.exe to create a type safe DataSet. Import this into your project. load up data into your new type safe dataset from your DB and set that to be the reports datasource.

The below code then enables you to set the params

Private Sub foo()
  Dim parameterValues As New ParameterValues()
  parameterValues.Add("MyValue")
  MyDataSourceName.DataDefinition.ParameterFields("MyParamName").ApplyCurrentValues(parameterValues)
End Sub

I hope this helps

Ben