Maven : Generate html report

Hi all!
I would like to know how to generate the html report with the maven plugin.
It's said that "Currently, FlexPMD produces a XML report by default, plus an HTML report when invoked by the Maven site plugin."
I added the section correponding to the FlexPMD in my pom project as following :
            <plugin>
                <groupId>com.adobe.ac</groupId>
                <artifactId>flex-pmd-maven-plugin</artifactId>
                <version>1.0.RC4</version>
            </plugin>
but when I do a site generation, it just generates me a pmd.xml report with the violations (good!) but the flexpmd.html report generated is empty (there are just the default informations about my project but nothing about pmd).
If someone has allready configured flexpmd on his maven project, I will be happy to have some help please!
Thanks'

Hi
We didn't modify anything to get the HTML report. We just download the source code of "flex-pmd-maven-plugin", modify the version in the pom to "1.0.RC4", and launch "mvn clean install"
This will install the plugin and download all dependencies in your MavenRepository
Then in the pom of our flex project we define the plugin in the <build><plugins> section and also in the <reporting><plugins> section , like this :
<plugin>
     <groupId>com.adobe.ac</groupId>
     <artifactId>flex-pmd-maven-plugin</artifactId>
     <version>1.0.RC4</version>
</plugin>
Then in the top level of our flex projet (the same level of the pom file) launch "mvn clean site"
This will generate the flexpmd.html in the target/site directory.
Hope it will help !

