troubleshooting Question

ugent:can i write and download data in excel from pl/sql?

Avatar of samir25
samir25 asked on
DatabasesMicrosoft ExcelSpreadsheets
5 Comments1 Solution765 ViewsLast Modified:
hi
is it possible to create an excel and write data from pl/sql? currently my pl/sql has this code. but it writes from the database. i want to write few lines on my own
e.g
NAME: SEWWEW
SERIAL: 3132134
...
just 5-6 lines. is it possible?

 if q is null
   then
      htp.p (format.pagestart);
      htp.p ('<img src="/owc/SpreadSheet.gif" style="border:0;" alt="Excel Query"/> Excel Query');
      htp.formOpen (format.self,'GET');
         htp.p ('Enter query without semicolon -- ie: select * from scott.emp');
         htp.br;
         htp.formtextarea2 ('q', 7, 50);
         htp.br;
         htp.formsubmit (cattributes => 'class="button10b"');
      htp.formClose;
      htp.p (format.pageend);
      else       
            firststring :='this is testing';
            htp.p('<html><head><title>Excel - 7500 Row Limit</title></head>');
            htp.p('<OBJECT id=owc classid=clsid:0002E541-0000-0000-C000-000000000046');
            htp.p('   codebase="'||format.host||'/ocx/OWC10.DLL">');
            htp.p('   <PARAM NAME="DataType" VALUE="CSVDATA">');
            htp.p('   <PARAM NAME="CSVURL" VALUE="'||htf.escape_url(format.path||'xcel?typ=CSV&q='||q)||'">');                        
            htp.p('   <PARAM NAME="AutoFit" VALUE="1">');  
            htp.p('</OBJECT>');
            htp.p('<script language="VBScript">');
            htp.p('owc.TitleBar.Caption = "'||title||'"');
            htp.p('owc.AutoFit = true ');
            htp.p('owc.ViewableRange = owc.ActiveSheet.UsedRange.Address');
            htp.p('owc.ActiveSheet.UsedRange.Rows(1).Font.Bold = true');
            htp.p('owc.ActiveSheet.UsedRange.Rows(1).Interior.Color = "#C0C0C0"');
            htp.p('owc.ActiveSheet.UsedRange.Font.Size = 8');
            htp.p('owc.maxwidth = "98%"');
            htp.p('owc.maxheight = "95%"');
            htp.p ('owc.displaytoolbar=true');
            if title is null then
                      htp.p ('owc.displaytitlebar=false');
            end if;
          htp.p ('</script>');      
   end if;
end;
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros