Export to Excel fails on some machines - c#

We are developing a Web application and some of our query results need to be Exported to Excel. We are using the following C# code to Export :
System.Web.HttpContext ctx = System.Web.HttpContext.Current;
CurrentPackingListModel.Voyage.ShipmentDataContext = ShipmentDataContext;
ctx.Response.Clear();
string filename = "ApprovalForm.xls";
ctx.Response.AddHeader("content-disposition", "attachment;filename=" + filename);
ctx.Response.ContentType = "application/vnd.ms-excel";
ctx.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
ctx.Response.Charset = "UTF-8";
return View("../Packing/_ExportApprovalForm", CurrentPackingListModel);
The partial View I am returning to result is as follows :
<body id="body" onload="window.print();">
<table>
<tbody>
<tr>
<td class="table-header" colspan="8">
<div style="width: 100%">
<div class="lleft">
#* <img id="imgLogo" src="~/Images/myLogo.png" />*#
</div>
<div class="baslik">Approval Packing List Form</div>
<div style="float: right;">#DateTime.Now.ToString("MM.dd.yyyy")</div>
</div>
</td>
</tr>
<tr>
<td colspan="6"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td class="line-header">#Html.DisplayNameFor(x => x.ID)</td>
<td>: #Html.HiddenFor(x => x.ID)#Html.DisplayFor(x => x.ID)</td>
<td class="line-header" style="width: 165px;">#Html.DisplayNameFor(x => x.Voyage.StartDate)</td>
<td>: #Html.DisplayFor(x => x.Voyage.StartDate)</td>
<td class="line-header">#Html.DisplayNameFor(x => x.Voyage.VesselID)</td>
<td>: #Html.DisplayFor(x => x.Voyage.VesselText)
</td>
</tr>
<tr>
<td class="line-header">#Html.DisplayNameFor(x => x.Voyage.Id)</td>
<td>: #Html.DisplayFor(x => x.Voyage.Id)</td>
<td class="line-header" style="width: 165px;">#Html.DisplayNameFor(x => x.Voyage.EndDate)</td>
<td>: #Html.DisplayFor(x => x.Voyage.EndDate)</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="6">
<hr />
</td>
</tr>
</tbody>
</table>
<table>
<tr>
<td class="line-header" style="width: 160px;">Approve Personel</td>
<td style="border: solid 1px; width: 180px;"></td>
<td class="line-header">Discharge Port</td>
<td style="border: solid 1px; width: 180px;"></td>
</tr>
<tr>
<td class="line-header">Approve Date</td>
<td style="border: solid 1px;"></td>
<td class="line-header">Terminal</td>
<td style="border: solid 1px;"></td>
</tr>
<tr>
<td class="line-header">Signiture</td>
<td style="border: solid 1px;"></td>
<td></td>
<td></td>
</tr>
</table>
#if (Request.QueryString["type"] == "HRC" && Model.HrcListPrint != null)
{
<table>
<tr>
<td colspan="10" style="height: 20px;">
<hr />
</td>
</tr>
<tr>
<td style="text-align: center; width: 210mm; font-weight: bold;" colspan="11">HRC LIST
</td>
</tr>
</table>
<table class="display dataTable no-footer">
<thead>
<tr>
<th>Customer Name</th>
<th>Customer PO No</th>
<th>Ord. ITem No</th>
<th>CM No</th>
<th>Product</th>
<th>Size (T x W inch)</th>
<th>Thickness Tolerance</th>
<th>Qty (tons)</th>
<th>Coil Weight (Lbs)</th>
<th>Destination Port</th>
<th>Barcode</th>
<th>Heat No</th>
<th>Status</th>
</tr>
</thead>
<tbody>
#foreach (MedTrade.Apollo.Shared.Models.Shipment.PackingListDetailModel item in Model.HrcListPrint)
{
<tr>
<td>#item.CustomerName</td>
<td>#item.CustomerPurchaseOrderNumber</td>
<td>#String.Format("'{0}'", item.OrderItemText)</td>
<td>#item.CMNO</td>
<td>#item.ProductStandartName</td>
<td>#item.ProductProperty</td>
<td>#item.ThicknessToleranceType</td>
<td>#((item.Quantity / 1000).ToString("N3"))</td>
<td>#item.CoilWeight.ToString("N0")</td>
<td>#item.DischargePortTanim</td>
<td>#item.BarcodeNo</td>
<td>#item.HeatNo</td>
<td>#item.StatusText</td>
</tr>
}
</tbody>
</table>
}
#if (Request.QueryString["type"] == "Rebar" && Model.RebarListPrint != null)
{
<table>
<tr>
<td colspan="10" style="height: 20px;">
<hr />
</td>
</tr>
<tr>
<td style="text-align: center; width: 210mm; font-weight: bold;" colspan="10">REBAR LIST
</td>
</tr>
</table>
<table class="display dataTable no-footer">
<thead>
<tr>
<th>Customer Name</th>
<th>Customer PO No</th>
<th>Ord. ITem No</th>
<th>CM No</th>
<th>Product</th>
<th>Size (D x L inch)</th>
#if (Model.SearchCriteria.ViewType == ViewType.Group)
{
<th>Qty (tons) / # of bundles</th>
}
else
{
<th>Quantity (Tons)</th>
}
<th>Bundle Weight (Lbs)</th>
<th>Destination Port</th>
#if (Model.SearchCriteria.ViewType == ViewType.Detail)
{
<th>Barcode</th>
}
<th>Heat No</th>
<th>Status</th>
</tr>
</thead>
<tbody>
#foreach (MedTrade.Apollo.Shared.Models.Shipment.PackingListDetailModel item in Model.RebarListPrint)
{
<tr>
<td>#item.CustomerName</td>
<td>#item.CustomerPurchaseOrderNumber</td>
<td>#String.Format("'{0}'", item.OrderItemText)</td>
<td>#item.CMNO</td>
<td>#item.ProductStandartName</td>
<td>#item.ProductProperty</td>
#if (Model.SearchCriteria.ViewType == ViewType.Group)
{
<td>#((item.Quantity / 1000).ToString("N3")) / #item.Count</td>
}
else
{
<td>#((item.Quantity / 1000).ToString("N3"))</td>
}
<td>#item.BundleWeight.ToString("N0")</td>
<td>#item.DischargePortTanim</td>
#if (Model.SearchCriteria.ViewType == ViewType.Detail)
{
<td>#item.BarcodeNo</td>
}
<td>#item.HeatNo</td>
<td>#item.StatusText</td>
</tr>
}
</tbody>
</table>
}
</body>
But export to Excel works on some machines, but not others. This started to happen only recently.
Is there a possible solution to fix this without re-writing the whole Exporting functionality?