Similar Messages

  • Generate HTML report with ANT

    Hello,
    I'm  new to FlexPMD. I have just generated my firsts reports. I try to generate HTML reports.
    I browse the documentation, this forum and the web and I find informations to :
    - generate documentation with Hudson
    - generate documentation with Maven
    - generate documentation with XSLT pmd.xml -> html
    Ok, I try to keep it simple. So I don't want to use Hudson.
    I'm using ANT, and I currently don't want to install/learn Maven.
    I'm using FlexUnit with ANT. And It's really simple to generate reports :
    <junitreport todir="${report.flexunit.loc}">
                <fileset dir="${report.flexunit.loc}">
                    <include name="TEST-*.xml" />
                </fileset>
                <report format="frames" todir="${report.flexunit.loc}/html" />
    </junitreport>
    I'm really new to FlexPMD, so I don't have currently a big knowledge, but it seems impossible to generate a HTML report just like junitreport. (1 line in an ANT task)
    I test the XSLT transformation found on this forum (thread "XSLT pmd.xml -> html"). It's really cool. But it's seems difficult, for example, to extract the wrong code part and add it to the HTML page.
    So, what is the simpler solution to generate HTML report just with FlexPMD/ANT ?
    Thanks !

    Hello,
    Currently you generate a PMD report with ANT  like this :
    <! -- define taskdef  -->
    < taskdef name="pmd"  classname="com.adobe.ac.pmd.ant.FlexPmdAntTask"  classpath="${build.pmd.loc}/flex-pmd-ant-task-${flexpmd.version}.jar">
             < classpath>
                 < path refid="flexpmd.base" />
                 < pathelement  location="${build.pmd.loc}/commons-lang-2.4.jar" />
                 < pathelement  location="${build.pmd.loc}/flex-pmd-core-${flexpmd.version}.jar" />
                 < pathelement  location="${build.pmd.loc}/flex-pmd-ruleset-api-${flexpmd.version}.jar"  />
                 < pathelement  location="${build.pmd.loc}/flex-pmd-ruleset-${flexpmd.version}.jar"  />
                 < pathelement  location="${build.pmd.loc}/plexus-utils-1.0.2.jar" />
             < /classpath>
    < /taskdef>
    then generate XML  report like this :
    < pmd  sourceDirectory="${src.loc}" outputDirectory="${report.loc}"  ruleSet="${build.pmd.loc}/rules.xml"/>
    The  XML contains some file nodes :
    < file  name="/Users/user/workspace/AS3_UTILS/src/utils/align/gridAlignSpaceNumber.as">
           < violation beginline="22" endline="22" begincolumn="0"  endcolumn="27" rule="adobe.ac.pmd.rules.naming.TooShortVariable"  ruleset="All Flex Rules" package="utils.align"  class="gridAlignSpaceNumber.as" externalInfoUrl="" priority="5">This  variable name is too short (3 characters minimum, but 1 actually).  Detects when a field, local, or parameter has a very short name<  /violation>
    < /file>
    The  message is in the text node  < violation>TEXT< /violation>
    For  me, we miss an important part of the message : the portion of the "bad"  code.
    It could be very usefull if PMD can generate  something like this :
    < file  name="">
           < violation beginline="" endline="" begincolumn=""  endcolumn="" rule=""  ruleset="" package=""  class="gridAlignSpaceNumber.as" externalInfoUrl="" priority="">
            < description>TEXT< /description>
            < code><CDATA[MY CODE
    MY CODE
    MY CODE]>< /code>
        <  /violation>
    < /file>
    With this, we can  generate "full" HTML report with XSLT transform easily.
    I  understand that it modify the standard XML schema of the output.
    So,  perharps it could be an option like this :
    < pmd fullDescription="true"  sourceDirectory="${src.loc}"  outputDirectory="${report.loc}"  ruleSet="${build.pmd.loc}/rules.xml"/>
    What do you think ?
    Thanks !

  • Generate HTML REPORTS Help

    hai....
    i am new to this field i need some help regarding how to generate html report ... well i am using db2 as my database .....and these reports are not crystal reports.....
    i have to generate some fields information from multiple tables in the database...
    thank you

    Apex does not as yet support PDF printing out of the box. At this stage your options are;
    1. Wait for the release of Apex 3.0 (evaluation instance is now available).
    2. Use FOP to generate PDF output (probably not for a novice user). See this link;
    http://www.oracle.com/technology/pub/notes/technote_htmldb_fop.html
    3. Purchase a product such as PL/PDF
    http://www.plpdf.com
    cheers,
    Ron

  • Repository reports cannot generate HTML report

    Hello
    In our Computing Labs, we have Oracle9i Designer installed on Windows XP Professional.
    Our students are having a problem when they try to Run Report in Repository Reports.
    The student first sees an error message for Internet Explorer that says "Cannot find "file:///c:/docume~1/%username%/LOACLS~1/Temp/ck*.tmp.html". Make sure...". %username% of course being the current user and ck* being the filename of the report.
    If the user examines the contents of ~/Local settings/Temp, they will see that when this error message comes up, there is a file ck*.tmp (no HTML extension). The HTML file is never generated though.
    When the user click on the OK button for the error message, Internet Explorer open to a blank page. When IE is closed, Repository Reports posts a message that says "CDI-21309: Unable to delete file c:\docume~1\%username%\locals~1\Temp\ck*.tmp.html". When the OK button from this message is clicked the user is returned to Repository Reports, but the report is never generated.
    Our users are set up as Dynamic Local Users, and are members of the Power Users group. We do have some pretty tight restrictions on Group Policy.
    When a user who is a member of Administrators (also dynamic local user) logs in and attempts to create a report, (s)he has no problem. Repository Reports functions exactly as it should.
    I have already given Power Users complete access to all files on the hard drive, so I don't think it could be an NTFS file permission issue.
    If anyone has any advice, it is certainly welcome. Our students need to be able to print off these reports for classes, and I am not familiar at all with Designer.
    Thank you very much
    David Summers
    University of Idaho ITS
    Student Computing Labs

    Here is how I resolved my problem with non admin users not being able to run reports.
    Designer 9i ver 9.0.2.80.6
    Repository Reports ver 9.0.2.80.4
    Problem - When non Administrator users try to generate a report in Repository Reports, they either get a file not found error for the HTML report (and IE will not show the report) or Repository Reports stops responding (and rwrun.exe has to be manually killed).
    Fixes
    -%TMP% and %TEMP% environment variables must resolve to paths that are fewer than 30 characters. In our environment (WindowsXP with Novell Dynamic Local Users), %TMP% and %TEMP% were the temp folders in the user's profile, which is a long path. Changing the environment variables to point to c:\temp was one step in resolving the issue. Although there is a patch released related to this, my installed version is post-patch and I still had to change the temp environment variables.
    -HKLM\SOFTWARE\ORACLE\HOME0\REPORTS_TMP must be set to a writable area for the user group using Designer and Reports. In our environment it was set (during install) to the local administrators temp space (in administrators local profile) - I'd guess it gets set to whatever %TMP% or %TEMP% is for whichever user installs the application. Our users cannot write to this folder, so setting this registry value to c:\temp was another step in resolving the issue.
    -c:\OraHome1\reports\logs must be writable for whichever user group is running Reports. Before making this change but after making the previous two changes, reports would simply freeze for Power Users. When trying to log off, rwrun.exe had to be manually killed - and sometimes a Dr Watson report would come up and ask to be sent in. By granting the user group that uses Reports write permissions to this folder (or the equivalent in your environment), Repositry Reports no longer freezes and successfully generates the HTML report.
    David Summers
    University of Idaho ITS
    Student Computing Labs

  • How to Generate HTML Report Output in Excel

    Dear Experts,
    How to convert HTML report output in Excel.
    I have reports which output is coming in HTML format & the same I want to use in Excel.
    So tell me how I can covert the same in Excel.
    Thanks
    Sudhir

    hello,
    in your case, you might want to make the following :
    a) use DESFORMAT=HTML
    b) use MIMETYPE=application/vnd.msexcell (or whatever mimetype your excel application is bound to)
    i am nor sure if excel will understeand our HTMLCSS (which is actually HTML4.0 using layers for best possible rendering of the paper page in the browser).
    regards,
    the oracle reports team

  • Generate html report

    I need to add text to my html report as my VI is running (or after all VI's are finished running). I have different sub-VI, and my html report has to include the result for all of the test. How do I code LabView to append text as each test is finished? Thanks

    Just a quick example.
    Also, try looking at Example HTML Report from:
    Help Menu> Examples...> Advanced > Report Generation
    Cheers!
    ian
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    example_2003_01.vi ‏51 KB

  • Need to generate html report on deprecated api

    Hi All,
    How do I write a generic tool that can print a report in html format of all the deprecated methods of a class and their count. Are there any freely downloadble tools that does this. What is the best way to do this if I have to write on my own.
    Thanks & Regards,
    Kumar.

    Yep:
    1) Get hold of the source code for x-doclet tags and tinker around with them so that you can find all the deprecated tags in your system.
    2) Write some code yourself that picks up all your files and searches for instance of the deprecated tag
    3) Use javadoc to generate javadoc. Parse the output HTML using DOM/SAX parsers to find deprecated methods
    Unfortunately, a class file never knows that a method is deprecated - so you cant use reflection to find deprecated methods (nor can you use BECL)

  • How to email generated HTML report

    Can I create a link on my generated report that will issue the mailto command and email the results of this report run?

    You will have to include some Javascript in your report, I guess. A simple solution is provided by Internet Explorer itself:
    File -> Send -> Page by Email
    Or you can run your report with destype=mail, but you don't have a preview that way.

  • Hyperlink to a html report

    Hi ,
    I`m using LV2009.
    I have simulated a test report of a test board and generated a HTML report in the VI. The generated HTML report is saved in the file in some folder in the hard drive.
    All I wann is the hyperlink to the HTML report in the front panel.
    I saw few posts in the forum on the hyperlink but majority dealt with the excel sheets.
    Looking forward for your solutions.
    Regards,
    Manoj
    Solved!
    Go to Solution.

    Sorry, didn't see the 2009 in your post. Attached as LV 2009
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness
    Attachments:
    About.vi ‏24 KB

  • 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

  • Generate PDF report with HTML data

    Hi All,
    I am using BI Publisher to generate my reports but I stumbled on a big problem...
    I have a table with a column TASK_DESCRIPTION. This column is a CLOB containing a simple HTML coded page. When a user works with the application he sees a nicely formatted page but when I generate a report I get all the html tags in it (< html > < h4 > ...etc...)
    Is it possible to somehow convert the source data from the table (which is html code) into readable formatted text when generating the report?
    ANY ideas are very welcome!
    Regards,
    Pawel.

    Yes you can do this with an XSL template converting HTML to Formatting objects.
    There are a few catches however. First, you must be sure your markup-fragment is valid XHTML, that is all tags must be closed. Luckily the builtin standard HTML-editor does this.
    I wasn't able to call BI-publisher from within Apex without the XHTML-fragment being escaped, but i managed to create a query on a table containing the fragment within BI-publisher itself. This leaves the fragment intact, producing a valid XML-document.
    This is very important because the XSL attached to the RTF-template must be able to match and convert the XHTML-tags to FO.
    Basic setup :
    Create a datasource (query) within BIP.
    Create the RTF-template and add an extra field (at the top) containing : <?import:file:///C:\xhtml-to-xslfo.xsl?> or whatever location the XSL-file resides.
    Now, layout your report using the wizard and change the field containing the XHTML-fragment into <xsl:apply-templates select="TASK_DESRIPTION"/>
    There are a few XSL-templates out there converting XHTML to FO. One I found particularly useful : http://www.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl
    You might want to change the .xsl so it matches tags case insensitive (eg. <xsl:template match="a|A"> )
    Another caveat is the html-entities for special characters. When the XML from the datasource is parsed by BIP it doesn't recognise entities like &Agrave ; .
    This can be solved by creating a pl/sql function converting these characters to numeric entities like &#192 ;. and use this function in the select statement of your datasource. see http://www.w3schools.com/tags/ref_entities.asp
    Now you can call the report from Apex using an URL to the report definiton (see BIP docs for URL syntax and parameter passing)
    Not a 'really' integrated solution but I had some nice results.
    It would be nice though if we could specify a .dtd containing the references for HTML-entities and a sort of flag wheter the report column should be escaped or not, from within Apex. This would allow us to embed XML-fragments within the XML that Apex produces, resulting in a valid XML doc. Using XSL, you can then match the tags of the XML-fragment and convert it to FO.
    Good luck !
    Maarten

  • How to generate my report in HTML format

    Hi
    I am using Forms and reports 6i . How to generate a report in Html format.
    Please explain what are the option available in reports and the way to do
    thanks in advance
    prasanth a.s.

    *specify  desformat=html  in cmd line
    refer
    * Forms Reports integration 6i
    http://otn.oracle.com/products/forms/pdf/277282.pdf
    [    All Docs for all versions    ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
    ---------------------------------------------------------------------------------

  • Batch file to html report generator:

    I want to create reports based of the batch file that I run.
    I created a batch file to run a number of programs for this PC tune up service that we do at the University I work at.  This is mostly a "learn for my own benefit" project, but if it works and looks nice I would like to make it availible to
    my co workers.  
    Here is what I have so far for the batch:
    @echo off
    :start
    echo.
    echo Do you need to install
    echo  Microsoft Antivirus?
    echo Type y / n (lowercase)
    set /p antivirus=
    if %antivirus%== y goto msantivirus
    if %antivirus%== n goto mbam
    goto start
    :msantivirus
    echo ProgramFiles(x86) var:
    if not defined ProgramFiles(x86) (
        start mseinstall32.exe 
    else (
        start mseinstall64.exe 
    :mbam
    echo.
    echo Do you need to install
    echo  Malwarebytes?
    echo Type y / n (lowercase)
    set /p malwarebytes=
    if %malwarebytes%== y start  mbam-setup-2.0.2.1012.exe
    if %malwarebytes%== n goto cleaner
    goto mbam
    :cleaner
    echo.
    echo Do you need to install
    echo  CCleaner?
    echo Type y / n (lowercase)
    set /p CCleaner=
    if %CCleaner%== y start  start ccsetup416.exe
    if %CCleaner%== n goto msconfig
    goto cleaner
    :msconfig
    echo.
    echo Do you need to run
    echo  MSCONFIG?
    echo Type y / n (lowercase)
    set /p microsoftconfig=
    if %microsoftconfig%== y start msconfig
    if %microsoftconfig%== n goto print
    goto msconfig
    :print
    echo.
    echo Do you want to print
    echo  a report?
    echo Type y / n (lowercase)
    set /p print=
    if %print%== y start (i don't know what to do here)
    if %print%== n goto done
    goto done
    :done
    echo.
    echo You have finished the Zonetech scan. Press any key to exit.
    pause >null
    Here is what I have for the HTML (its based of another site I made so there is some leftover stuff in it):
    <!DOCTYPE html>
    <html>
    <head>  
    <title> Zone Tech Computer Health Form </title>
    <meta name= "viewport" content="width=device-width, initial-scale=1.0">
    <link href= "css/bootstrap.min.css" rel= "stylesheet">
    <link href= "css/styles.css" rel= "stylesheet">
    </head>
    <body>  
    <div class="navbar navbar-inverse navbar-static-top">
    <div class= "container">
    <a href= "#" class= "navbar-brand"> BOISE STATE UNIVERSITY ZONE TECH</a>
    <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse">
    <span class = "icon-bar"> </span>
    <span class = "icon-bar"> </span>
    <span class = "icon-bar">  </span>
    <span class = "icon-bar"> </span>
    <span class = "icon-bar">  </span>
    </button>
    <div class= "collapse navbar-collapse navHeaderCollapse">
    <ul class = "nav navbar-nav navbar-right">
    <li class= "active"><a href = "#">Home</a></li>
    <li><a href = "#">Blog <b class= "caret"></b></a></li>
    <li class = "dropdown">
    <a href = "#" class = "dropdown-toggle" data-toggle = "dropdown">Social Media</a>
    <ul class = "dropdown-menu">
    <li> <a href = "#">Twiter</a></li>
    <li> <a href = "#">Facebook</a></li>
    <li> <a href = "#">Google +</a></li>
    <li> <a href = "#">Instagram</a></li>
    </ul>
    </li>
    <li><a href = "#">About</a></li>
    <li><a href = "#contact" data-toggle="modal" >Contact</a></li>
    </ul>
    </div>
    </div>
    </div>
    <div class = "container text-center">
    <div class ="jumbotron">
    <h1> Computer Health Report</h1>
    <img src="img/smallerbroncologo.png" />
    </div>
    </div>
    <div class= "container" >
    <div class = "row">
    <div class = "col-md-3">
    <h3><a href = "#">Virus Scan </a></h3>
    <p>A Virus Scan checks your computer to see if any malicious software is present.</p>
    <a href = "#" class = "btn btn-default" > read moe </a>
    </div>
    <div class = "col-md-3">
    <h3><a href = "#">Adware Scan </a></h3>
    <p>We check your computer for programs that may present themselves as legitimate services to "repair" your computer for money or sites that redirect your internet browser.</p>
    <a href = "#" class = "btn btn-default" > read moe </a>
    </div>
    <div class = "col-md-3">
    <h3><a href = "#">Registry Scan </a></h3>
    <p>Sometimes programs you have installed don't uninstall right or fully.  Othertimes your programs may stop working because there is wrong infomration in the registry.  We clean and optimize the registry
    to help make your computer work better</p>
    <a href = "#" class = "btn btn-default" > read moe </a>
    </div>
    <div class = "col-md-3">
    <h3><a href = "#">Start Up Scan </a></h3>
    <p>If your computer is booting slowly, sometimes the cause is to many programs trying to start up when windows starts up.  If to many programs try to start up at once it clogs up the computers processor and makes
    it run slow.   We check to make sure that only the essential programs are running so your computer runs better.</p>
    <a href = "#" class = "btn btn-default" > read moe </a>
    </div>
    </div>
    </div>
    <div class = "navbar navbar-inverse navbar-fixed-bottom" >
    <div class = "container" >
    <p class = "navbar-text pull-left"> Site by Travis </p>
    </div>
    </div>
    <div class = "modal fade" id = "contact" role = "dialog">
    <div class = class "modal-dialog">
    <div class = "modal-content">
    <div class = "modal-header">
    <p> Contact Tech Site </p>
    </div>
    <div class= "modal-body" >
    <p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are
    going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on
    the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from  </p>
    </div>
    <div class = "footer">
    <a class= "btn btn-default" data-dismiss = "modal" >close</a>
    <a class= "btn btn-primary" data-dismiss = "modal" >close</a>
    </div>
    </div>
    </div>
    </div>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js"> </script>
    <script src="js/bootstrap.js"> </script>
    </body>
    </html>
    Here is what I want to do:
    I want to make an interactive html report based on an HTML site I made.  I want to take the y (meaning yes) inputs for the strings( anitivirus, malwarebytes, ccleaner, and Microsoftconfig which are from the batch) and make them indicate something has
    been done on the HTML that I created.  Essentially, I see the yes inputs putting check marks (or something) in the sections of my HTML document that are related to the programs I ran in the batch.  The sections in the HTML page are called Virus Scan,
    Adware Scan, Registry Scan, and Start up scan and they are paired to the variables antivirus, malwarebytes, ccleaner, and microsoftconfig.  
    I hope this makes sense.
    Thanks for any help

    This is the way I was looking at it.  Essentially a html file is a text file.  I have already written the html file I want to have displayed.  I just want the batch to make a slight change to the text in part of it.  If I could
    do that I would be happy.  Is there any way to do that with the batch?
    Editing files never has been and is still not something that batch files do easily.  I ti si not the intention of batch to do this.
    If you are trying to learn something, try learn-ing something that is not obsolete.  Batch is not worth the time when we have PowerShell,  If you ant to alter an HTML dynamically then use an HTA.  It is easy and well supported.
    ¯\_(ツ)_/¯

  • How can we generate the reports in html or text file formats?

    Hi,
    Is there any package that can help in creating HTMLDB reports in .txt files or .html files? (Similar to TEXT_IO in Oracle Forms)
    How can we generate the reports in html or text file formats from HTMLDB?
    Thanks in Advance
    Renjith

    Hello all.
    Bi Publisher is great, but has a very high price tag. It's even more expensive than Forms & Reports Services. We are considering APEX to replace Forms & Reports on the web, but the reporting limitations are still a problem.
    I wonder if there is another option.
    Thanks

  • Generating an  html report based on table at sql 2005 db

    Hi
    I want to create an html report based on a table named inventory on sql server 2005 database.
    first code used to generate an output report
        try {
                // TODO add your handling code here:
                String s = "<html> <body> <table border=1><caption> Inventory Report </caption>";
                s += "<tr><td>Item_id<td>item_name<td>Existing quantity</td><tr><td>3<td>4<td> <td>";
                byte[] sb = s.getBytes();
                FileOutputStream fs = null;
                try {
                    fs = new FileOutputStream("D:\\Report\\Report.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(mileshframe.class.getName()).log(Level.SEVERE, null, ex);
    Second jdbc  code for connection and select all records in the table
    try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
                st = con.createStatement( );
    ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity  from Inventory");
         String s="";
    while(rset.next())
        s+=(rset.getString(1)+"\t\t"+rset.getString(2)+"\t"+rset.getString(3)+"\t"+rset.getString(4)+"\n");
          st.close();
                con.close();
         catch(ClassNotFoundException ex)
             ex.printStackTrace();
          catch(SQLException ex)
             ex.printStackTrace();
            }                             I want someone helps me to merge two codes into one code to generate an output html report.
    thanks in advance

    This is my trial but not the desired result ,it's displayed the title and a line only
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
            // TODO add your handling code here:
                          String s = "<html> <body> <table border=1> <caption>Report title</caption>";
                byte[] sb = s.getBytes();
                FileOutputStream fs = null;
                try {
                // TODO add your handling code here:
                try {
                    fs = new FileOutputStream("D:\\Report\\myeport.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                 con = DriverManager.getConnection("jdbc:odbc:MerchandiseCon","sa","sql123#");
                st = con.createStatement( );
    ResultSet rset=st.executeQuery("Select Item_code,Item_Name,item_cost,item_quantity  from Inventory");
    while(rset.next())
                   s+=("<tr><td>"+rset.getString("Item_Code")+"</td><td>"+rset.getString("Item_Name")+"</td><td>"+rset.getString("item_cost")+"</td><td>"+rset.getString("item_quantity")+"</td></tr>");
                try {
                // TODO add your handling code here:
                try {
                    fs = new FileOutputStream("D:\\Report\\myeport.html");
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
                fs.write(sb);
                fs.close();
            } catch (IOException ex) {
                Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
         st.close();
                con.close();
         catch(ClassNotFoundException ex)
             ex.printStackTrace();
          catch(SQLException ex)
             ex.printStackTrace();
        }

Maybe you are looking for