Jump to content

HTML FRAME ÇIKTI ALMAK


Recommended Posts

Guest Huseyin
Posted

Kolay gelsin arkadaşlar

Fastreportu kullanmak pek de işime gelmiyor çünkü dll'İ çalıştırdığım yerler benden rapordan ziyade bir html istiyor çünkü bunları aynı zamanda mailde gönderiyorum fakat bazı işlemler bittikten sonra bu gönderdiğim html sayfasını da çıktı olarak almak istiyor.

Yani Unihtmlframe oluşturmuş olduğum html görüntüsünün çıktısını nasıl alırım

Posted

function PrintMe(DivID) {var disp_setting="toolbar=yes,location=no,";
disp_setting+="directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
   var content_vlue = document.getElementById(DivID).innerHTML;
   var docprint=window.open("","",disp_setting);
   docprint.document.open();
   docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
   docprint.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
   docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">');
   docprint.document.write('<head><title>My Title</title>');
   docprint.document.write('<style type="text/css">body{ margin:0px;');
   docprint.document.write('font-family:verdana,Arial;color:#000;');
   docprint.document.write('font-family:Verdana, Geneva, sans-serif; font-size:12px;}');
   docprint.document.write('a{color:#000;text-decoration:none;} </style>');
   docprint.document.write('</head><body onLoad="self.print()"><center>');
   docprint.document.write(content_vlue);
   docprint.document.write('</center></body></html>');
   docprint.document.close();
   docprint.focus();
}

bunu unisession.addjs ile çalıştıracaksınız.

 

daha sonra unisession.addjs(PrintMe('''+unihtmlframe.jsname+'_id''));

ile yazdırma penceresini açacaksınız

  • Upvote 1
Guest Huseyin
Posted

Bir yere yazamıyorum 

Daha doğrusu hayri bey Unissession.addjs ile çalıştıracaksınız deyince server module aradım ama bulamadım nereye yazmyalıyım diye şu anda bir fikrim kalmadı nereye yazacağımla ilgili

Delphi programlama dışında biraz acemeyiim kusuruma bakmayın

Guest Huseyin
Posted
UniSession.AddJS('function PrintMe(DivID) {var disp_setting="toolbar=yes,location=no,";'+
                  'disp_setting+="directories=yes,menubar=yes,";'+
                  'disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";'+
                  'var content_vlue = document.getElementById(DivID).innerHTML;'+
                  'var docprint=window.open("","",disp_setting);'+
                  'docprint.document.open();'+
                  'docprint.document.write('+''''+'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'+''''+');'+
                  'docprint.document.write('+''''+'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'+''''+');'+
                  'docprint.document.write('+''''+'<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'+''''+');'+
                  'docprint.document.write('+''''+'<head><title>My Title</title>'+''''+');'+
                  'docprint.document.write('+''''+'<style type="text/css">body{ margin:0px;'+''''+');'+
                  'docprint.document.write('+''''+'font-family:verdana,Arial;color:#000;'+''''+');'+
                  'docprint.document.write('+''''+'font-family:Verdana, Geneva, sans-serif; font-size:12px;}'+''''+');'+
                  'docprint.document.write('+''''+'a{color:#000;text-decoration:none;} </style>'+''''+');'+
                  'docprint.document.write('+''''+'</head><body onLoad="self.print()"><center>'+');'+
                  'docprint.document.write(content_vlue);'+
                  'docprint.document.write('+''''+'</center></body></html>'+''''+');'+
                  'docprint.document.close();'+
                  'docprint.focus();'+
                    '});' );
UniSession.AddJS('PrintMe('''+unihtmlframe1.jsname+'_id'')');

Kodu bu hale getirdim bu seferde bana

 

bu şekilde bir hata verdi

printfail.png

  • Administrators
Posted
function PrintMe(DivID) {var disp_setting="toolbar=yes,location=no,";
disp_setting+="directories=yes,menubar=yes,";
disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
   var content_vlue = document.getElementById(DivID).innerHTML;
   var docprint=window.open("","",disp_setting);
   docprint.document.open();
   docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"');
   docprint.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
   docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">');
   docprint.document.write('<head><title>My Title</title>');
   docprint.document.write('<style type="text/css">body{ margin:0px;');
   docprint.document.write('font-family:verdana,Arial;color:#000;');
   docprint.document.write('font-family:Verdana, Geneva, sans-serif; font-size:12px;}');
   docprint.document.write('a{color:#000;text-decoration:none;} </style>');
   docprint.document.write('</head><body onLoad="self.print()"><center>');
   docprint.document.write(content_vlue);
   docprint.document.write('</center></body></html>');
   docprint.document.close();
   docprint.focus();
}

Bunu Form'un "Script" alanına ekleyin.

 

Sonra bunu çağırın.

UniSession.AddJS('PrintMe('''+unihtmlframe1.jsname+'_id'')');
Guest Huseyin
Posted

Fashad bey bunu da denedim fakat burada da şu gerçekleşti.

Sonsuz bir loading oluyor mainform açılmıyor

Guest Huseyin
Posted

tabiki 

