JSTL table colspan merge - html-table

By clicking the above link, I will generate a screen to request.
<div class="sub_contents_wrap">
<div class="btn_div" style="width:100%;">
<div class="left_div controll_btn p0">
<div>* 상세현황</div>
</div>
</div>
<div id="gridD" class="data_grid k-grid k-widget" data-role="grid" style="height: 500px;">
<div class="k-grid-header" style="padding-right: 17px;">
<div class="k-grid-header-wrap" data-role="resizable">
<table role="grid" style="width:100%;">
<thead role="rowgroup">
<tr align="center" style="font-size: 15px;">
<th scope="col" bgcolor="CDCDCD" rowspan="2">NO</th>
<th scope="col" bgcolor="CDCDCD" rowspan="2">부서</th>
<th scope="col" bgcolor="CDCDCD" rowspan="2">이름</th>
<th scope="col" bgcolor="CDCDCD" rowspan="2">직급</th>
<th scope="col" bgcolor="CDCDCD"rowspan="2">시간단가</th>
<th scope="col" bgcolor="CDCDCD" colspan="6">연차수당</th>
<th scope="col" bgcolor="CDCDCD" colspan="5">보상수당</th>
<th scope="col" bgcolor="CDCDCD" colspan="5">유급수당</th>
</tr>
<tr role="row">
<th scope="col" bgcolor="E6E6E6">기본</th>
<th scope="col" bgcolor="E6E6E6">조정</th>
<th scope="col" bgcolor="E6E6E6">사용</th>
<th scope="col" bgcolor="E6E6E6">사용조정</th>
<th scope="col" bgcolor="E6E6E6">잔여</th>
<th scope="col" bgcolor="E6E6E6">연차수당</th>
<th scope="col" bgcolor="E6E6E6">생성</th>
<th scope="col" bgcolor="E6E6E6">이월</th>
<th scope="col" bgcolor="E6E6E6">사용</th>
<th scope="col" bgcolor="E6E6E6">잔여</th>
<th scope="col" bgcolor="E6E6E6">보상수당</th>
<th scope="col" bgcolor="E6E6E6">생성</th>
<th scope="col" bgcolor="E6E6E6">이월</th>
<th scope="col" bgcolor="E6E6E6">사용</th>
<th scope="col" bgcolor="E6E6E6">잔여</th>
<th scope="col" bgcolor="E6E6E6">유급수당</th>
</tr>
</thead>
<tbody>
<c:set var="pass_cnt" value="0"/>
<c:set var="spanCnt" value="0"/>
<c:forEach var='item' items="${list}" varStatus ="status">
<td>${status.index+1}</td>
<td>${item.dept_name}</td>
<td>${item.emp_name}</td>
<td>${item.position_name}</td>
<td></td>
<td>${item.annv_basic_day}</td>
<td>${item.annv_abjust_day}</td>
<td>${item.annv_used_day}</td>
<td>${item.annv_used_abjust_day}</td>
<td>${item.annv_remain}</td>
<td></td>
<td>${item.exp_vacate_day}</td>
<td></td>
<td>${item.exp_vacate_used_day}</td>
<td>${item.exp_vacate_remain}</td>
<td></td>
<td>${item.paid_vacate_day}</td>
<td>${item.paid_vacation_carried}</td>
<td>${item.paid_vacate_used_day}</td>
<td>${item.paid_vacate_remain}</td>
<td></td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
==============================================================================
Using jstl TAG I want to progress colspan Merge as shown on the screen above.
Please help me.
The above code is to read the data of Grid and read it into Excel file when clicking Button on the Grid screen. Therefore, it can not be created with JavaScript. Help me.

Related

WebSupergoo.ABCpdf10 exception "Illegal characters in path"