Apologies this is not an answer but i am unable to comment as i have low rep.
IS excel installed on the machines it is not working on? From my memory excel must be installed for you to export. I have used Epplus to get around this in the past.
Are you able to add some exception handling and logging around this issued so you can get more details from the error? Even if you just write it to a txt file on the machine.
Sorry i dont have any actual answers.

May below code will be helpful for you:
public void ExportToExcel()
{
DataGrid dgGrid = new DataGrid();
dgGrid.DataSource = /*Give your data source here*/;
dgGrid.DataBind();
System.Web.HttpContext.Current.Response.ClearContent();
System.Web.HttpContext.Current.Response.Buffer = true;
System.Web.HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Data Report.xls"));
System.Web.HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
System.Web.HttpContext.Current.Response.Charset = "";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
dgGrid.RenderControl(htw);
System.Web.HttpContext.Current.Response.Output.Write(sw.ToString());
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.End();
}

Related

AutoIncrement Column HTML doesnt show after sending Mail

I have to send a Table that have a column with autoincrement number and when I sent the mail it shows the second column values but none the auto increment numbers:
This is my html script generated by c# code:
<style>
.tableOrder {
counter-reset: rowNumber;
border-collapse: collapse;
text-align: center;
}
.tableOrder tr .counterColumn {
counter-increment: rowNumber;
}
.tableOrder tr .counterColumn:first-child::before {
content: counter(rowNumber);
min-width: 1em;
margin-right: 0.5em;
}
</style>
</table>
<font> This is the following order of Pickups Arrives </font> <br><br>
<table class="tableOrder" border="1">
<tr style="background-color:#6FA1D2;color:#ffffff;">
<td style="color:#555555;">Order Arrive</td>
<td style="color:#555555;">Pickup Number</td>
</tr>
<tr>
<td class="counterColumn"></td>
<td>1</td>
</tr>
<tr>
<td class="counterColumn"></td>
<td>1233</td>
</tr>
<tr>
<td class="counterColumn"></td>
<td>521346</td>
</tr>
<tr>
<td class="counterColumn"></td>
<td>1246</td>
</tr>
<tr>
<td class="counterColumn"></td>
<td>7594</td>
</tr>
</table>
and when I run my code and sent the email it didn't show the autoincrement values column
I'm using the SmtpClient in C#
MailMessage message = new MailMessage()
{
From = fromEmail,
Subject = "Subject",
IsBodyHtml = true,
Body = htmlString,
};
message.To.Add(toEmail);
message.CC.Add(ccEmail);

