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

use parameter in crystal report on web

Status
Not open for further replies.

chpun

MIS
May 26, 2004
1
US
i would like to send parameter from asp to crystal. i found solution for asp.net that 'useParameterFieldController'. how can i do.

thank you
 

I export my data to pdf using the following c# code in asp.net:

private void Export(object sender, System.EventArgs e)
{

string strConnection = ConfigurationSettings.AppSettings["ConnectName"];

SqlDataAdapter da;
SqlParameter workParam;
da = new SqlDataAdapter("stpASTfandFByLoc", strConnection);
da.SelectCommand.CommandType = CommandType.StoredProcedure;

workParam = new SqlParameter("@pANALF1", System.Data.SqlDbType.Char);
workParam.Direction = ParameterDirection.Input;
workParam.Value =DropDownList1.SelectedItem.Value.ToString();
da.SelectCommand.Parameters.Add(workParam);



rptFandFByLoc crReportDocument = new rptFandFByLoc();
crReportDocument.SetDataSource(this.dstFandFByLoc1);

ParameterValues myparameterValues = new ParameterValues();
ParameterDiscreteValue myparamDiscreteValue = new ParameterDiscreteValue();
myparamDiscreteValue.Value = TextBox1.Text;
myparameterValues.Add(myparamDiscreteValue);


string ExportPath;
ExportPath = Request.PhysicalApplicationPath;
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crExportOptions = crReportDocument.ExportOptions;
Session["filename"] = Session.SessionID.ToString() + ".pdf";

crDiskFileDestinationOptions.DiskFileName = ExportPath + Session["filename"].ToString();

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

crReportDocument.Export();

}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top