HI jeyaseelan,
I have below situation
1) I have first page which is having twp datetime pickers ie.FromDate and ToDate. When i click submit button at that time second page is open like this,
Response.Write(
"<script>window.open('MK_View_PotentialClientList.aspx?fromdate=" + fromdate + "&todate=" + todate + "','User','toolbar=no,width=1000,height=600,left=5,top=5,scrollbars=1')</script>");
2) This second page contains below code,
protected void Page_Init(object sender, EventArgs e)
{
try
{
fromdate = Convert.ToDateTime(Request.QueryString["fromdate"].ToString().Trim());
todate = Convert.ToDateTime(Request.QueryString["todate"].ToString().Trim());
paramField.Name = "@FromDate";
paramDiscreteValue.Value = fromdate;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
paramField = new ParameterField();
paramField.Name = "@ToDate";
paramDiscreteValue = new ParameterDiscreteValue();
paramDiscreteValue.Value = todate;
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
// Assign all parameters to store procedure for crystalreportviewer
CrystalReportViewer1.ParameterFieldInfo = paramFields;
//************************set the report path***********************
reportDocument.Load(Server.MapPath("MK_rpt_PotentialClientList.rpt"));
//**********************dynamic databse login*********************************************
ConnectionInfo connection = new ConnectionInfo();
connection.DatabaseName = Application["DBName"].ToString();
connection.ServerName = Application["DBServer"].ToString();
connection.UserID = Application["DBUserId"].ToString();
connection.Password = Application["DBPassword"].ToString();
//******************** First we assign the connection to all tables in the main report
foreach (CrystalDecisions.CrystalReports.Engine.Table table in reportDocument.Database.Tables)
{
//*********************************Cache the logon info block
TableLogOnInfo logOnInfo = table.LogOnInfo;
//*************************************Set the connection
logOnInfo.ConnectionInfo = connection;
//******************************Apply the connection to the table!
table.ApplyLogOnInfo(logOnInfo);
}
//******************************Load the report by setting the report source
CrystalReportViewer1.ReportSource = reportDocument;
CrystalReportViewer1.Visible = false;
string fileName = Server.MapPath("MK_rpt_PotentialClientList.rpt");
doc.Load(fileName);
ExportOptions ExpOptions = default(ExportOptions);
DiskFileDestinationOptions DiskFileDestOpts = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions FormatTypeOpts = new PdfRtfWordFormatOptions();
DiskFileDestOpts.DiskFileName = "E:\\Test.pdf";
ExpOptions = doc.ExportOptions;
{
ExpOptions.ExportDestinationType = ExportDestinationType.DiskFile;
ExpOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
ExpOptions.DestinationOptions = DiskFileDestOpts;
ExpOptions.FormatOptions = FormatTypeOpts;
}
doc.Export();
}
catch (Exception ex)
{
Trace.Warn(ex.Message.ToString());
Trace.Warn(ex.Source.ToString());
Trace.Warn(ex.TargetSite.ToString());
}
}
Here i am using Stored Procedure to pass parameters,
Below is the error.....
"Missing parameter values."
What changes i have to do here?
Thank You.