I am trying to re-build an old .NET Visual Basic application I have inherited that uses WebSupergoo.ABCpdf10 (ABCpdf, Version=10.1.2.5). I am getting an exception "Illegal characters in path", ultimately thrown by the method System.IO.Path.CheckInvalidPathChars. However, this is called by the external code, so I have little control over it. The stack trace is as follows:
[ArgumentException: Illegal characters in path.]
System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional) +12831187
System.IO.Path.Combine(String path1, String path2) +34
WebSupergoo.ABCpdf10.Internal.Gecko.GeckoRpc.GetABCGeckoPath(String currLoc, String installDir) +378
WebSupergoo.ABCpdf10.Internal.Gecko.WorkerPool.AddRef(HtmlManagedOptions managedOptions) +332
WebSupergoo.ABCpdf10.Internal.Gecko.AddUrlProgress.Start(Boolean readAsync) +91
WebSupergoo.ABCpdf10.Internal.Gecko.DocAddGecko.AddUrl(String url) +1260
WebSupergoo.ABCpdf10.Internal.Gecko.DocAddGecko.AddHtml(String html) +290
WebSupergoo.ABCpdf10.Doc.AddUrlHtml(String urlOrHtml, Boolean isHtml, Boolean paged, Int32 width, Boolean disableCache) +251
WebSupergoo.ABCpdf10.Doc.AddImageHtml(String html, Boolean paged, Int32 width, Boolean disableCache) +49
GI.Platform.Core.Business.PdfDocument.AddHtml(String html, Int32 browserWidth, PageOrientation pageOrientation, Boolean paged) in C:\Users\MartinVaughan\Documents\Development\GI Platform\original-platform\GI.Platform.Core\Business\PDFDocument.vb:168
GI.Platform.UI.Legacy.UserControls.Admin.ReportGeneration.btnGPIBasicReportPdf_Click(Object sender, EventArgs e) in C:\Users\MartinVaughan\Documents\Development\GI Platform\original-platform\GI.Platform.UI\UserControls\Admin\ManageRegistration\ReportGeneration.ascx.vb:234
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +121
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9859004
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1696
The method GI.Platform.Core.Business.PdfDocument.AddHtml is ours and passes an HTML-formatted string. Thereafter, the methods are external (part of the WebSupergoo package). Our method calls AddImageHtml, which appears to call AddUrlHtml.
I have stripped all URLs out of the HTML string (as I thought this might be the problem). I have also stripped out any characters I thought might be dubious. The HTML string is now (indentation added here for readability):
<html>
<head>
</head>
<body>
<table cellpadding='5' cellspacing='0' border='0' width='100%'>
<tr>
<td rowspan='3' width='350'></td>
<td class='titleCell'>GPI™ Datasheet</td>
</tr>
<tr>
<td class='nameCell'>User Name</td>
</tr>
<tr>
<td class='dateCell'>Generated on 13/09/2022</td>
</tr>
</table>
<br />
<table cellpadding='0' cellspacing='0' border='0' width='90%' class='data' align='center'>
<tr class='header'>
<th class='centerAlign'>Dimension/Sub-Dimension</th>
<th class='centerAlign'>Type</th>
<th class='centerAlign'>Rank</th>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>Incremental - Radical</b>
</th>
<th class='leftAlign'>
<b>Incremental</b>
</th>
<th class='centerAlign'>
<b>3</b>
</th>
</tr>
<tr>
<td class='leftAlign'>Evolutionary - Revolutionary</td>
<td class='leftAlign'>Evolutionary</td>
<td class='centerAlign'>2</td>
</tr>
<tr>
<td class='leftAlign'>Practical - Conceptual</td>
<td class='leftAlign'>Practical</td>
<td class='centerAlign'>3</td>
</tr>
<tr>
<td class='leftAlign'>Rational - Intuitive</td>
<td class='leftAlign'>Rational</td>
<td class='centerAlign'>4</td>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>Focused - Flexible</b>
</th>
<th class='leftAlign'>
<b>Focused</b>
</th>
<th class='centerAlign'>
<b>4</b>
</th>
</tr>
<tr>
<td class='leftAlign'>Outcome - Spontaneous</td>
<td class='leftAlign'>Outcome</td>
<td class='centerAlign'>4</td>
</tr>
<tr>
<td class='leftAlign'>Conscientious - Cursory</td>
<td class='leftAlign'>Conscientious</td>
<td class='centerAlign'>5</td>
</tr>
<tr>
<td class='leftAlign'>Perfectionist - Pragmatic</td>
<td class='leftAlign'>Perfectionist</td>
<td class='centerAlign'>2</td>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>Extraversion - Introversion</b>
</th>
<th class='leftAlign'>
<b>Introversion</b>
</th>
<th class='centerAlign'>
<b>3</b>
</th>
</tr>
<tr>
<td class='leftAlign'>Outgoing - Reserved</td>
<td class='leftAlign'>Reserved</td>
<td class='centerAlign'>5</td>
</tr>
<tr>
<td class='leftAlign'>Asserting - Accepting</td>
<td class='leftAlign'>Accepting</td>
<td class='centerAlign'>1</td>
</tr>
<tr>
<td class='leftAlign'>Fun Loving - Serious-Minded</td>
<td class='leftAlign'>Serious-Minded</td>
<td class='centerAlign'>5</td>
</tr>
<tr>
<td class='leftAlign'>Socially Assured - Socially Uncertain</td>
<td class='leftAlign'>Socially Uncertain</td>
<td class='centerAlign'>2</td>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>Collectivist - Individualist</b>
</th>
<th class='leftAlign'>
<b>Individualist</b>
</th>
<th class='centerAlign'>
<b>4</b>
</th>
</tr>
<tr>
<td class='leftAlign'>Affiliative - Unaffiliative</td>
<td class='leftAlign'>Unaffiliative</td>
<td class='centerAlign'>5</td>
</tr>
<tr>
<td class='leftAlign'>Trusting - Questioning</td>
<td class='leftAlign'>Questioning</td>
<td class='centerAlign'>3</td>
</tr>
<tr>
<td class='leftAlign'>Conforming - Dissenting</td>
<td class='leftAlign'>Dissenting</td>
<td class='centerAlign'>5</td>
</tr>
<tr>
<td class='leftAlign'>Modest - Assuming</td>
<td class='leftAlign'>Assuming</td>
<td class='centerAlign'>3</td>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>At Ease - Ill-at Ease</b>
</th>
<th class='leftAlign'>
<b>Ill-at Ease</b>
</th>
<th class='centerAlign'>
<b>2</b>
</th>
</tr>
<tr>
<td class='leftAlign'>Relaxed - Tense</td>
<td class='leftAlign'>Tense</td>
<td class='centerAlign'>1</td>
</tr>
<tr>
<td class='leftAlign'>Placid - Discontented</td>
<td class='leftAlign'>Discontented</td>
<td class='centerAlign'>5</td>
</tr>
<tr>
<td class='leftAlign'>Optimistic - Pessimistic</td>
<td class='leftAlign'>Pessimistic</td>
<td class='centerAlign'>3</td>
</tr>
<tr>
<td class='leftAlign'>Confident - Self-Conscious</td>
<td class='leftAlign'>Confident</td>
<td class='centerAlign'>1</td>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>Disciplined - Impulsive</b>
</th>
<th class='leftAlign'>
<b>Disciplined</b>
</th>
<th class='centerAlign'>
<b>3</b>
</th>
</tr>
<tr class='dimension'>
<th class='leftAlign'>
<b>Driving - Measured</b>
</th>
<th class='leftAlign'>
<b>Measured</b>
</th>
<th class='centerAlign'>
<b>1</b>
</th>
</tr>
<tr>
<td class='leftAlign'>Persuasive - Consensual</td>
<td class='leftAlign'>Consensual</td>
<td class='centerAlign'>1</td>
</tr>
<tr>
<td class='leftAlign'>Ambitious - Contented</td>
<td class='leftAlign'>Ambitious</td>
<td class='centerAlign'>2</td>
</tr>
<tr>
<td class='leftAlign'>Energetic - Paced</td>
<td class='leftAlign'>Paced</td>
<td class='centerAlign'>3</td>
</tr>
</table>
<br />
<table cellpadding='0' cellspacing='0' border='0' align='center'>
<tr>
<td class='copyrightCell'>© 2022 Glowinkowski International Limited</td>
</tr>
</table>
</body>
</html>
(Note: I have removed the link to the CSS file and an image with a URL, as I thought these might be creating the problem).
Still getting the exception!
Could anyone throw any light on this?
Edit
Looking at the WebSupergoo documentation at https://www.websupergoo.com/helppdfnet/default.htm?page=source%2f5-abcpdf%2fdoc%2f1-methods%2faddimagehtml.htm they note that:
Using the MSHTML, ABCGecko and ABCWebKit engines, ABCpdf saves this HTML into a temporary file and renders the file using a 'file://' protocol specifier. So this is a convenience function - it doesn't offer any performance enhancements. Sometimes the IIS users do not have full access to the temp directory. This is determined by the system setup you have on your machine. If this is the case you will get errors returned. So if you are working from ASP you may find that you need to enable access to the temp directory for the ASPNET user, the IUSR_MACHINENAME user or the IWAM_MACHINENAME user.
This may be the root cause of the problem, in which case, my question would translate to how do I enable access in my Visual Studio build?.

