Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="container">
  <h1 class="title my-6">SpreadJS 템플릿 자동 완성</h1>
  <h2 class="subtitle mb-6">SpreadJS 템플릿 디자이너에서 생성한 엑셀 템플릿을 불러와 데이터 바인딩 만으로 자동완성 견적서를 만드는 샘플 입니다.</h2>
  <div class="buttons m-4">
  <button class="button is-primary" onclick="ExcelExport()">
    Excel 내보내기
  <button class="button is-link" onclick="ExcelPDF()">
    PDF 내보내기
<div id="ss" style="width:100%;height:600px"></div>  





                // 테스트 데이터 생성
var productData = {
    {"code":"SJS15DM", "name":"SpreadJS 15 Developer License with Maintenance - New License", "quantity": 1, "amount": 1999000, "netprice": 1999000, "vat": 1999000/10, "sum": 1999000+1999000/10},
    {"code":"SJS15DM01", "name":"SpreadJS 15 Distribution License with Maintenance - New License", "quantity": 2, "amount": 2332000, "netprice": 4664000, "vat": 4664000/10, "sum": 2332000+4664000/10},
    {"code":"SJS15DCM", "name":"SpreadJS 15 Designer Component with Maintenance - New License", "quantity": 1, "amount": 5833000, "netprice": 5833000, "vat": 5833000/10, "sum": 2332000+5833000/10},
    {"code":"GEJ5PM", "name":"GcExcel Java 5 Project License with Maintenance - New License", "quantity": 1, "amount": 1500000, "netprice": 1500000, "vat": 1500000/10, "sum": 1500000+1500000/10}

var spread, excelIO;

// SpreadJS 선언 및 양식 불러오기
$(document).ready(function () {

  spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
  excelIO = new GC.Spread.Excel.IO();

    //템플릿 불러오기
    url: "",
    datatype: "json",
    success: function (data) {
      //here to load ssjson file.
      //데이터 소스 설정
      var source = new GC.Spread.Sheets.Bindings.CellBindingSource(productData);
    error: function (ex) {
      alert('Exception:' + ex);

    .then(function(response) {
    return response.arrayBuffer();
    .then(function(arrayBuffer) {
    var base64String = _arrayBufferToBase64(arrayBuffer);
    var fonts = {
      normal: base64String
    GC.Spread.Sheets.PDF.PDFFontsManager.registerFont('malgun', fonts);
    GC.Spread.Sheets.PDF.PDFFontsManager.fallbackFont = function (font) {
      return fonts.normal;

function ExcelExport(){

  var fileName = getToday()+"_견적서";  

  if (fileName.substr(-5, 5) !== '.xlsx') {
    fileName += '.xlsx';
  var json = spread.toJSON({
    includeBindingSource : true
  });, function (blob) {
    saveAs(blob, fileName);
  }, function (e) {


function ExcelPDF(){

  var fileName = getToday()+"_견적서";  

  if (fileName.substr(-5, 5) !== '.pdf') {
    fileName += '.pdf';

    function (blob) {
      saveAs(blob, fileName);
      title: 'Quotation',
      author: 'GrapeCity',
      subject: 'Quotation',
      keywords: 'Quotation',
      creator: 'GrapeCity'


// 결적서 파일명에 날짜정보 추가 
function getToday(){
  var date = new Date(); 
  var year = date.getFullYear(); 
  var month = new String(date.getMonth()+1); 
  var day = new String(date.getDate()); 

  if(month.length == 1){ 
    month = "0" + month; 
  if(day.length == 1){ 
    day = "0" + day; 

  return year+ month + day;


function _arrayBufferToBase64(buffer) {
  var binary = "";
  var bytes = new Uint8Array(buffer);
  var len = bytes.byteLength;
  for (var i = 0; i < len; i++) {
    binary += String.fromCharCode(bytes[i]);
  return window.btoa(binary);