Skip to content
This repository has been archived by the owner on Nov 14, 2017. It is now read-only.

Unable to use Utils method. Method not found #20

Open
CWLye opened this issue Aug 28, 2015 · 2 comments
Open

Unable to use Utils method. Method not found #20

CWLye opened this issue Aug 28, 2015 · 2 comments

Comments

@CWLye
Copy link

CWLye commented Aug 28, 2015

Hello,

I am using this package in my application to read excel files and import the data. On the server side, I have a method that gets the range of the sheet in preparation for reading. When I call 1 of the helper functions under utils (decode_range), I get a Internal 500 error on the client and a method not found error on the server. Am I missing anything here?

//Gets base path of application
var fs = Npm.require('fs');
var path = Npm.require('path');
var basepath = path.resolve('.').split('.meteor')[0];
//Create excel object
var excel = new Excel('xlsx');
//Read excel file
var workbook = excel.readFile( basepath+'public/test.xlsx');
var sheet = workbook.Sheets['Sheet1'];
//Gets range from sheet and run decode_range
var encodedRange = sheet['!ref'];
return excel.utils.decode_range(encodedRange);

@netanelgilad
Copy link
Owner

I didn't expose the decode_range method on utils. Want to create a PR and add it?

@IITBOM
Copy link

IITBOM commented May 19, 2017

I am using below code for same but i am getting error like Exception while invoking method 'filehere' undefined

Meteor.methods({
'filehere' : function (messageData) {
var fs = Npm.require('fs');
var path = Npm.require('path');
var basepath = path.resolve('.').split('.meteor')[0];
var basepath = basepath+'server/MeteorJs.xls';
console.log(basepath);
var excel = new Excel('xls');
var workbook = excel.readFile(basepath);
//var yourSheetName = workbook.SheetNames;

   },

});

can youy fix this problem???

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants