asp.net - PDF report not showing in Internet Explorer -
in project after saving data db show report (pdf ) in new page.it working fine on browsers expect ie .it show below pic
code
private string createle_anez() { try { reportdocument orpt = new reportdocument(); orpt.load(system.web.httpcontext.current.server.mappath("reports/le-einzel.rpt")); reportdocument subreportartikel = new reportdocument(); subreportobject subreportobjectartikel; subreportobjectartikel = orpt.reportdefinition.reportobjects["subreport1"] subreportobject; subreportartikel = subreportobjectartikel.opensubreport("le-artikel-subrepoert.rpt"); ctemplate objtemp = new ctemplate(); datatable dttemplate = objtemp.selectletemplate("anez"); orpt.setdatasource(dttemplate); datatable dtartikeldata = selectleartikel(); subreportartikel.setdatasource(dtartikeldata); #region set parameter values //aaddressen objcust = new aaddressen(); //objcust=new caddressen().selectaddressen(addressenid); cusers objuser = new cusers(); objuser.userid = userid; ausers objauser = objuser.selectuserprofile(); cland objland = new cland(); objland.id = objauser.land; objland.selectlandbyid(); objauser.landname = objland.lnd_name; cutilities objutil=new cutilities(); string strdate = ledate.day.tostring() + "." + ledate.month.tostring() + "." + ledate.year.tostring(); string strlands = selectleland(); /* requirement no :: 18895 ::: commented jyotheena jose :1/30/2014 11:21:17 string strsender = objauser.ort + " : " + strdate + " , " + " " + objauser.firmaname + " " + objauser.plz +" " + objauser.street + " , " + objauser.firstname + " " + objauser.lastname;*/ string strsender = objauser.ort + " : " + strdate + " , " + objauser.firmaname + ", " + objauser.street + ", " + objauser.plz + " " + objauser.ort + " , " + objauser.firstname + " " + objauser.lastname + " , " + objauser.position; string strledate = ledate.tostring("yyyymmdd") + "-"; string strcum = ""; string strnocum = ""; if (iscumulation == "t") strcum = "x"; else strnocum ="x"; switch (lenumber.trim().length) { case 1: strledate += "00" + lenumber; break; case 2: strledate += "0" + lenumber; break; default: strledate += lenumber; break; } parameterdiscretevalue pdescvalue; parameterfielddefinitions pfieldddefs; parameterfielddefinition pfieldloc = null; parametervalues pvalues = new parametervalues(); pfieldddefs = orpt.datadefinition.parameterfields; pdescvalue = new parameterdiscretevalue(); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "plandlist", strlands); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "psender", strsender); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "pledate", strledate); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "pbemerkungen", bemerk); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "pcum", strcum); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "pnocum", strnocum); createparameterfields(pdescvalue, pfieldddefs, pfieldloc, pvalues, "pcumtext", cumulation); #endregion string strfilename = "pdf/" + userid.tostring().trim() + "einzel.pdf"; if (!directory.exists(system.web.httpcontext.current.server.mappath("pdf"))) directory.createdirectory(system.web.httpcontext.current.server.mappath("pdf")); if (file.exists(system.web.httpcontext.current.server.mappath(strfilename))) file.delete(system.web.httpcontext.current.server.mappath(strfilename)); orpt.exporttodisk(crystaldecisions.shared.exportformattype.portabledocformat, system.web.httpcontext.current.server.mappath(strfilename)); return strfilename; } catch (exception ex) { throw new exception("cle->createle_anez", ex); } }
after in new page (viewpdf1.aspx)
rotected void page_load(object sender, eventargs e) { if (!ispostback) { if (session["rpt"] == null) return; else { string strvalues = session["rpt"].tostring(); string[] strdata = strvalues.split(','); //session.remove("rpt"); //viewstate["rpt"] = strdata[1].trim(); //viewstate["leno"] = strdata[0].trim(); //string strurl = viewstate["rpt"].tostring(); string strurl = strdata[1].trim(); dvpdfloader.innerhtml = "<object data='" + strurl + "' type='application/pdf' width='100%' height='468px'></object>"; string strquery = request.querystring["s"]; if (strquery != null && cutilities.decrypt(strquery.trim()) == "mailsent") { lblmessage.text = "e-mail erfolgreich gesendet"; } } } }
please solve error..
regards jithesh
here solution :)
internet explorer 10 & 11 considered best possible versions of microsoft‘s proprietary browser; internet explorer. windows 8 windows 7, can use ie 10 , ie 11. in both these iterations, users have reported facing problem that, whenever try download , open pdf file, internet explorer not open pdf files.
http://www.thewindowsclub.com/pdf-files-will-open-internet-explorer
Comments
Post a Comment