string pdf = Server.MapPath(Request.ApplicationPath + @"\Pdf\" + MercatorApi.Api.NewId() + ".pdf");
List<MercatorSqlParam> lp = new List<MercatorSqlParam>();
lp.Add(new MercatorSqlParam("@const_1", n));
lp.Add(new MercatorSqlParam("@s_id", s_id, System.Data.SqlDbType.Char));
lp.Add(new MercatorSqlParam("@s_modele", s_modele, System.Data.SqlDbType.Char));
List<MercatorUi.Reporting.OutputDescriptor> listOutputDescriptors = new List<MercatorUi.Reporting.OutputDescriptor>();
listOutputDescriptors.Add(new MercatorUi.Reporting.OutputDescriptorExport(MercatorUi.Reporting.ExportReportEnum.PDF, pdf, MercatorUi.Reporting.ExportOpenAfterEnum.No));
Api.LastError = "";
MercatorUi.Reporting.ReportingStatic.RunReportFromDocum("B714041B3E", listOutputDescriptors, lp);
if (!System.IO.File.Exists(pdf))
{
if (!string.IsNullOrEmpty(Api.LastError))
Response.Write(pdf + " : " + Api.LastError);
else
Response.Write("Impossible to create " + pdf + " !");
Response.End();
}
Response.Redirect("pdf/" + Api.JustFName(pdf));