Capturing a report as an HTML string

I need to run a report from within PL/SQL and capture the resulting data as a string. I will use the string to build an email. This will enable the email and the report to look similar without maintaining two sets of code.
I am at a loss. Please suggest some references or send me a code sample.
Thanks

Rough,incomplete code sample
l_req := utl_http.begin_request(l_url);
l_resp := utl_http.get_response(l_req);
while (not done) loop
   utl_http.read_raw(l_resp,l_data);
   dbms_lob.write(l_text,utl_raw.length(l_data),l_offset,utl_raw.cast_to_varchar2(l_data));
   l_offset := l_offset + utl_raw.length(l_data);
   if (utl_raw.length(l_data) < 3000) then         -- 3000 is the size of the RAW variable
      done := TRUE;
   end if;
end loop;
utl_http.end_response(l_resp);

Similar Messages

  • Reports 6i and html generation

    I am rendering report output in html via the web from reports server 6i on the NT platform. When viewing the report in a browser there is a bold letter "t" in the upper left hand corner of the screen. I also get duplicate ")" and "-" characters in various places. This does not happen if I render the report in PDF format or if the report is run locally in Reports Designer. Any help would be greatly appreciated...

    I've had the same symptom. Try uninstalling Adobe and reinstalling the latest version. This seems to reset the required setup items. Also, I have experienced trouble when using a reports parameter form-- the parameter form comes up fine but then the report doesn't open properly. Again, reinstalling the latest version of Adobe cures the problem. I have talked to some people who switched to Netscape to cure this. Be careful with Netscape 6 though, it seems quite slow.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Santanu Chaudhuri ([email protected]):
    Is there a specific setting in IE 5.5 or Acrobat Reader. I am running reports using Reports 6i. When I am selecting pdf as the output, it doesn't work in some machines but work in others. I get messages like
    " There is no viewer available for the type of object you are trying to open. Do you want to download a viewer for this type of object?" or "An error occured while trying to open the document". I do have Acrobat Reader in all the PCs I am testing in. This is really frustrating and I could not find a way to solve it. Anyone had the same problem??? Please let the forum know.
    Thanks
    Santanu Chaudhuri<HR></BLOCKQUOTE>
    null

  • Tall report in both HTML and PDF

    Hi,
    I have a report in 10.1.2.0.2 with three logical parts; a header (logo, column titles), a body (actual data) and footer (column sums, some texts). At the moment I'm just using the main section (not header/trailer) but I'm willing to change.
    Depending on the parameters the report will give 1-20 pages (if I was to print them) of output.
    I would like to offer both HTML and PDF output but I'm having some issues.
    If I set the height of the main section to 25 centimeters/10 inches and run the reports with parameters that produce 2 pages of output, I will get two pages i the PDF perfectly. The HTML will then get a seam (empty row) after 25cm/10In and then continue. The problem is that the second part of data is in a separate html table, making the columns not aligned to the first part.
    So, PDF OK, HTML ugly.
    If I set the height of the main section to 250 centimeters/100 inches and run the report again the HTML is fine. One long table and therefore consistent columns.
    Now the PDF consists of only one page. It looks fine but after the last row I can scroll down much more as the PDF "page" is really tall now.
    So, PDF ugly, HTML OK.
    Any suggestions for acheiving a nice result in both PDF and HTML?
    Kind regards
    Tomas Albinsson
    Stockholm, Sweden

    Many thanks Denis, worked perfectly!
    Now the customer has decided that they want the header on each page...
    So now I don't need to use your solution but it's good to know how to solve it.
    Fortunately (?) I've got a new problem now.
    If the output spans two pages I now get one head, the first part of data, head again, rest of data and foot. Fine.
    The problem is that the columns of head and data on page two are not aligned with the ones on page one.
    So head and data always align, but only withing the page. Page two might be much wider than page one.
    This is is HTML output and the frames are set to horizontally fixed.
    Seems to be the footer. Didn't help putting it in a horizontally fixed frame of it's own.
    Suggestions?
    Kind regards
    Tomas

  • Can not print report when using HTML or DHTML

    Can not print report when using HTML or DHTML. When I open the report and click the print icon I get a small blank dialog box and then nothing. If I change to activex it works and I can print.
    Any Ideas?
    Thanks
    Jeff

    Hi,
    I did not come across this situation before. Did you apply any fix packs. Try to check whether its a issue which can be fixed by applying fix pack( try to check release notes of fix pack and see if they mentioned any thing about this).
    Thanks,
    SK.

  • How to parse select lines in an html string?

    I've been writing a program to deal with demographic data and the first server it calls returns an xml string. However, the backup server returns an html string instead of an xml string, so the formatting is a bit different. I was going to use a regex as I did with the xml server, but regex's don't work that well with html. i was wondering if you could offer some advice on how to effectively parse the html string? It is in this format <html>
    <head>
    <meta name="Description" content="ZIP Code Demographics"/>
    <meta name="Keywords" content="zip, zip code, zipcode, demographics, 2000, county, lookup, city, state"/>
    <title>ZIP Code Demographics Lookup</title>
    <link rel="stylesheet" type="text/css" href="http://www.MelissaData.com/style.css" />
    </head>
    <body topmargin="0" onload="document.getElementById('text1').focus()">
    <div align="center">
    <!--Start of top.asp 9/2/08 Ray-->
    <script type='text/javaScript' src='http://www.melissadata.com/cgi-bin/lib.js'></script>
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="744" style="font-size:8pt; font-family:Arial; color: #666666">
            <tr valign='middle'  height='24'>
                 <td align="left" rowspan=2><a href="/index.htm">
                    <img border="0" src="http://www.melissadata.com/home/new1207/MelissaData-logo.gif" alt="Melissa Data Home Page" /></a><img border="0" src="http://www.melissadata.com/home/new1207/1-800-number.gif" width="112" height="22" alt="Call 1-800-MELISSA for Data Quality Solutions" /></td>
                <td colspan='2' align="right">
                    <font size="1" face="Verdana">
                <script type="text/javaScript">var r=uCookie("r"); var s=uCookie("s"); var n=uCookie("n");
                    //document.write (document.cookie);
                    if (r == "YES" && s == "IN" && n != "" ) document.write ("Hello <b>" + n.replace(/\+/g," ") + "<\/b>   [<font size=1><a href=/user/signout.aspx>Sign out<\/a>, <a href=/user/user_account.aspx>My Account<\/a></font>]");else document.write (" <a href=/user/signin.aspx>Sign In<\/a> ");
                </script></font></td></tr>
            <tr height='24'>
                <form method="get" action="http://w2.melissadata.com/cgi-bin/search.asp">          
                <td align="right" height=30>               
                    <a href="/netcart/order1.aspx"><img border="0" src="http://www.melissadata.com/home/new1207/Hompage-shoppincart.gif" alt="Shopping Cart" /></a>
                    <a style="color: #666666" href="/netcart/order1.aspx">Buy</a>
                    | <a style="color: #666666" href="/cgi-bin/newsletters.asp">Newsletters</a> | Search
                    <input name="indata" style="font-size:7pt; font-family:Arial" size="10" /><input type="image" src="http://www.melissadata.com/home/new1207/hompage-arrow.gif" style="vertical-align: middle"  value="Search" name="submit1" />
        </td></form></tr>
        </table>
        <style="font-size:10pt; font-family:Arial; color: #0066cc" type="text/css">
        <table align="center" border="0" cellpadding="4" cellspacing="0" width="744">
            <tr>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/products/index.htm">Products</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/solutions/index.htm">Solutions</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/download.htm">Downloads</a> </b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/tech/tech.html">Support</a> </font></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/resources/index.htm">Resources</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/lookups/index.htm">Lookups</a></b></td>
                <td align="center" width="106">
                    <b><a style="text-decoration: none" href="/cgi-bin/contact.asp">Contact Us</a></b></td></tr>   
        </table></style>
    <!-- Start Image BanAd.asp-->
    <div align=center><a href='/cgi-bin/BanAd.asp?id=135'><img alt='Click here' src='/cgi-bin/BanImage.asp?id=135'></a></div><!-- End Image BanAd.asp-->
    <!--TitleBorder in Shared.asp -->
    <table width="744" cellspacing=0 border=1 bgcolor="#F7F7F7"><tr><td align=left><font color="#ce0000" size="5">ZIP Code Demographics Lookup</font></td><form><td width=120 align=center><input title='Help for ZIP Code Demographics Lookup' type=button onClick=openHelpWindow('/lookups/help/zipdemo2000.asp') value=Help>  <a title='Lookups home page' href=/lookups/index.htm>Index</a></td></form></tr></table>
    <!--TitleBorder End-->
    <form action="ZipDemo2000.asp" name="Demo2000">
    <table width="400" class="Disp">
    <tr><td align="center"><b>Enter a 5-Digit ZIP Code</b>
        <input class="Disp" title="Enter a ZIP Code" id="text1" size="5" name="ZipCode" maxlength="5"/> <input type="submit" value="Submit"/>
    </td></tr>
    </table>
    </form>
    <table cellspacing="0" cellpadding="1" width="750" border="2" bgcolor="#ffffcc">
    <tr bgcolor="lightblue"><td colspan="4" align="center">Year 2000 Demographics of <br><b>ZIP Code 90041</b><br><b>LOS ANGELES, California</b><br><a href=mapzipv.asp?zip=90041>Map of ZIP Code</a></td></tr>
    <tr bgcolor="#bbffff"><td>TOTAL POPULATION [1]</td><td >P001</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P001</td></tr>
    <tr><td>   Total</td><td align=right ><b> 27,864</b></td></tr>
    <tr bgcolor="#bbffff"><td>URBAN AND RURAL [6]</td><td >P002</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P002</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         Urban:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>           Inside urbanized areas</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>           Inside urban clusters</td><td align=right ><b> 0</b></td></tr>
    <tr><td>         Rural</td><td align=right ><b> 0</b></td></tr>
    <tr><td>         Not defined for this file</td><td align=right ><b> 0</b></td></tr>
    <tr bgcolor="#bbffff"><td>RACE [8]</td><td >P007</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P007</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         White alone</td><td align=right ><b> 13,429</b></td></tr>
    <tr><td>         Black or African American alone</td><td align=right ><b> 630</b></td></tr>
    <tr><td>         American Indian and Alaska Native alone</td><td align=right ><b> 242</b></td></tr>
    <tr><td>         Asian alone</td><td align=right ><b> 7,123</b></td></tr>
    <tr><td>         Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 42</b></td></tr>
    <tr><td>         Some other race alone</td><td align=right ><b> 4,738</b></td></tr>
    <tr><td>         Two or more races</td><td align=right ><b> 1,660</b></td></tr>
    <tr bgcolor="#bbffff"><td>HISPANIC OR LATINO BY RACE [17]</td><td >P008</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P008</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         Not Hispanic or Latino:</td><td align=right ><b> 17,109</b></td></tr>
    <tr><td>           White alone</td><td align=right ><b> 8,468</b></td></tr>
    <tr><td>           Black or African American alone</td><td align=right ><b> 555</b></td></tr>
    <tr><td>           American Indian and Alaska Native alone</td><td align=right ><b> 105</b></td></tr>
    <tr><td>           Asian alone</td><td align=right ><b> 7,053</b></td></tr>
    <tr><td>           Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 30</b></td></tr>
    <tr><td>           Some other race alone</td><td align=right ><b> 73</b></td></tr>
    <tr><td>           Two or more races</td><td align=right ><b> 825</b></td></tr>
    <tr><td>         Hispanic or Latino:</td><td align=right ><b> 10,755</b></td></tr>
    <tr><td>           White alone</td><td align=right ><b> 4,961</b></td></tr>
    <tr><td>           Black or African American alone</td><td align=right ><b> 75</b></td></tr>
    <tr><td>           American Indian and Alaska Native alone</td><td align=right ><b> 137</b></td></tr>
    <tr><td>           Asian alone</td><td align=right ><b> 70</b></td></tr>
    <tr><td>           Native Hawaiian and Other Pacific Islander alone</td><td align=right ><b> 12</b></td></tr>
    <tr><td>           Some other race alone</td><td align=right ><b> 4,665</b></td></tr>
    <tr><td>           Two or more races</td><td align=right ><b> 835</b></td></tr>
    <tr bgcolor="#bbffff"><td>SEX BY AGE [49]</td><td >P012</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P012</td></tr>
    <tr><td>   Total:</td><td align=right ><b> 27,864</b></td></tr>
    <tr><td>         Male:</td><td align=right ><b> 13,324</b></td></tr>
    <tr><td>           Under 5 years</td><td align=right ><b> 862</b></td></tr>
    <tr><td>           5 to 9 years</td><td align=right ><b> 974</b></td></tr>
    <tr><td>           10 to 14 years</td><td align=right ><b> 872</b></td></tr>
    <tr><td>           15 to 17 years</td><td align=right ><b> 525</b></td></tr>
    <tr><td>           18 and 19 years</td><td align=right ><b> 511</b></td></tr>
    <tr><td>           20 years</td><td align=right ><b> 257</b></td></tr>
    <tr><td>           21 years</td><td align=right ><b> 287</b></td></tr>
    <tr><td>           22 to 24 years</td><td align=right ><b> 569</b></td></tr>
    <tr><td>           25 to 29 years</td><td align=right ><b> 969</b></td></tr>
    <tr><td>           30 to 34 years</td><td align=right ><b> 1,024</b></td></tr>
    <tr><td>           35 to 39 years</td><td align=right ><b> 1,140</b></td></tr>
    <tr><td>           40 to 44 years</td><td align=right ><b> 1,077</b></td></tr>
    <tr><td>           45 to 49 years</td><td align=right ><b> 987</b></td></tr>
    <tr><td>           50 to 54 years</td><td align=right ><b> 822</b></td></tr>
    <tr><td>           55 to 59 years</td><td align=right ><b> 647</b></td></tr>
    <tr><td>           60 and 61 years</td><td align=right ><b> 215</b></td></tr>
    <tr><td>           62 to 64 years</td><td align=right ><b> 270</b></td></tr>
    <tr><td>           65 and 66 years</td><td align=right ><b> 155</b></td></tr>
    <tr><td>           67 to 69 years</td><td align=right ><b> 258</b></td></tr>
    <tr><td>           70 to 74 years</td><td align=right ><b> 320</b></td></tr>
    <tr><td>           75 to 79 years</td><td align=right ><b> 252</b></td></tr>
    <tr><td>           80 to 84 years</td><td align=right ><b> 183</b></td></tr>
    <tr><td>           85 years and over</td><td align=right ><b> 148</b></td></tr>
    <tr><td>         Female:</td><td align=right ><b> 14,540</b></td></tr>
    <tr><td>           Under 5 years</td><td align=right ><b> 864</b></td></tr>
    <tr><td>           5 to 9 years</td><td align=right ><b> 949</b></td></tr>
    <tr><td>           10 to 14 years</td><td align=right ><b> 875</b></td></tr>
    <tr><td>           15 to 17 years</td><td align=right ><b> 534</b></td></tr>
    <tr><td>           18 and 19 years</td><td align=right ><b> 592</b></td></tr>
    <tr><td>           20 years</td><td align=right ><b> 285</b></td></tr>
    <tr><td>           21 years</td><td align=right ><b> 264</b></td></tr>
    <tr><td>           22 to 24 years</td><td align=right ><b> 600</b></td></tr>
    <tr><td>           25 to 29 years</td><td align=right ><b> 932</b></td></tr>
    <tr><td>           30 to 34 years</td><td align=right ><b> 1,035</b></td></tr>
    <tr><td>           35 to 39 years</td><td align=right ><b> 1,026</b></td></tr>
    <tr><td>           40 to 44 years</td><td align=right ><b> 1,131</b></td></tr>
    <tr><td>           45 to 49 years</td><td align=right ><b> 1,038</b></td></tr>
    <tr><td>           50 to 54 years</td><td align=right ><b> 970</b></td></tr>
    <tr><td>           55 to 59 years</td><td align=right ><b> 689</b></td></tr>
    <tr><td>           60 and 61 years</td><td align=right ><b> 261</b></td></tr>
    <tr><td>           62 to 64 years</td><td align=right ><b> 327</b></td></tr>
    <tr><td>           65 and 66 years</td><td align=right ><b> 208</b></td></tr>
    <tr><td>           67 to 69 years</td><td align=right ><b> 307</b></td></tr>
    <tr><td>           70 to 74 years</td><td align=right ><b> 482</b></td></tr>
    <tr><td>           75 to 79 years</td><td align=right ><b> 450</b></td></tr>
    <tr><td>           80 to 84 years</td><td align=right ><b> 331</b></td></tr>
    <tr><td>           85 years and over</td><td align=right ><b> 390</b></td></tr>
    <tr bgcolor="#bbffff"><td>MEDIAN AGE BY SEX [3]</td><td >P013</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Total population</td><td >P013</td></tr>
    <tr bgcolor="#bbffff"><td>Median age--</td><td >P013</td></tr>
    <tr><td>         Both sexes</td><td align=right ><b> 35.3</b></td></tr>
    <tr><td>         Male</td><td align=right ><b> 34.0</b></td></tr>
    <tr><td>         Female</td><td align=right ><b> 36.6</b></td></tr>
    <tr bgcolor="#bbffff"><td>HOUSEHOLDS [1]</td><td >P015</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Households</td><td >P015</td></tr>
    <tr><td>   Total</td><td align=right ><b> 9,375</b></td></tr>
    <tr bgcolor="#bbffff"><td>POPULATION IN HOUSEHOLDS [1]</td><td >P016</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Population in households</td><td >P016</td></tr>
    <tr><td>   Total</td><td align=right ><b> 26,409</b></td></tr>
    <tr bgcolor="#bbffff"><td>AVERAGE HOUSEHOLD SIZE [1]</td><td >P017</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Households</td><td >P017</td></tr>
    <tr><td>   Average household size</td><td align=right ><b> 2.82</b></td></tr>
    <tr bgcolor="#bbffff"><td>FAMILIES [1]</td><td >P031</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Families</td><td >P031</td></tr>
    <tr><td>   Total</td><td align=right ><b> 6,326</b></td></tr>
    <tr bgcolor="#bbffff"><td>POPULATION IN FAMILIES [1]</td><td >P032</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Population in families</td><td >P032</td></tr>
    <tr><td>   Total</td><td align=right ><b> 21,653</b></td></tr>
    <tr bgcolor="#bbffff"><td>AVERAGE FAMILY SIZE [1]</td><td >P033</td></tr>
    <tr bgcolor="#bbffff"><td>Universe: Families</td><td >P033</td></tr>
    <tr><td>   Average family size</td><td align=right ><b> 3.42</b></td></tr>
    </table>
    <!-- Start of bottom.asp-->
        <hr width="730" />
        <span style='font-size:8pt'>
        <a href="http://www.melissadata.com/enews/advisorarticles/index.htm">Articles</a> | 
        <a href="javascript:window.external.AddFavorite('http://www.melissadata.com/lookups/zipdemo2000.asp', 'ZIP Code Demographics Lookup')" target="_self">Bookmark</a> | 
        <a href="http://www.melissadata.com/cgi-bin/improve.asp?web">How Can We Improve?</a> | 
        <a href="http://www.melissadata.com/cgi-bin/batchprocessing.asp">Batch Processing</a> | 
        <a href="http://www.melissadata.com/cgi-bin/send.asp?Send2Friend">Email to Friend</a> | 
        <a href="http://www.melissadata.com/cgi-bin/catalogres.asp">Free Catalog</a> | 
        <a href="http://forum.melissadata.com/default.aspx">Forums</a> | 
        <a href="http://www.melissadata.com/terms-of-use.htm">Terms of Use</a>
        <font color="#ddddff"><br />  
        <script type="text/javascript"> var r=uCookie("r"); var f=uCookie("f"); var c=uCookie("c"); var l=uCookie("l");
            //document.write (r + ":" + f + ":" + c + ":" + l);</script></font></span>
    <!-- End of bottom.asp-->
    </div>
    </body>
    </html>.
    The numbers I wanted to extract are the age groups of "Under 5 years," "5 to 9 years," "10 to 14 years," and "15 to 17 years," from both male and female groups, which should add up to 8 numbers total. Here is the backup server portion of my program as well, so you can see what i'm doing.
    import java.net.*;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.HttpURLConnection;
    import java.io.*;
    import java.io.DataOutputStream;
    import java.io.BufferedReader;
    import java.io.StringReader;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.util.Scanner;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    import java.util.Arrays;
    public class TriParser
         static Scanner sc = new Scanner(System.in);
         public static int[] findValues(String text, String gender, String[] labels)
                Matcher m = Pattern.compile("<td>(.*?)</td>",
               Pattern.MULTILINE | Pattern.DOTALL).matcher(text);
                String allValues = m.find() ? m.group(1) : null; // TODO: handle if 'null' is returned!
                int[] values = new int[labels.length];
                for(int i = 0; i < labels.length; i++)
                  m = Pattern.compile(labels[i]+"[^>]+>(\\d+)").matcher(allValues);
                  if(m.find()) values[i] = Integer.parseInt(m.group(1));
                return values;
         public static void main(String[] args) throws Exception
            int zip;
            boolean validInteger;//indicates if zipcode is valid (has to be 5 digits)
            do
                    System.out.print("Enter a five-digit zipcode: ");
                    zip = sc.nextInt();
                    validInteger = true;
                    if((zip < 10000) || (zip > 99999))
                            validInteger = false;
                            System.out.println("Invalid Entry.  Please re-enter zipcode.");
            while(!validInteger);
            System.out.println(zip);     
            //String requestPart1 ="query=PREFIX+dc%3A++%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E+%0D%0APREFIX+census%3A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fschema%2Fcensus%2F%3E+%0D%0APREFIX+census1%3A+%3Ctag%3Agovshare.info%2C2005%3Ardf%2Fcensus%2Fdetails%2F100pct%2F%3E+%0D%0A%0D%0ADESCRIBE+%3Ftable+WHERE+%7B+%0D%0A+%3Chttp%3A%2F%2Fwww.rdfabout.com%2Frdf%2Fusgov%2Fgeo%2Fcensus%2Fzcta%2F";
            //String requestPart2 = "" + zip; // zipcode goes here
            //String requestPart3 ="%3E+census%3Adetails+%3Fdetails+.+%0D%0A+%3Fdetails+census1%3AtotalPopulation+%3Ftable+.+%0D%0A+%3Ftable+dc%3Atitle+%22SEX+BY+AGE+%28P012001%29%22+.+%0D%0A%7D%0D%0A&outputMimeType=text%2Fxml";
              String requestPart1 = "" + zip;
            String response = "";
            URL url = new URL("http://www.melissadata.com/lookups/zipdemo2000.asp?ZipCode="+requestPart1);
            URLConnection conn = url.openConnection();
            // Set connection parameters.
            conn.setDoInput (true);
            conn.setDoOutput (true);
            conn.setUseCaches (false);
            // Make server believe we are form data…
            conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
            DataOutputStream out = new DataOutputStream (conn.getOutputStream ());
            // Write out the bytes of the content string to the stream.
            out.writeBytes(requestPart1);
            out.flush ();
            out.close ();
            // Read response from the input stream.
            BufferedReader in = new BufferedReader (new
            InputStreamReader(conn.getInputStream ()));
            String temp;
            while ((temp = in.readLine()) != null)
                 response += temp + "\n"; // needs to be parsed to calculate the 4 numbers
            temp = null;
            in.close ();
              //System.out.println("Server response:\n" + response);
              // how to call the method:
              String[] ages = {"Under 5 years", "5 to 9 years", "10 to 14 years", "15 to 17 years"};
              String[] ages1 = {"Under 5 years"};
              String[] ages2 = {"5 to 9 years"};
              String[] ages3 = {"10 to 14 years"};
              String[] ages4 = {"15 to 17 years"};
              String female1 = Arrays.toString(findValues(response, "female", ages1));
              String female2 = Arrays.toString(findValues(response, "female", ages2));
              String female3 = Arrays.toString(findValues(response, "female", ages3));
              String female4 = Arrays.toString(findValues(response, "female", ages4));
              String female = female1 + "+" + female2 + "<" + female3 + ">" + female4 + "&";
              String male1 = Arrays.toString(findValues(response, "male", ages1));
              String male2 = Arrays.toString(findValues(response, "male", ages2));
              String male3 = Arrays.toString(findValues(response, "male", ages3));
              String male4 = Arrays.toString(findValues(response, "male", ages4));
              String male = male1 + "+" + male2 + "<" + male3 + ">" + male4 + "&";
              System.out.println(female);
              System.out.println(male);
            //Simplified string response, makes use of regular expressions
            //Start manipulation of numbers inside string
            int left = female.indexOf("[");
              int right = female.indexOf("]");
              // pull out the text inside the parens
              String parsed = female.substring(left+1, right);
              double parseddub = Double.parseDouble(parsed);
              //divide the group Under5Years into Under12Mo and 1to4Yr
              double Group1Adub = parseddub*.25;//25% for Under12Mo
              Group1Adub = Math.ceil(Group1Adub);
              int Group1A =(int)Group1Adub;
              double Group1Bdub = parseddub*.75;//75% for 1to4Yr
              Group1Bdub = Math.ceil(Group1Bdub);
              int Group1B =(int)Group1Bdub;
              int left2 = female.indexOf("+");
              int right2 = female.indexOf("<");
              // pull out the text inside the parens
              String parsed2 = female.substring(left2+2, right2-1);
              double parsed2dub = Double.parseDouble(parsed2);
              //divide the group 5to9Yr into 5Yr, 6to7Yr, and 8to9Yr
              double Group2Adub = parsed2dub*.2;//20% for 5Yr
              Group2Adub = Math.ceil(Group2Adub);
              int Group2A =(int)Group2Adub;
              double Group2Bdub = parsed2dub*.4;//40% for 6to7Yr
              Group2Bdub = Math.ceil(Group2Bdub);
              int Group2B =(int)Group2Bdub;
              double Group2Cdub = parsed2dub*.2;//20% for 8Yr
              Group2Cdub = Math.ceil(Group2Cdub);
              int Group2C =(int)Group2Cdub;
              double Group2Ddub = parsed2dub*.2;//20% for 9Yr
              Group2Ddub = Math.ceil(Group2Ddub);
              int Group2D =(int)Group2Ddub;
              int left3 = female.indexOf("<");
              int right3 = female.indexOf(">");
              // pull out the text inside the brackets
              String parsed3 = female.substring(left3+2, right3-1);
              int Group3A = Integer.valueOf(parsed3).intValue();
              int left4 = female.indexOf(">");
              int right4 = female.indexOf("&");
              // pull out the text inside the brackets
              String parsed4 = female.substring(left4+2, right4-1);
              int Group4A = Integer.valueOf(parsed4).intValue();
              int left5 = male.indexOf("[");
              int right5 = male.indexOf("]");
              String parsed5 = male.substring(left5+1, right5);
              double parsed5dub = Double.parseDouble(parsed5);
              //divide the group Under5Years into Under12Mo and 1to4Yr
              double Group5Adub = parsed5dub*.25;//25% for Under12Mo
              Group5Adub = Math.ceil(Group5Adub);
              int Group5A =(int)Group5Adub;
              double Group5Bdub = parsed5dub*.75;//75% for 1to4Yr
              Group5Bdub = Math.ceil(Group5Bdub);
              int Group5B =(int)Group5Bdub;     
              int left6 = male.indexOf("+");
              int right6 = male.indexOf("<");
              // pull out the text inside the parens
              String parsed6 = male.substring(left6+2, right6-1);
              double parsed6dub = Double.parseDouble(parsed6);
              //divide the group 5to9Yr into 5Yr, 6to7Yr, and 8to9Yr
              double Group6Adub = parsed6dub*.2;//20% for 5Yr
              Group6Adub = Math.ceil(Group6Adub);
              int Group6A =(int)Group6Adub;
              double Group6Bdub = parsed6dub*.4;//40% for 6to7Yr
              Group6Bdub = Math.ceil(Group6Bdub);
              int Group6B =(int)Group6Bdub;
              double Group6Cdub = parsed6dub*.2;//20% for 8Yr
              Group6Cdub = Math.ceil(Group6Cdub);
              int Group6C =(int)Group6Cdub;
              double Group6Ddub = parsed6dub*.2;//20% for 9Yr
              Group6Ddub = Math.ceil(Group6Ddub);
              int Group6D =(int)Group6Ddub;
              int left7 = male.indexOf("<");
              int right7 = male.indexOf(">");
              // pull out the text inside the brackets
              String parsed7 = male.substring(left7+2, right7-1);
              int Group7A = Integer.valueOf(parsed7).intValue();
              int left8 = male.indexOf(">");
              int right8 = male.indexOf("&");
              // pull out the text inside the brackets
              String parsed8 = male.substring(left8+2, right8-1);
              int Group8A = Integer.valueOf(parsed8).intValue();
              //female
              int Group1 = Group1A;
              int Group2 = Group1B + Group2A;
              int Group3 = Group2A + Group2B + Group2C;
              int Group4 = Group2C + Group2D + Group3A + Group4A;     
              //male
              int Group5 = Group5A;
              int Group6 = Group5B + Group6A;
              int Group7 = Group6A + Group6B + Group6C;
              int Group8 = Group6C + Group6D + Group7A + Group8A;
              System.out.println("Server response:\n" + "\n" + "Female");
              System.out.println("Under 12 Months:    " + Group1);
              System.out.println("1 to 4 Years Old:   " + Group2);
              System.out.println("5 to 8 Years Old:   " + Group3);
              System.out.println("8 to 17 Years Old:  " + Group4);
              System.out.println("\n" + "Male");
              System.out.println("Under 12 Months:    " + Group5);
              System.out.println("1 to 4 Years Old:   " + Group6);
              System.out.println("5 to 8 Years Old:   " + Group7);
              System.out.println("8 to 17 Years Old:  " + Group8);
    }Currently it functions using a regex, and executes, but doesn't return any numbers, only returns zeros...If you could help me out with this, that would be amazing! Thanks so much.

    hmm, is there a way to do it without an external API? Of course there is.
    looks like i have to download the API and the idea behind the program is to make it so multiple people running only java can run the program, without having to download APIs, ect, to make it run. Not sure if that is what JTidy entails, but is that what you were suggesting?Personally, I don't understand the resistance to using well-tested tools already in existence as opposed to trying to rewrite a shallow facsimile of said tools. You can distribute the JTidy library along with your application and save yourself a great deal of development and debugging effort.
    ~

  • Want  report output in HTML

    Hi All!
    is it possible to get the report output in HTML based output?
    if yes,  can anyone send me the details?
    thanks in advance
    Alankaar

    Hi,
    Yes it is possible to do that.
    You can go thru the program below. Hope it could help you.
    REPORT  ZSS_CODE_2_HTML LINE-SIZE 300        .
    TABLES: D010INC.      
    Tabelle für die aufzunehmenden ABAP-Texte
    DATA: BEGIN OF SOURCECODE OCCURS 0,
    LINE(200),
    END OF SOURCECODE.
    Tabelle für den erzeugten HTMLCode
    DATA: BEGIN OF HTMLCODE OCCURS 5000,
    LINE(256),
    END OF HTMLCODE.
    DATA: BEGIN OF INCLUDETAB OCCURS 0,
    NAME LIKE D010INC-INCLUDE,
    END OF INCLUDETAB.
    DATA: TEXTELEMENTETAB LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE.
    DATA: EINRUECK TYPE I,                 " Soweit im HTML einrücken
    CHAR2(2).
    Selektionsbild und Verarbeitung  -
    SELECTION-SCREEN BEGIN OF BLOCK BL1 WITH FRAME.
    PARAMETERS: PROGNAME LIKE D010SINF-PROG
             DEFAULT 'ZSS_CODE_2_HTML'.
    PARAMETERS: HTMLFILE LIKE RLGRAP-FILENAME
             DEFAULT 'c:     emp     est.html'.
    PARAMETERS: MITINCLD AS CHECKBOX DEFAULT 'X',
    MITTEXTL AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK BL1.
    SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME.
    PARAMETERS: MITZEILE AS CHECKBOX DEFAULT 'X',
    ONSCREEN AS CHECKBOX DEFAULT 'X',
    SAPINCLD AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK BL2.
    Ein subtrivialer Tests
    AT SELECTION-SCREEN.
    READ REPORT PROGNAME INTO SOURCECODE.
    IF SY-SUBRC <> 0.
    MESSAGE E159(AT) WITH 'Programm konnte nicht eingelesen werden'.
    ENDIF.
    Programmanfang -
    END-OF-SELECTION.
    In der Tabelle sourcecode sollte hier schon der Quelltext stehen.
    PERFORM ERZEUGE_KOPF.
    PERFORM WRITE_SOURCE.
    Includes falls erwünscht
    IF MITINCLD = 'X'.
    PERFORM WRITE_INCLUDES.
    ENDIF.
    Textelemente falls erwünscht
    Includes falls erwünscht
    IF MITTEXTL = 'X'.
    PERFORM WRITE_TEXTELEMENTE.
    ENDIF.
    Und abschließen des Files
    PERFORM ERZEUGE_SCHWANZ.
    PERFORM ABSPEICHERN TABLES HTMLCODE
              USING HTMLFILE.
    Unterroutinen  -
    INCLUDE ZCD_SS_DEBUGROUTINEN.
          FORM ABSPEICHERN                                              *
    -->  FILENAME                                                      *
    FORM ABSPEICHERN TABLES TEXT_ZU_SCHREIBEN
         USING FILENAME LIKE RLGRAP-FILENAME.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    CODEPAGE                = 'IBM'
    FILENAME                = HTMLFILE
    FILETYPE                = 'ASC'
              MODE                    = ' '
    TABLES
    DATA_TAB                = TEXT_ZU_SCHREIBEN
    EXCEPTIONS
    FILE_OPEN_ERROR         = 1
    FILE_WRITE_ERROR        = 2
    INVALID_FILESIZE        = 3
    INVALID_TABLE_WIDTH     = 4
    INVALID_TYPE            = 5
    NO_BATCH                = 6
    UNKNOWN_ERROR           = 7
    GUI_REFUSE_FILETRANSFER = 8
    OTHERS                  = 9.
    IF ONSCREEN = 'X'.
    LOOP AT TEXT_ZU_SCHREIBEN.
    PERFORM SHOW_ANY_STRUC USING TEXT_ZU_SCHREIBEN.NEW-LINE.
    ENDLOOP.
    ENDIF.
    ENDFORM.
    *&      Form  ERZEUGE_KOPF
      Erzeugt einen HTML-Rumpf bis zum Body
    FORM ERZEUGE_KOPF.
    HTMLCODE-LINE = ''.APPEND HTMLCODE.
    HTMLCODE-LINE = ' '.APPEND HTMLCODE.
    HTMLCODE-LINE = '
    CLEAR HTMLCODE-LINE.
    HTMLCODE-LINE+3 = PROGNAME.APPEND HTMLCODE.
    HTMLCODE-LINE = ' '.APPEND HTMLCODE.
    HTMLCODE-LINE = ' '.APPEND HTMLCODE.
    CLEAR HTMLCODE-LINE.APPEND HTMLCODE.
    HTMLCODE-LINE = ''.APPEND HTMLCODE.
    EINRUECK = 2.
    ENDFORM.                               " ERZEUGE_KOPF
    *&      Form  ERZEUGE_SCHWANZ
      Erzeugt die abschließenden HTML-Befehle
    FORM ERZEUGE_SCHWANZ.
    HTMLCODE-LINE = ' </body>'.APPEND HTMLCODE.
    HTMLCODE-LINE = '</html>'.APPEND HTMLCODE.
    ENDFORM.                               " ERZEUGE_SCHWANZ
    *&      Form  WRITE_SOURCE
       Schreibt den Sourcecode
    FORM WRITE_SOURCE.
    DATA: ROT.
    Erstmal die Überschrift hinstellen
    PERFORM ADDZEILE USING '>+' '
    PERFORM ZEILEUMB USING '' PROGNAME.
    PERFORM ADDZEILE USING '->' '
    CLEAR HTMLCODE-LINE.APPEND HTMLCODE.
    Link auf Includes
    IF MITINCLD = 'X'.
    PERFORM ADDZEILE USING '>+' '
    PERFORM ZEILEUMB USING '' '[Includes | #Includes]'.
    PERFORM ADDZEILE USING '->' '
    ENDIF.
    Link auf Textelemente
    IF MITTEXTL = 'X'.
    PERFORM ADDZEILE USING '>+' '
    PERFORM ZEILEUMB USING ''
    '[Textelemente | #Textelemente]'.
    PERFORM ADDZEILE USING '->' '
    ENDIF.
    Und Linie zum Trennen gegen den Quellcode
    PERFORM ADDZEILE USING '>+' ''.
    Und jetzt der Quellcode
    PERFORM CODELINES.
    ENDFORM.                               " WRITE_SOURCE
    *&      Form  ADDZEILE
       Fügt eine Zeile in den HTML-Code ein und korrigiert Einrücktiefe
    FORM ADDZEILE USING    VALUE(EINRUECKEN) LIKE CHAR2
               VALUE(TEXT).
    DATA: ER.
    ER = EINRUECKEN(1).
    IF ER = '+'.
    EINRUECK = EINRUECK + 1.
    ELSEIF ER = '-'.
    EINRUECK = EINRUECK - 1.
    ENDIF.
    CLEAR HTMLCODE.
    HTMLCODE+EINRUECK = TEXT.
    APPEND HTMLCODE.
    ER = EINRUECKEN+1(1).
    IF ER = '+'.
    EINRUECK = EINRUECK + 1.
    ELSEIF ER = '-'.
    EINRUECK = EINRUECK - 1.
    ENDIF.
    ENDFORM.                               " ADDZEILE
    *&      Form  SONDERZEICHEN
    Sonderzeichen in HTML darstellen
    FORM SONDERZEICHEN CHANGING ZEILE.
    DATA: S LIKE SY-SUBRC,
    LASTHIT LIKE SY-FDPOS,
    DUMMY(256).
    LASTHIT = 0.
    DO.
    DUMMY = ZEILE+LASTHIT.
    IF DUMMY CA '&'.
    REPLACE '&' WITH '&amp;' INTO DUMMY.
    ZEILE+LASTHIT = DUMMY.
    LASTHIT = SY-FDPOS + LASTHIT + 1.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    ÄÖÜäöüß<>"
    DO.
    S = 1.
    REPLACE 'Ä' WITH 'Ä'  INTO ZEILE.  S = S * SY-SUBRC / 4.
    REPLACE 'Ö' WITH 'Ö'  INTO ZEILE.  S = S * SY-SUBRC / 4.
    REPLACE 'Ü' WITH 'Ü'  INTO ZEILE.  S = S * SY-SUBRC / 4.
    REPLACE 'ä' WITH 'ä'  INTO ZEILE.  S = S * SY-SUBRC / 4.
    REPLACE 'ö' WITH 'ö'  INTO ZEILE.  S = S * SY-SUBRC / 4.
    REPLACE 'ü' WITH 'ü'  INTO ZEILE.  S = S * SY-SUBRC / 4.
    REPLACE 'ß' WITH 'ß' INTO ZEILE. S = S * SY-SUBRC / 4.
    REPLACE '<' WITH '&lt;'    INTO ZEILE. S = S * SY-SUBRC / 4.
    REPLACE '>' WITH '&gt;'    INTO ZEILE. S = S * SY-SUBRC / 4.
    REPLACE '"' WITH '&quot;'  INTO ZEILE. S = S * SY-SUBRC / 4.
    IF S = 1.EXIT.ENDIF.
    ENDDO.
    ENDFORM.                               " SONDERZEICHEN
    *&      Form  ZEILEUMB
          text
    FORM ZEILEUMB USING    VALUE(EINRUECKEN) LIKE CHAR2
               VALUE(TEXT).
    CONCATENATE TEXT '
    ' INTO TEXT.
    PERFORM ADDZEILE USING EINRUECKEN TEXT.
    ENDFORM.                               " ZEILEUMB
    *&      Form  CODELINES
    Schiebt die Zeilen aus sourcecode ins HTML-Format
    FORM CODELINES.
    DATA ZEILE(5).
    PERFORM ADDZEILE USING '>+' '
    LOOP AT SOURCECODE.
    Erst mal die Sonderzeichen ersetzen
    PERFORM SONDERZEICHEN CHANGING SOURCECODE-LINE.
    Bei einem Kommentar diesen Rot und kursiv darstellen
    IF SOURCECODE-LINE(1) = '*'.       " roter Kommentar
    CONCATENATE '+'
    SOURCECODE-LINE
    '+'
    INTO SOURCECODE-LINE.
    ENDIF.
    Bei Zeilennummerierung diese in dunkelblau dazustellen
    IF MITZEILE = 'X'.
    ZEILE = SY-TABIX.
    SHIFT SOURCECODE-LINE RIGHT BY 35 PLACES.
    CONCATENATE ''
    ZEILE
    INTO SOURCECODE-LINE(35).
    ENDIF.
    PERFORM ADDZEILE USING '' SOURCECODE-LINE.
    ENDLOOP.
    PERFORM ADDZEILE USING '->' '
    ENDFORM.                               " CODELINES
    *&      Form  WRITE_INCLUDES
          Die ganzen Includesources anfügen
    FORM WRITE_INCLUDES.
    DATA: FIRSTTIME.
    FIRSTTIME = 'X'.
    SELECT * FROM D010INC WHERE MASTER = PROGNAME.
    IF    SAPINCLD = 'X'
    AND D010INC-INCLUDE(1) = '<'.
    CONTINUE.
    ENDIF.
    IF FIRSTTIME = 'X'.
    PERFORM ADD_INCLUDES_HEADER.
    CLEAR FIRSTTIME.
    ENDIF.
    Die Namen der Includes merken und nacher am Anfang in den Quellcode
    als Navigationspunkte hinzufügen
    APPEND D010INC-INCLUDE TO INCLUDETAB.
    Namen und Quelltext schreiben
    PERFORM ADD_INCLUDE_NAME USING D010INC.
    READ REPORT D010INC-INCLUDE INTO SOURCECODE.
    PERFORM CODELINES.
    ENDSELECT.
    ENDFORM.                               " WRITE_INCLUDES
    *&      Form  ADD_INCLUDES_HEADER
       Für den 1. Include eine kleine Sonderbehandlung
    FORM ADD_INCLUDES_HEADER.
    HTMLCODE-LINE = ''. APPEND HTMLCODE.
    ENDFORM.                               " ADD_INCLUDES_HEADER
          FORM ADD_INCLUDE_NAME                                         *
    -->  UEBERGABE                                                     *
    FORM ADD_INCLUDE_NAME USING UEBERGABE LIKE D010INC.
    HTMLCODE-LINE = ' '. APPEND HTMLCODE.
    ENDFORM.                               " ADD_INCLUDE_NAME
    *&      Form  WRITE_TEXTELEMENTE
    Textelemente des Hauptprogramms auch noch ausgeben
    FORM WRITE_TEXTELEMENTE.
    PERFORM TEXTELEMENTE_HEADER.
    READ TEXTPOOL PROGNAME INTO TEXTELEMENTETAB.
    PERFORM HTML_TEXTELEMENTE USING 'im Hauptprogramm'.
    LOOP AT INCLUDETAB.
    READ TEXTPOOL INCLUDETAB-NAME INTO TEXTELEMENTETAB.
    CHECK SY-SUBRC = 0.
    PERFORM HTML_TEXTELEMENTE USING INCLUDETAB-NAME.
    ENDLOOP.
    ENDFORM.                               " WRITE_TEXTELEMENTE
    *&      Form  TEXTELEMENTE_HEADER
    FORM TEXTELEMENTE_HEADER.
    HTMLCODE-LINE = ''. APPEND HTMLCODE.
    ENDFORM.                               " TEXTELEMENTE_HEADER
    *&      Form  HTML_TEXTELEMENTE
          text
    FORM HTML_TEXTELEMENTE USING WOHER.
    DATA: WOHERNAME(80),
    TID(80),
    TKEY(80),
    TENTRY(80).
    WOHERNAME = WOHER.
    PERFORM SONDERZEICHEN CHANGING WOHERNAME.
    Das Ganze als Tabelle rauswerfen
    HTMLCODE-LINE = '
    '.APPEND HTMLCODE.
    CONCATENATE '
    ' WOHERNAME '' INTO HTMLCODE-LINE.APPEND HTMLCODE.
    HTMLCODE-LINE = '
    '.APPEND HTMLCODE.
    LOOP AT TEXTELEMENTETAB.
    TID    = TEXTELEMENTETAB-ID.
    TKEY   = TEXTELEMENTETAB-KEY.
    TENTRY = TEXTELEMENTETAB-ENTRY.
    und HTML-Sonderzeichen ersetzen
    PERFORM SONDERZEICHEN CHANGING TID.
    PERFORM SONDERZEICHEN CHANGING TKEY.
    PERFORM SONDERZEICHEN CHANGING TENTRY.
    HTMLCODE-LINE = ''.APPEND HTMLCODE.
    CONCATENATE '' INTO HTMLCODE-LINE.
    APPEND HTMLCODE.
    CONCATENATE '' INTO HTMLCODE-LINE.
    APPEND HTMLCODE.
    CONCATENATE '' INTO HTMLCODE-LINE.
    APPEND HTMLCODE.
    HTMLCODE-LINE = ''.APPEND HTMLCODE.
    ENDLOOP.
    HTMLCODE-LINE = '
    ' TID '
    ' TKEY '
    ' TENTRY '
    '.APPEND HTMLCODE.
    HTMLCODE-LINE = '
    '.APPEND HTMLCODE.
    ENDFORM.                               " HTML_TEXTELEMENTE
    Regards
    Rakesh

  • Cannot get questionnaire HTML string SAP CRM 7.0  EHP3

    Hello,
    We are trying to use questionnaires in Activities and it doesn't work.
    This error : Cannot get questionnaire HTML string is shown.
    I checked  Note 1600561 - Changes done in values template XSLT not taken into account, but it isn't valid for our release ( EHP3 )
    Thanks in advance for your help.
    Belén

    Hi,
    We used the questionnaires (questionnaires was displayed and worked) but we faced issues with the display in web UI (only when the questionnaires are linked to an activity/opportunity). The Admin screen for questionnaire works well).
    We have implemented the following notes in order to correct this displaying issues :
    - 1858059 : Upload the CRM_SVY_GENERATE_BSP_TEMPLATE.ZIP, refresh cash and generate all surveys
    And then notes mentioned above
    - 1914885 & 1944288 in the relevant order.
    But we cannot display anymore the existing surveys (They are active, all scenarios are flagged).
    Error message : Cannot get questionnaire HTML string
    Any Ideas how to proceed to solve ? (we work on EHP2)

  • Tablespace usage report generated with html tags instead of text

    Hi ,
    We have a unix shell script scheduled to find tablespace usage and sends the report to our mail id.
    For the past few weeks(no changes idone in the script) the report is coming with html tags instead of text as below.
    </head>
    <body>
    <p>
    <table border='1' width='90%' align='center' summary='Script output'>
    <tr>
    <th scope="col">
    TABLESPACE_NAME
    </th>
    <th scope="col">
    CUR_USE_MB
    </th>
    <th scope="col">
    CUR_SZ_MB
    </th>
    <th scope="col">
    CUR_PRCT_FULL
    </th>
    <th scope="col">
    FREE_SPACE_MB
    </th>
    <th scope="col">
    MAX_SZ_MB
    </th>
    <th scope="col">
    OVERALL_PRCT_FULL
    </th>
    </tr>
    <tr>
    <td>
    SYSTEM
    </td>
    <td align="right">
    268
    </td>
    <td align="right">
    500
    </td>
    <td align="right">
    54
    </td>
    Is this any settings issue or anything to be modified in the script.Could you please reply..
    Regards,
    Bharath.
    Edited by: 870384 on Jul 6, 2011 1:17 AM

    Hi Sven W,
    Please find the sql below that is generating the tablespace usage report. In the staring of the script markup is set to ON and at the end it is set to OFF.Do you suggest any changes to this..?
    SET ECHO OFF
    SET PAGES 999
    SET MARKUP HTML ON SPOOL ON
    col tablespace_name format a15 trunc
    col cur_use_mb for 999999999
    col cur_sz_mb for 999999999
    col free_space_mb for 999999999
    col max_sz_mb for 999999999
    compute sum of cur_use_mb on report
    compute sum of cur_sz_mb on report
    compute sum of free_space_mb on report
    compute sum of max_sz_mb on report
    break on report
    spool tablespace.html
    select tablespace_name,
    round(sum(total_mb)-sum(free_mb),2) cur_use_mb,
    round(sum(total_mb),2) cur_sz_mb,
    round((sum(total_mb)-sum(free_mb))/sum(total_mb)*100) cur_prct_full,
    round(sum(max_mb) - (sum(total_mb)-sum(free_mb)),2) free_space_mb,
    round(sum(max_mb),2) max_sz_mb,
    round((sum(total_mb)-sum(free_mb))/sum(max_mb)*100) overall_prct_full
    from (select tablespace_name,sum(bytes)/1024/1024 free_mb,0 total_mb,0 max_mb from DBA_FREE_SPACE group by tablespace_name
    union select tablespace_name,0 current_mb,sum(bytes)/1024/1024 total_mb,sum(decode(maxbytes, 0, bytes, maxbytes))/1024/1024 max_mb
    from DBA_DATA_FILES group by tablespace_name) a group by tablespace_name;
    select owner,segment_name,segment_type,bytes/(1024*1024) size_m
    from dba_segments
    where tablespace_name = 'SYSTEM' and segment_name='FGA_LOG$' order by size_m desc;
    spool off;
    SET MARKUP HTML OFF SPOOL OFF

  • How to retrieve complete report output in HTML format

    Hi,
    I'm looking for how to retrieve complete report output in HTML format.
    I have tried the following and it only give me first page of the report output where in the actual report output should be 5 pages. Is there something I'm missing.
    CallbackOption[] boCallOpt = new CallbackOption[1];
    ImageManagement boImgMan = new ImageManagement();
    boImgMan.setCallbackScript("getImage.jsp");
    boImgMan.setImageManagementHolder("imageName");
    boImgMan.setDocumentReferenceHolder("docRef");
    boCallOpt[0] = boImgMan;
    RetrieveData oRetrieveData = new RetrieveData();
    RetrieveView oRetrieveView = new RetrieveView();
    oRetrieveView.setCallbackOption(boCallOpt);
    oRetrieveData.setRetrieveView(oRetrieveView);
    Action[] oActions;
    oActions = new Action[1];
    oActions[0] = fillPrompts;
    oReportEngine.getDocumentInformation(boDocInfo.getDocumentReference(), null, oActions, null,oRetrieveData);
    Testing this on BOE XI 3.0
    Thanks,

    For Web Intelligence, HTML is an interactive viewing format and not an export format such as PDF.
    Note that the HTML will be embedded with postback URLs to the application for images and drill downs.
    Closest you'd get is to be able to specify HTML output of an entire REPORT rather than REPORT_PAGE in the ViewSupport.setViewMode method.  But this brings back just one report in the document, and will have postback URLs mentioned above.
    Sincerely,
    Ted Ueda

  • Report Output format Html & Html Style Sheet

    Hi ,
    How i can difference between Html & Html Style Sheet
    when system parameter destformat to a report ?
    for html destformat = Html
    What about Html Style Sheet destformat ?

    hi
    what do u mean by html style?
    did u use HTMLCSS?
    sarah

  • How to change color in html report with MARKUP HTML ON?

    While generating html reports using MARKUP HTML ON with in sqlplus, I would like to highligh the records with different colors. how can do this?

    Here is an example - it produces nice output and sets the background. It displays in red if database is in NOARCHIVELOG mode. You can go further and use CASE statements for certain conditions to display different colors, font sizes.
    set markup html on spool on entmap off -
         head '-
         <style type="text/css"> -
            table { background: #eee; font-size: 90%; } -
            th { background: #ccc; } -
            td { padding: 0px; } -
         </style>' -
         body 'text=black bgcolor=fffffff align=left' -
         table 'align=center width=99% border=3 bordercolor=black bgcolor=white'
    spool logmode.html
    select  'Archive Log Mode :'|| decode(log_mode,'NOARCHIVELOG','<font color=red>Database in '||log_mode||' mode </font>',log_mode) "Archive Log Mode"
    from v$database
    spool off
    set markup html off

  • How to display a HTML String in a ActiveX WebBrowser ?

    How to direct display a HTML String in a ActiveX WebBrowser without use a URL ?

    I am sure that it would depend on the browser, but with Internet Explorer from Microsoft, I don't think you can. (I may be wrong on this.) What you could do would be to save your string to file and read the file as a url in the browser. I know that this is a step you are trying to avoid, but it will work.
    Hope that this helps,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Out of Memory error while builng HTML String from a Large HashMap.

    Hi,
    I am building an HTML string from a large map oject that consits of about 32000 objects using the Transformer class in java. As this HTML string needs to be displayed in the JSP page, the reponse time was too high and also some times it is throwing out of memory error.
    Please let me know how i can implement the concept of building the library tree(folder structure) HTML string for the first set of say 1000 entries and then display in the web page and then detect an onScroll event and handle it in java Script functions and come back and build the tree for the next set of entries in the map and append this string to the previous one and accordingly display it.
    please let me know whether
    1. the suggested solution was the advisable one.
    2. how to build tree(HTML String) for a set of entries in the map while iterating over the map.
    3. How to detect a onScroll event and handle it.
    Note : Handling the events in the JavaScript functions and displaying the tree is now being done using AJAX.
    Thanks for help in Advance,
    Kartheek

    Hi
    Sorry,
    I haven't seen any error in the browser as this may be Out of memory error which was not handled. I got the the following error from the web logic console
    org.apache.struts.actions.DispatchAction">Dispatch[serviceCenterHome] to method 'getUserLibraryTree' returned an exceptionjava.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
         at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.OutOfMemoryError
    </L_MSG>
    <L_MSG MN="ILHD-1109" PID="adminserver" TID="ExecuteThread: '14' for queue: 'weblogic.kernel.Default'" DT="2012/04/18 7:56:17:146" PT="WARN" AP="" DN="" SN="" SR="org.apache.struts.action.RequestProcessor">Unhandled Exception thrown: class javax.servlet.ServletException</L_MSG>
    <Apr 18, 2012 7:56:17 AM CDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=26367546,name=fcsi,context-path=/fcsi)] Root cause of ServletException.
    *java.lang.OutOfMemoryError*
    Please Advise.
    Thanks for your help in advance,
    Kartheek

  • From HTML string to HtmlDocument?

    I have a String consists of a HTML string e.g. <br>Hello</br>
    How to convert it into a javax.swing.text.html.HtmlDocument?

    You can't convert any String directly to HTMLDocument !
    HTMLDocument is a back-end of any HTML editor (eg.,JTextPane / JEditorPane).
    If you want to have an HTMLDocument that represent your string "<br>Hello</br>" ,then do one thing. (Your HTML string is still invalid ,cos there is no such TAG called </br>)
    JTextPane text=new JTextPane();
    text.setContentType("text/html");
    text.setText(yourHTMLString);
    HTMLDocument doc= (HTMLDocument)text.getDocument();

  • SSRS reports from Lightswitch Html Client

    I have created a Lightswitch desktop application that list the available reports that are stored in a table and also provides a button that when clicked launches the web browser to the URL for the report on the SQL server. My problem is now I'm trying to
    create the HTML client for the application and have no experience with Java Script. Does anyone know how to accomplish the something that I did on the desktop application on the HTML client?
    Below is the code that I used to open the URL in the browser in the desktop application.
    Imports Microsoft.LightSwitch.Threading
    Imports System.Runtime.InteropServices.Automation
    Namespace LightSwitchApplication
    Public Class ListReports
    Private Sub RunReport_Execute()
    ' Write your code here.
    Dim uri As New Uri(ReportsSet.SelectedItem.ReportAddress) 'website stored in the ReportsSet.ReportAddress field
    If (AutomationFactory.IsAvailable) Then
    Dim shell = AutomationFactory.CreateObject("Shell.Application")
    shell.ShellExecute(uri.ToString)
    ElseIf (Not System.Windows.Application.Current.IsRunningOutOfBrowser) Then
    System.Windows.Browser.HtmlPage.Window.Navigate(uri, "_blank")
    End If
    End Sub
    End Class
    End Namespace

    This may help:
    Creating Reports in LightSwitch HTML Client
    // Show Loading message
    var LoadingDiv = $("<div></div>");
    var Loading = $("<h1>&nbsp;&nbsp;&nbsp;&nbsp;Loading Report...</h1>");
    Loading.appendTo(LoadingDiv);
    LoadingDiv.appendTo($(element));
    // Get Report
    var HTMLContent = $("<div></div>").html(
    "<object width='650px' height='650px' data='../reports/ReportViewer.aspx?SurveyId="
    + contentItem.screen.SurveyId + "'/>"
    // Make report appear on top of the Loading message
    HTMLContent.css({
    "margin-top": "-50px"
    HTMLContent.appendTo($(element));
    Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book
    http://LightSwitchHelpWebsite.com

Maybe you are looking for

  • How do I use one of my photos for the desktop background?

    I have a photo which I would like to have as my desktop background. How do I accomplish this?

  • Enhancing logical database PNPCE

    Dear all, my client wants to include a few z_tables to the standard selection screen and output in their ad hoc reporting infoset in HR. Is there a way to include z_fields to the standard selection screen (PNPCE) as well as output of the ad hoc repor

  • Finder window and where it is

    When I open my applications folder, the screen opens to where I had last scrolled. So let's say for instance that I scrolled all the way to the bottom of the window to the utilities folder. I can close out that finder window and open a new finder win

  • Is Compressor as good as FCP export?

    If I select Best Quality 4:3 90 Minutes how do I tweak it further and/or is this akin to Final Cut's ability to export MPEG-2 with 2-Pass VBR, 7.5 + Mbps, Best Motion Quality option that seems to have been discontinued? thanks

  • Distance between miniatures

    Hi, how can I modify distance between miniatures in a presentation? I succeded in change dimension but I'm not able to change the space from each miniature. Thank's