Geb Select a tag based on text

I am trying to select based on text, I use the following to select
$("div[class='ui-datatable-tablewrapper']").find("span:contains('Person Name')")
i get the following error:
Caused by: org.openqa.selenium.InvalidSelectorException: invalid selector: An invalid or illegal selector was specified
I believe it's because of the "contains" selector in jquery. How do I achieve the same in geb.
Html:
<div class="ui-datatable-tablewrapper">
<table role="grid">
<thead id="searchForm:singleStaffDT_head">
<tr role="row">
<th id="searchForm:singleStaffDT:j_id_7s" class="ui-state-default" role="columnheader"
aria-label="Person ID" scope="col" style="width:15%">
<span class="ui-column-title">Person ID</span>
</th>
<th id="searchForm:singleStaffDT:j_id_7u" class="ui-state-default" role="columnheader"
aria-label="Person Name" scope="col" style="width:25%">
<span class="ui-column-title">Person Name</span>
</th>
<th id="searchForm:singleStaffDT:j_id_7w" class="ui-state-default" role="columnheader"
aria-label="Organization" scope="col" style="width:25%">
<span class="ui-column-title">Organization</span>
</th>
<th id="searchForm:singleStaffDT:j_id_7y" class="ui-state-default" role="columnheader"
aria-label="Staff Role" scope="col" style="width:25%">
<span class="ui-column-title">Staff Role</span>
</th>
<th id="searchForm:singleStaffDT:j_id_80" class="ui-state-default" role="columnheader"
aria-label="" scope="col" style="width:10%">
<span class="ui-column-title">Action
<BR />[Select]</span>
</th>
</tr>
</thead>
<tbody id="searchForm:singleStaffDT_data" class="ui-datatable-data ui-widget-content">
<tr class="ui-widget-content ui-datatable-empty-message">
<td colspan="5"></td>
</tr>
</tbody>
</table>
</div>
For a "contains" search, you want to write your code in a similar pattern to this:
$("span", text: contains("Person Name"))
You could also do something like this in your page object (i think!):
personName { $('span').find(text: 'Person Name') }
Or:
personName { find('span', text: 'Person Name') }

