Hi Mahesh,
Your
requirement can be achieved by setting the frozenRows property of SheetModel in
the openComplete
event. Here, we have attached the code block and sample for your reference.
Code
Block:
<script>
function created() {
var
spreadsheet = ej.base.getComponent(document.getElementById('container'),
'spreadsheet');
fetch(https://js.syncfusion.com/demos/ejservices/data/Spreadsheet/LargeData.xlsx)
// Fetch the remote url.
.then((response) => {
response.blob().then((fileBlob) => { // Convert the excel file to blob.
var file = new File([fileBlob], "Sample.xlsx"); //Convert the blob
into file.
spreadsheet.open({ file: file }); // Open the file into Spreadsheet.
})
})
}
function openComplete() {
var
spreadsheet = ej.base.getComponent(document.getElementById('container'),
'spreadsheet');
var sheet
= spreadsheet.getActiveSheet();
spreadsheet.sheets[sheet.index].frozenRows
= 1; // Set first row as frozen using the frozenRows property of
sheet.
}
</script>
|
Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Frozen_row_core_sample-1771448574
In the above sample, we have fetched the file with the url
and opened using the open method in the created event. And we have set the
first row as frozen in the openComplete event.
However, we have prepared a video to demonstrate freezing
the row of the sheet which is imported using the open option in the file menu.
Video link:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Frozen_row_core_on_importing295282516
Kindly, check the above provided sample and
video and get back to us , if you need further clarifications