Click here to Skip to main content
16,021,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have one stored procedure in that procedure have two tables, both tables data i want to convert into html and show on html file. both tables data show on the same file.
how to do this?
Posted

 
Share this answer
 
Hi,

To do this you need to write code to generate HTML code and display in panel or other contain control.

Here is the sample,

C#
result.AppendFormat("<html><head><title>{0}</title>", run.Name);
            //result.Append("<link type="text/css" rel="StyleSheet" href="trx2html.css" />");
            result.Append("<style type="text/css">");
            result.Append(GetCss());            
            result.Append("</style>");
            result.Append("<script type=\"text/javascript\">");
            result.Append(@"
                        function togle(anId){
                            var el = document.getElementById(anId);     
	                        if (el!=null){
	                            if (el.style.display=='none'){
			                        el.style.display='block'; 	    
		                        }else{
			                        el.style.display='none'; 	    
		                        }     
	                        }
                        } ");
            result.Append("</script>");
            result.Append("</head><body>");
            result.Append("<a name="__top" />");
            result.AppendFormat(@"<h3>{0}</h3>
                                <div class="contents">
                                  <a href="#totals">Totals</a>
                                  |
                                  <a href="#summary">Summary</a>
                                  |
                                  <a href="#slower">Slowers</a>
                                  |
                                  <a href="#detail">Detail</a>
                                  |
                                  <a href="#envInfo">Environment Information</a>
                                </div>
                                <br />
                                <a name="totals" />",
                                run.Name);



Above code is for Table header creation, similarly you need to iterate through all the rows of your table and need to generate TR TD pairs.


hope this will help you,

thanks
-Amit.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900