PrimeNg TurboTable colgroup dynamic colspan

How can I assign variable to primeng TurboTable ColGroup colspan property.
<ng-template pTemplate="header">
<tr>
<th rowspan="3">Brand</th>
<th colspan="4">Sale Rate</th>
</tr>
<tr>
<th colspan="colSpanCount">Sales</th>
<th colspan="2">Profits</th>
</tr>
<tr>
<th>Last Year</th>
<th>This Year</th>
<th>Last Year</th>
<th>This Year</th>
</tr>
</ng-template>
In above example, I want to bind colSpanCount variable to colspan attribute of p-table.
I think, I have found an answer myself. We can set [attr.colspan]="colSpanCount" property to set colspan dynamically.
<ng-template pTemplate="header">
<tr>
<th rowspan="3">Brand</th>
<th colspan="4">Sale Rate</th>
</tr>
<tr>
<th [attr.colspan]="colSpanCount">Sales</th>
<th colspan="2">Profits</th>
</tr>
<tr>
<th>Last Year</th>
<th>This Year</th>
<th>Last Year</th>
<th>This Year</th>
</tr>
</ng-template>
As you've discovered, you can change colspan to [attr.colspan].
Another solution is to change colspan to [colSpan].
See this answer for a deeper explanation

Multiple jquery datatables on same page causing width issue. (Datatables v10.13)