How to create html template and how to send them through email without attachment

currently am working in asp.net c#..one of my client wants to send html template through email donot as attachment ..so i created attachment like this
please refer the html code
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>saloc</title>
</head>
<body>
<div>
<table style='width:90%; border:3px solid #C0C0C0;'>
<tbody align:'center';>
<tr>
<td align:'center'>
<table style='width:100%;padding:0;'>
<tbody>
<tr>
<td align:'left'>
<table style='width:100%;padding:0;'>
<tbody>
<tr>
<td align:'left'>
<table style='width: 100%;border:0;padding:0';>
<tbody>
<td align:'left' valign='top' style= 'width:15%';><img src='data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAN0AAAA7CAIAAABwuxjSAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAQ0tJREFUeF7tfQd8XNWV/oSEYgwuktVG02c0M+puAkwLEMgSkkDYsCEJKWQ3WTb03gKBhBCKqTYGTHHvHTfce5flIsmS1Xub3tt7M+f/nftGsrMLu3aWZP/5/Xx9NPPmlXvPPfc77d73nlV0rpwrZ1ZSgySfRn+jcg6X58r/cUmlUklRKEGJJAWJwudwea78n5chXLrJ30eOMEVkip3D5bny/2M5h8tz5a8sp/yvR7jeKMWJ/BR1UrSbfAEpkgpGcU767LMs53B5rvyV5RQu+2qDH7+7ZlRm/deGbVFpB371VOyTxRSIUgKnnMPlufJVlC/HkYRj0SiF4skYUSAYTkaS8VlTajKGp1Sq2AXntapUTd9QVY0e5f36hSGVqkp1fv2Nd5A/6icK9jTDnoIUHJ8JWM/h8lz5i/JlkEnKiVSSogmKyUBocsDZTw0nqi84ny5RDZxn2jfpm8GqDUlPPXVXHb37tsYJxdHzR9MFWs/rr7uTMgUDcPGgc7g8V/7K8qWQSciSTAlgiwDMoH/7hkaVqu1ruXS8PpHyxSgWw6WAnofiyVScItR9ZNPVpUHVhb3//phPjmEv6Bwuz5W/snwpZADKFCwlzohLjvYtKlXXRSMoknJsWtG4dWPv1s2e9evcaz7rXDcj3t5EsYQ/EEpRbHuxPq66mLYcjiTioHO4PFf+yvLl9jImS1EKpFJSwHXTN5OqMT31tRF3wDmuwDNKFVepoioVXaQKq5iOX3g+0nMKSORqP6hS9V84UokvAetILPrlbZwqaVymYJ5BuADfYn1JCQiwISrBXoS9qB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rHO6SHiHWL5B9xjEAVkw4wPSM/J2QYyJIBSEQ1TL8VbgNcoucU7YfhxKP5Phjy8bomOYOjFdLeYO4SSgXHUiIYEUJX6MUxgAGqAbYYIS40/0HX+6ZHIJfP/qRVle8c2SFlKxRDAFCokY0yRl7MbivArUzjvRu8UAKBy1jhUhcvRrpAnty2aAInNr7gwLsE93ARIMJ70BaHfaXVXpM9MsXdKwFYEOHkLSLAXCF9YklAq4IWZUxjmuEpoEirBtdjDx8R/Egz7BHDACLAF4zesygw7yAsSFZm3Us/pxJLlIjwIAMeaA5SI+edomJGWCsKvI6WE2xMBUZQrZ/+jEOwkL16nRKgrXiAFucOO8PuBcTJ+3GE1BUti8gK/udqhQ2zeAR9YNSZssAVnaye8PNpAvWJ5C6dyrbxGmbY3ykEIQfnEfpDQG1yIy8EzuiZAyaLigJdhxgEsm1L+ZOjx5Upt6Y5xN7gSMZxcMwj7mHtcxA9UCoCjYtYpZRyA0hACD+ASAyTkMFgn/k6DJlrAURA2+G9QVDgLF3pF1yB9II/3Yy8IIlE2QIPnp7f/ciyUjXTNQyRGBLyLofnqy5AfP9UroNMrbkRgWYc8HHKJYRbOmb2pMB2weKx74mKBDxAMRoqNBodEGCGYkhSuRTzHr+3jHqPKQRfP10LGDCz2U6gGpIhAYWZo8LAhYKeIAOczG0IufykybOFUDCrqZGgyQoEdcIsLhf6AQz4AfVLqV1SRWUMziuPDAfzEp+ADFyk2g0/jNkVDIHEOvlE5WuELlf3iY4hzVKMcisWTAC/aFcThBftNmdMjZgYnoTnUmSbwD4cN7pAteSW2d9grzhHhJZjBJjOD3dzlQcJPhXPBJ76xT5yP6uAE4O/4TkJBPJoKy0xKAA+2opyapus5rSrRib8gcWCIvupC9P8AjKTIqgXffnwAAAAASUVORK5CYII=' style='margin-left: 0px;'/>
</td>
</tr>
<tr>
<td> <div style='border-bottom:5px solid #808080;'></div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table style='width:100%;padding:5px;word-spacing:0'>
<tbody><tr>
<td align:'left'>
<table style='width:100%;height:10px;'valign:'top''>
<tbody>
<tr>
<td align:'left'><div style='display:none;'></div>
<h2>ihigjkj</h2>
<div style='display: block;top: -105px;'></div>
<table style='width:100%; height: 178px;'>
<tbody><tr>
<td align:'left'>
<table style='width:100%;' border='0'>
<tbody>
<tr>
<td align:'left' valign:'top' style='width: 15%;'>
</td>
<!--<td align:'left' style='width: 5%;' valign:'top'>
</td>-->
<td align:'left' style='width: 80%;color:#303338;text-align:justify;word-wrap: break-word;' valign:'top'>
<p>jkgnbkvnkvb</p>
<!--<a href='http://www.ymlp.com/'>This is a link to some related web page...</a><a href='http://www.ymlp.com/'></a>-->
</td>
</tr>
<tr>
<td><hr /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody></table>
<!--<table style='width:100%'>
<tbody>
<tr>
<td align:'left'>
</td>
</tr>
</tbody></table>-->
<table width:'100%'>
<tbody><tr>
<td align:'left'>
<div>
<h2>kvnmvbmbvm</h2>
</div>
</td>
</tr>
</tbody></table>
<table width:'100%'>
<tbody><tr>
<td align:'left'>
<table style='width: 100%;' border='0'>
<tbody><tr>
<td align:'left' style='width:80%;text-align:justify;word-wrap:break-word;color:#303338'; valign='top';>
<p>jgknkbnvnbvm,nb,mbv</p><br>
<!-- <a href='http://www.ymlp.com/'>This is a link to some related web page...</a><a href='http://www.ymlp.com/'></a>-->
</td>
<!--<td align:'left' style='width: 5%;' valign:'top'>
</td>-->
<td align:'left' style='width:15%;' valign:'top'>
<a href='http://www.saloc.in'> </td>
</tr>
<tr>
<td><hr /></td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<table style='padding:0px;width:100%';'>
<tbody><tr>
<td align:'left'><h3>nngnbvmn,</h3>
</td>
</tr>
</tbody></table>
<table style='width:100%';>
<tbody><tr>
<td align:'left'>
<div style='text-align:justify;word-wrap:break-word;color:#303338';'>
<p>jgknkbnvnbvm,nb,mbv</p>
<br /> </div>
<div style='color:#003E61';'font-size:15px;font-family:'Times New Roman';> <hr/>
<span style='color:#CA3B2A'><b>SALOC Technologies PVT Ltd,</b></style></span><br/>
<b>#274/14,New Guddadahali Mysore Road,Bengaluru-560026,INDIA</b><br/>
<b> Voice:+91 80 2675 5000,Fax:+90 80 2674 7000</b><br />
<a href='mailto:shivananda#saloc.in'>shivananda#saloc.in</a>
</div>
<div>
</div>
<div style='color:green;text-align:center;border-top:dotted thin #C0C0C0;font-size:18px'>
<br />
<b><i>Business for mutual benefits</i></b><br />
<!--style='border-top:dotted thin #C0C0C0;'-->To Unsubscribe Click here<a href='mailto:shivananda#saloc.in'>:shivananda#saloc.in</a>
</div>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>
<!--<table width:'100%' cellpadding='4' cellspacing='0'>
<tbody><tr>
<td align:'left' >
<div style='font-size: 8px;'>
</div>
</td>
</tr>
</tbody></table>-->
</td>
</tr>
</tbody></table>
<!--<table style='width:600px' border='0' height:'30px'>
<tbody><tr>
<td align:'left'>
<div style='font-size: 8px;'>
</div>
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>-->
</table>
</div>
</body>
</html>
it looks very big but here one thing u make sure am storing image in byte array ..until now am not facing any problem .the created html template above is looking good if u want to see please paste in notepad as html then open it browser then u come to know ..fine actually when i send this template as attachment in gmail,after send email i get only text content as dis located manner mean not as original style but content not styles all are showing without style ....and one more criteria is our clients wants to see the html template directly on mail body not as attachment..please let me know how do i solve these problems i wish i'll get perfect solution about this because i trust stack overflow ...please help your help would be greatly appreciated
I suggested you to upload the image to web server and change the image path in the html file something like http://domainname.com/imageName.jpg.
Code
StreamReader reader = new StreamReader(Server.MapPath("~/emailer.html"));
string readFile = reader.ReadToEnd();
string myString = "";
myString = readFile;
string mailServer, mailFrom;
int port;
string mailId, mailPass;
string subject;
string mailTo;
try
{
subject = "Subject";
mailTo = "receipient#gmail.com";
mailServer = "smtp.gmail.com";
mailFrom = "Mail From Text";
mailId = "sender#gmail.com";
mailPass = "xxxxxx";
port = 587;
MailMessage mail = new MailMessage(mailId, mailTo, subject, myString.ToString());
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient(mailServer, port);
System.Net.NetworkCredential nc = new System.Net.NetworkCredential(mailId, mailPass);
smtp.UseDefaultCredentials = false;
smtp.Credentials = nc;
smtp.EnableSsl = true;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Send(mail);
ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmessage", "javascript:alert('Submitted successfully')", true);
}
catch(Exception ex){ }
Change subject, mailTo,mailFrom, mailId, Password as per yours.

