I have two <Div>s in an html, 1. ReportSection 2. ExcelSection in AttendanceReport view html. When I call the view from controller , the DivID Excelsection should not be execute. Rest of all part should be executed. But when I click PrintExcel button , only execute Excel Section but not execute Report section . Please can you give the suggested code to implement this functionality .
Thanks
Pol
Controller
public IActionResult AttendanceReport(ReportViewModel report) { return View("AttendanceReport", report); }
<div class="col-sm-4"> <button type="button" class="btn btn-primary form-control col-sm-3" onclick="PrintExcel()">Export Excel</button></div><div id="ReportSection"><table id="tdAttendanceReport" class="table table-bordered table-striped" style="width:100%; table-layout: fixed;word-wrap: break-word" ><thead><tr><th>Date</th><th>Name</th><th>Position</th><th>Office</th><th>Clocked in</th><th>Clocked Out</th><th>N. Attendance</th><th>Day off</th><th>Sick</th><th>Holiday</th><th>Time Off</th><th>Time Off Hrs</th><th>Age</th><th>Start date</th><th>Salary</th><th>Comment</th></tr></thead><tbody><tr><td> 20/03/2019</td><td>Tiger Nixon</td><td>System Architect</td><td>Edinburgh</td><td> 00:00</td><td> 00:00</td><td> 1</td><td> 1</td><td> 1</td><td> 1</td><td> 1</td><td> 1</td><td>61</td><td>2011/04/25</td><td>$320,800</td><td>sdkjfhsdh s dofhsdfh sdiufuisfi iufhi s uifi s iuf sdif</td></tr></tbody></table></div><div id="ExcelSection"><table id="tdAttendanceExcel" class="table table-bordered table-striped" style="width:100%; table-layout: fixed;word-wrap: break-word" ><thead><tr><th>Date</th><th>Name</th><th>Position</th><th>Office</th><th>Clocked in</th><th>Clocked Out</th><th>N. Attendance</th><th>Day off</th><th>Sick</th><th>Holiday</th><th>Time Off</th><th>Time Off Hrs</th><th>Age</th><th>Start date</th><th>Salary</th><th>Comment</th></tr></thead><tbody><tr><td> 20/03/2019</td><td>Tiger Nixon</td><td>System Architect</td><td>Edinburgh</td><td> 00:00</td><td> 00:00</td><td> 1</td><td> 1</td><td> 1</td><td> 1</td><td> 1</td><td> 1</td><td>61</td><td>2011/04/25</td><td>$320,800</td><td>sdkjfhsdh s dofhsdfh sdiufuisfi iufhi s uifi s iuf sdif</td></tr></tbody></table></div>