ve bu hata ile karşılaşıyorum

 

 O26=new Ext.window.Window({id:"O26_id",retfalse:{},onEsc:Ext.emptyFn,layout:"anchor",title:"UniForm1",maximizable:true,minimizable:true,resizable:true,width:624,height:754});O26.nm="O26";_cdo_("UniForm1");UniForm1.ajxS=AjaxSuccess;UniForm1.ajxF=AjaxFailure;O26.rootObj=true;UniForm1.appRoot="/";_cdo_(null,O26,"window",UniForm1); O2E=new Ext.form.Panel({id:"O2E_id",border:false,layout:"absolute",anchor:"100% 100%",tabItems:new Ext.util.MixedCollection()});O2E.nm="O2E";_cdo_(null,O2E,"form",UniForm1);O26.add(O2E); O36= (function(P0){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=beforeclose&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"beforeclose"});});O36.nm="O36";O26.on("beforeclose",O36); O37= (function(P0,P1,P2){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=move&this="+P0.nm+"&x="+P1+"&y="+P2+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"move"});});O37.nm="O37";O26.on("move",O37); O38= (function(P0,P1,P2){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=resize&this="+P0.nm+"&w="+P1+"&h="+P2+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"resize"});});O38.nm="O38";O26.on("resize",O38); O39= (function(P0){_saf_(P0);return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=activate&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"activate"});});O39.nm="O39";O26.on("activate",O39); O3A= (function(P0){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=deactivate&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"deactivate"});});O3A.nm="O3A";O26.on("deactivate",O3A); O3B= (function(P0){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=maximize&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"maximize"});});O3B.nm="O3B";O26.on("maximize",O3B); O3C= (function(P0){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=minimize&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"minimize"});});O3C.nm="O3C";O26.on("minimize",O3C); O3D= (function(P0){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O26&Evt=restore&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O26,e:"restore"});});O3D.nm="O3D";O26.on("restore",O3D);O26.on("deactivate",function(f){_sdf_(f)});ajaxRequest(O26,"cinfo",["ci="+_gci_()]); O3E=new Ext.panel.HTML({id:"O3E_id",layout:"absolute",bodyBorder:false,border:false,bodyCls:"x-panel-white",header:false,border:0,width:612,height:698,x:0,y:25,style:"border:none;"});O3E.nm="O3E";_cdo_("UniHTMLFrame1",O3E,null,UniForm1);O2E.add(O3E); O46=new Ext.button.Button({id:"O46_id",text:"UniBitBtn1",width:612,height:25,x:0,y:0,scale:"medium"});O46.nm="O46";_cdo_("UniBitBtn1",O46,null,UniForm1);O2E.add(O46);O26.show("");O26.retfalse.beforeclose=1;_axy_(O26);O26.header.child("component").el.child(".x-window-header-text",true).style.marginLeft="19px";O26.header.el.dom.style.background="url(cache/Project1/fjc3EKQuhccnFLj/app_main_icon.png) no-repeat 4px 4px";function PrintMe(DivID) {var disp_setting="toolbar=yes,location=no,";disp_setting+="directories=yes,menubar=yes,";disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";   var content_vlue = document.getElementById(DivID).innerHTML;   var docprint=window.open("","",disp_setting);   docprint.document.open();   docprint.document.write('<!DOCTYPE html PUBLIC "-   docprint.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');   docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">');   docprint.document.write('<head><title>My Title</title>');   docprint.document.write('<style type="text/css">body{ margin:0px;');   docprint.document.write('font-family:verdana,Arial;color:#000;');   docprint.document.write('font-family:Verdana, Geneva, sans-serif; font-size:12px;}');   docprint.document.write('a{color:#000;text-decoration:none;} </style>');   docprint.document.write('</head><body onLoad="self.print()"><center>');   docprint.document.write(content_vlue);   docprint.document.write('</center></body></html>');   docprint.document.close();   docprint.focus();}; O4A= (function(P0){return Ext.Ajax.request({url:"/HandleEvent",params:"Ajax=1&IsEvent=1&Obj=O46&Evt=click&this="+P0.nm+""+_gv_(O2E),success:AjaxSuccess,failure:AjaxFailure,obj:O46,e:"click"});});O4A.nm="O4A";O46.on("click",O4A);O3E.update(" <!doctype html>\n <html>\n <head>\n <title>HTML Editor - Full Version</title>\n </head>\n <body>\n <table border=\"1\" cellpadding=\"1\" cellspacing=\"1\" style=\"width: 500px;\" summary=\"Denemedir\">\n <caption>Denemedir</caption>\n <tbody>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n </tbody>\n </table>\n \n <p> </p>\n </body>\n </html>\n",true);O3E.fireEvent("afterupdatehtml",O3E);

 

 

  • Administrators
Posted

MainForm Script'e bunu ekleyin:

function PrintMe(DivID)
{
   var disp_setting="toolbar=yes,location=no,";
   disp_setting+="directories=yes,menubar=yes,";
   disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25";
   var content_vlue = document.getElementById(DivID).innerHTML;
   var docprint=window.open("","",disp_setting);
  
   docprint.document.open();
   docprint.document.write('<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Strict/EN"');
   docprint.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
   docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">');
   docprint.document.write('<head><title>My Title</title>');
   docprint.document.write('<style type="text/css">body{ margin:0px;');
   docprint.document.write('font-family:verdana,Arial;color:#000;');
   docprint.document.write('font-family:Verdana, Geneva, sans-serif; font-size:12px;}');
   docprint.document.write('a{color:#000;text-decoration:none;} </style>');
   docprint.document.write('</head><body onLoad="self.print()"><center>');
   docprint.document.write(content_vlue);
   docprint.document.write('</center></body></html>');
   docprint.document.close();
   docprint.focus();
}
Guest Huseyin
Posted

Çok Teşekkür ederim farshad bey elinizie kolunuza sağlık:)

  • 4 months later...
Guest Huseyin
Posted

Tekrardan kolay gelsin bir denemek amacıyla gene bunu denedim fakat bana 'print me is not defined' hatası veriyor bu neden olabilir

başka proje denediğimde oluyorda bunda neden olmyor

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...