Why my code is selecting all text() nodes in Htmldocument

HtmlNode node = doc.DocumentNode.SelectNodes("//tr")[0];
foreach(HtmlTextNode n in node.SelectNodes("//text()"))
Console.WriteLine(n.Text);
HTML:
<table class="infobox" style="width: 17em; font-size: 100%;float: left;">
<tr>
<th style="text-align: center; background: #f08080;" colspan="3">خدیجہ مستور</th>
</tr>
<tr style="text-align: center;">
<td colspan="3"><img alt="خدیجہ مستور" src="//upload.wikimedia.org/wikipedia/ur/thumb/7/7b/Khatijamastoor.JPG/150px-Khatijamastoor.JPG" width="150" height="203" srcset="//upload.wikimedia.org/wikipedia/ur/thumb/7/7b/Khatijamastoor.JPG/225px-Khatijamastoor.JPG 1.5x, //upload.wikimedia.org/wikipedia/ur/thumb/7/7b/Khatijamastoor.JPG/300px-Khatijamastoor.JPG 2x"><br>
<div style="font-size: 90%">خدیجہ مستور</div>
</td>
</tr>
<tr>
<th style="background: #f08080;" colspan="3">ادیب</th>
</tr>
<tr>
<td><b>ولادت</b></td>
<td colspan="2">1930ء، لکھنؤ، برطانوی ہندوستان</td>
</tr>
<tr>
<td><b>اصناف ادب</b></td>
<td colspan="2">ناول</td>
</tr>
<tr>
<td><b>معروف تصانیف</b></td>
<td colspan="2">آنگن</td>
</tr>
</table>
Output Should be :
خدیجہ مستور
but i found :
خدیجہ مستور
خدیجہ مستور
ادیب
ولادت
1930ء
،
لکھنؤ
،
برطانوی ہندوستان
اصناف ادب
ناول
معروف تصانیف
آنگن
Why node.selectNodes("//text()") is selecting all text() nodes in document rather text() nodes from just first tr tag??
Because you are adding two forward slashes to the beginning of your XPath (//tr), which selects all of the elements in the document, not just descendants of the selected node.
Try this instead:
foreach (HtmlTextNode n in node.SelectNodes("text()"))
Or just simplify the XPath to:
var node = doc.DocumentNode.SelectSingleNode("//tr[1]/text()");
Console.WriteLine(node.Text);

Modify Existing HTML Table

I have an HTML table that I request from a webserver in C#. I am then displaying the page in my aspx webform. How can I add a prerequisite based on the course ID to the last column in the table without hard-coding the prerequisite? Example of the table design is below.
<tr bgcolor="#E1E1CC">
<td width="7%">003597</td>
<td width="5%">01</td>
<td width="1%">OPT</td>
<td width="8%">MT H </td>
<td width="16%">2:00 pm - 2:50 pm </td>
<td width="17%">08/26/13 - 12/12/13</td>
<td width="8%">
<a href="http://www.mnsu.edu/registrar/building.html"target = _blank>
<b>TR C124</b>
</a>
</td>
<td width="19%">Staff</td>
<td width="4%">22</td>
<td width="4%">6</td>
<td width="4%"><font color="#000000">Open</font></td>
<td width="7%">
<a href=Notes.asp?SpclNote=20143+003597+IT+100 target = _blank>
<b>Notes</b>
</a>
</td>
</tr>
<tr bgcolor="#E1E1CC">
<td colspan="3"> </td>
<td width="8%">M </td>
<td width="16%">10:00 am - 11:50 am</td>
<td width="17%">08/26/13 - 12/09/13</td>
<td width="8%">
<a href="http://www.mnsu.edu/registrar/building.html"target = _blank>
<b>WH 0119 </b>
</a>
</td>
<td width="19%">Staff</td>
<td colspan="4"> </td>
</tr>
If you are getting the page html as a string you could just insert your html into it. Something like:
private void SetValue(string PageHtml, string ID, string TextToInsert)
{
string html = PageHtml;
string sMyHtmlToInsert = TextToInsert;
int iSplitIndex = html.IndexOf(ID);
iSplitIndex = html.IndexOf("{tag}",iSplitIndex);
string sHtml1 = html.SubString(0, iSplitIndex);
string sHtml2 = html.SubString(iSplitIndex);
string sFinalHtml = sHtml1 + sMyHtmlToInsert + sHtml2;
}

Grabbing a timesheet HTMLAgilityPack

I need to grab a timesheets from a website. I want to store/add this timesheet to a data table in my C# Application.
The structure of the data table looks like this:
1. | Day | Time | Status |
2. ..1.......7:00.........IN
3. ..1.......9:45.......OUT
4. ..1......10:15........IN
5. ..1......15:45......OUT
6. ..1.......8:45.....TOTAL
7. ..2 .. ..
My C# code for the DataTable:
DataTable table = new DataTable("Worksheet");
table.Columns.Add("Day");
table.Columns.Add("Time");
table.Columns.Add("Status");
I tried different variants and I always mess up with all the data.
For testing purpose I made a new Winform with a "textbox" (for the sitepath) and "button"(to start the process)
Then I want HTMLAgilityPack to get all the data. one example:
public string[] GREYsource;
public Form1()
{
InitializeComponent();
}
private void btnSubmit_Click(object sender, EventArgs e)
{
var doc = new HtmlAgilityPack.HtmlDocument();
var fileName = txtPath.Text; // I downloaded the HTML-File
doc.Load(fileName);
string strGREYInner;
foreach (HtmlNode td in doc.DocumentNode.SelectNodes("//tr[#class=\"tblDataGreyNH\"]"))
{
strGREYInner = td.InnerText.Trim();
string shorted = strGREYInner.Replace("\t", ""); string shorted2 = shorted.Replace("\n\n\n\n", "\n\n\n"); string shorted3 = shorted2.Replace("\n\n\n", "\n\n"); string shorted4 = shorted3.Replace("\n\n", "\n");
GREYsource = shorted4.Split(new Char[] { '\n', });
}
foreach (string str in GREYsource)
{
...
}
}
Problem: the result contains a lot of tabs(/t) and newlines(/n) I need to trim.
Problem: This isn't a good way to do it, IMO. And this would just grab the Totaltimes.
It can be done better.
This is just a example I tried (other codes just went a pile of junk)
I attached the HTML-structure below:
Overview(picture):
A bit more in depth:
<html>
<head>
</head>
<style type="text/css">
</style>
<body id="body" onload="handleMenuOverlapLogo();onload_column_expand();;firstElementFocus();">
<.. some (java)scripts> /* has to be ignoered. not necessary */
<.. some other divs> /* has to be ignoered. not necessary */
<div id="rowContent"> /* This <div> contains the content i need */
<div id="titleTab"> /* Title is not necessary */
</div>
<div id="rowContentInner"> /* Here the content starts */
<table class="tblList">
<tbody>
<tr> /* not necessary */
<tr class="tblHeader"> /* not necessary */
<tr class="tblHeader"> /* not necessary */
<tr class="tblDataWhiteNH"> /* IN : */
<td class="tblHeader" style="font-weight: bold; text-align: right"> In </td>
<td nowrap=""> /* "tblDataWhiteNH" always contains 7 "td nowrap"
<td nowrap="">
<td nowrap=""> /* Example: if it contains a value */
<table width="100%" border="0" align="center">
<tbody>
<tr>
<td width="25%" align="left"> </td>
<td nowrap="" width="50%" align="center"> 7:53 </td> /* value = 7:53 (THIS!) */
<td width="25%" align="right"> </td>
</tr>
</tbody>
</table>
</td>
<td nowrap="">
<td nowrap=""> /* Example: if it contains no value */
<table width="100%" border="0" align="center">
<tbody>
<tr>
<td width="25%" align="left"> </td>
<td nowrap="" width="50%" align="center"> /* no value = 0:00 (THIS!) */
<td width="25%" align="right"> </td>
</tr>
</tbody>
</table>
</td>
<td nowrap="">
<td nowrap="">
<tr class="tblDataWhiteNH"> /* OUT : */
<td class="tblHeader" style="font-weight: bold; text-align: right"> Out </td>
<td nowrap=""> /* "tblDataWhiteNH" always contains 7 "td nowrap".
<td nowrap="">
<td nowrap=""> /* Example: if it contains a value */
<table width="100%" border="0" align="center">
<tbody>
<tr>
<td width="25%" align="left"> </td>
<td nowrap="" width="50%" align="center"> 7:53 </td> /* value = 7:53 (THIS!) */
<td width="25%" align="right"> </td>
</tr>
</tbody>
</table>
</td>
<td nowrap="">
<td nowrap=""> /* Example: if it contains no value */
<table width="100%" border="0" align="center">
<tbody>
<tr>
<td width="25%" align="left"> </td>
<td nowrap="" width="50%" align="center"> /* no value = 0:00 (THIS!) */
<td width="25%" align="right"> </td>
</tr>
</tbody>
</table>
</td>
<td nowrap="">
<td nowrap="">
<tr class="tblDataGreyNH"> /* IN : */
<tr class="tblDataGreyNH"> /* OUT : */
... /* "tblDataGreyNH" is built up the same way like "tblDataWhiteNH".
... /* sometimes there could be more "tblDataWhiteNH" and "tblDataGreyNH". */
... /* Usally there are just the "tblDataWhiteNH"(IN/OUT) */
<tr class="tblHeader"> /* not necessary */
/* It continues f.egs. with "tblDataWhite" if the last above header was a "tblDatagrey" */
/* and versa vice ("grey" if there was a "white" before.) */
<tr class="tblDataWhiteNH"> /* Worked : */
<td class="tblHeader" style="font-weight: bold; text-align: right"> Total Time </td>
<td> 07:47 </td> /* value = 7:47 (THIS!) */
<td> 04:48 </td>
<td> 00:00 </td> /* no value = 0:00 (THIS!) */
<td> 00:00 </td>
<td> 07:42 </td>
<td> 00:00 </td>
<td> 00:00 </td>
</tr>
<tr class="tblDataGreyNH"> /* Total : */
<td class="tblHeader" style="font-weight: bold; text-align: right"> Regular Time </td>
<td> 07:47 </td> /* value = 7:47 (THIS!) */
<td> 04:48 </td>
<td> </td> /* no value = 0:00 (THIS!) */
<td> </td>
<td> 07:42 </td>
<td> </td>
<td> </td>
</tr>
<tr class="tblHeader"> /* not necessary */
<tr valign="top"> /* not necessary */
</tbody>
</table>
</div>
</div>
</body>
</html>
a copy of the original HTML: http://time.wnb.dk/123/
I Hope anyone could help me get this to work.
Okay let me explain it with a picture. https://www.abload.de/img/eeeqnuwu.png
On the Picture you see the website + a table below, how the result should look like.
Declaring the Datatable isnt the problem.
The main problem is I can't get htmlagility to spit out right results and if it did, its almost buggy.
Some of the selectnodes I tried got the output messed up after a while. As yet I wasn't able to get "all" data from the table on the website, just some values, but often buggy.
So I'm actually searching for someone who could take a look on this and maybe help me to find the right selectnodes.
Not sure I fully understand what you want to do but here is a sample code that should help you get started. I strongly suggest you have a look at XPATH to understand it.
HtmlDocument doc = new HtmlDocument();
doc.Load(yourFile);
// get all TR with a specific class name, starting from root (/), and recursively (//)
foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//tr[#class='tblDataGreyNH' or #class='tblDataWhiteNH']"))
{
// get all TD below the current node with a specific class name
HtmlNode inOrOut = node.SelectSingleNode("td[#class='tblHeader']");
if (inOrOut != null)
{
string io = inOrOut.InnerText.Trim();
Console.WriteLine(io.ToUpper());
if (io.Contains("Time"))
{
// normalize-space gets rid or whitespaces (\r,\n, etc.)
// text() gets the node's inner text
foreach (HtmlNode td in node.SelectNodes("td[normalize-space(#class)='' and normalize-space(text())!='' and normalize-space(text())!='00:00']"))
{
Console.WriteLine("value:" + td.InnerText.Trim());
}
}
}
// gets all TD below the current node that define the NOWRAP attribute
HtmlNodeCollection tdNoWraps = node.SelectNodes("td[#nowrap]");
if (tdNoWraps != null)
{
foreach (HtmlNode tdNoWrap in tdNoWraps)
{
string value = tdNoWrap.InnerText.Trim();
if (value == string.Empty)
continue;
Console.WriteLine("value:" + value);
}
}
}
It will output this from your sample page:
IN
value:7:47
value:7:46
value:7:45
value:7:51
OUT
value:15:35
value:15:33
value:12:38
value:8:59
IN
value:12:38
value:8:59
OUT
value:15:35
TOTAL TIME
value:07:48
value:07:47
value:07:50
value:01:08
REGULAR TIME
value:07:48
value:07:47
value:07:50
value:01:08

Categories