It causes width issue for both tables. Refer the code below,
<table id="tblMessages" class="table table-striped table-bordered full-width table-advance table-hover table-condensed fl" style="border-collapse:collapse !important;">
<thead>
<tr>
<th style="cursor:pointer; width:20%">From</th>
<th style="cursor:pointer; width:60%">Subject</th>
<th style="cursor:pointer; width:20%">Date</th>
</tr>
</thead>
<tbody></tbody>
</table>
And here is second table,
<table id="tblToDos" class="table table-striped table-bordered table-advance full_width table-hover table-condensed fl" style="border-collapse:collapse !important">
<thead>
<tr>
<th style="width:5%"></th>
<th style="cursor:pointer; width:20%">From</th>
<th style="cursor:pointer; width:30%">Patient</th>
<th style="cursor:pointer; width:35%">Subject</th>
<th style="cursor:pointer; width:10%">Reminder Date</th>
</tr>
</thead>
Note that I tried with giving width in "Columns" property of Datatables but no luck.
And if I removed second table init then it is working fine.
I got the solution. Though it is not a proper solution but we can solve this matter by redraw the grid using below code.
$('#tblMessages').DataTable().columns.adjust().draw();
Put this line after you are done with initialising second datatable.

vb.net: Get data from Xelement <table></table>

I have loaded a Xelement from my SharePoint site.
Dim elTable2 As XElement = <table border="1" id="table2" style="font-size:1em;border-collapse:collapse;display:inline;width:100%">
<tbody>
<tr class="ms-rteTableHeaderRow-default" style="text-align:center">
<th class="ms-rteTableHeaderFirstCol-default">​</th>
<th class="ms-rteTableHeaderOddCol-default">LAN IP​</th>
<th class="ms-rteTableHeaderEvenCol-default">Username​</th>
<th class="ms-rteTableHeaderOddCol-default">Password​</th>
<th class="ms-rteTableHeaderEvenCol-default">Port​</th>
<th class="ms-rteTableHeaderOddCol-default">OS​</th>
<th class="ms-rteTableHeaderEvenCol-default">Extra Info​</th>
</tr>
<tr class="ms-rteTableOddRow-default" style="text-align:center">
<th class="ms-rteTableFirstCol-default">Netasq</th>
<td class="ms-rteTableOddCol-default"></td>
<td class="ms-rteTableEvenCol-default"></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
</tbody>
</table>
The table will have an unknown number of rows. Can I loop trough all the rows and check what data is in the first column?
You could leverage Html Agility Pack for that purpose. It is a .NET code library that allows to parse HTML content and supports plain XPATH or XSLT.
Example
Dim table As XElement = <table border="1" id="table2" style="font-size:1em;border-collapse:collapse;display:inline;width:100%">
<tbody>
<tr class="ms-rteTableHeaderRow-default" style="text-align:center">
<th class="ms-rteTableHeaderFirstCol-default">​Val</th>
<th class="ms-rteTableHeaderOddCol-default">LAN IP​</th>
<th class="ms-rteTableHeaderEvenCol-default">Username​</th>
<th class="ms-rteTableHeaderOddCol-default">Password​</th>
<th class="ms-rteTableHeaderEvenCol-default">Port​</th>
<th class="ms-rteTableHeaderOddCol-default">OS​</th>
<th class="ms-rteTableHeaderEvenCol-default">Extra Info​</th>
</tr>
<tr class="ms-rteTableOddRow-default" style="text-align:center">
<td class="ms-rteTableFirstCol-default">Netasq</td>
<td class="ms-rteTableOddCol-default"></td>
<td class="ms-rteTableEvenCol-default"></td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
<td class="ms-rteTableOddCol-default">​</td>
<td class="ms-rteTableEvenCol-default">​</td>
</tr>
</tbody>
</table>
Dim html = New HtmlDocument()
html.LoadHtml(table.ToString())
For Each row In html.DocumentNode.SelectNodes("//tr[position()>1]") 'XPath expression to select table rows and skip table header
Dim cell As HtmlNode = row.SelectSingleNode("td[1]") 'Get cell for first column
Console.WriteLine(cell.InnerText)
Next