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

Parameter is alphanumeric

Status
Not open for further replies.

cathiec

Programmer
Oct 21, 2003
139
IE
i have an asp.net web app. the sql data adapter selects the required fields from a view. i then export the dataset to pdf using two parameter fields. these are alphanumeric fields that being with two letters of the alphabet and have a range of numbers after them. e.g. EQ001, IS888 - the letters vary. instead of using the parameters all rows are returned regardless of what parameters are chosen. below is my asp.net code:

private void Button1_Click(object sender, System.EventArgs e)
{
this.sqlDataAdapter1.Fill(this.dataSet21);


rptGETASSETS crReportDocument = new rptGETASSETS();

crReportDocument.SetDataSource(dataSet21);


ParameterValues myparameterValues = new ParameterValues();
ParameterDiscreteValue myparamDiscreteValue = new ParameterDiscreteValue();
myparamDiscreteValue.Value = DropDownList2.SelectedItem.Value.ToString();
myparameterValues.Add(myparamDiscreteValue);
crReportDocument.DataDefinition.ParameterFields["FromCode"].ApplyCurrentValues(myparameterValues);


ParameterValues myparameterValues2 = new ParameterValues();
ParameterDiscreteValue myparamDiscreteValue2 = new ParameterDiscreteValue();
myparamDiscreteValue2.Value = DropDownList3.SelectedItem.Value.ToString();
myparameterValues2.Add(myparamDiscreteValue2);
crReportDocument.DataDefinition.ParameterFields["ToCode"].ApplyCurrentValues(myparameterValues2);





string ExportPath;
ExportPath = Request.PhysicalApplicationPath;

crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crExportOptions = crReportDocument.ExportOptions;

string fName = Session.SessionID.ToString() +".pdf";

crDiskFileDestinationOptions.DiskFileName = ExportPath + fName;

crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;

crReportDocument.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(fName);
Response.Flush();
Response.Close();


}


the parameters in the crystal report are FromDate and ToDate. the formula selections fields stipulate the following conditions for each:

{ma_asset.ASSET_CODE} >= {?FromCode}

{ma_asset.ASSET_CODE} <= {?ToCode}

i would really appreciate any help on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top