QuetzalMX / QuetzalXLSReader

XLS Parser by Quetzal
37 stars 9 forks source link

What am I missing? #3

Closed amelie88 closed 10 years ago

amelie88 commented 10 years ago

Hi Olivares

I am trying to use this library in my project, but can not get it to work.

I have added the library to my frameworks, and in viewDidLoad in my first view I have added

NSURL *url = [[NSURL alloc] initWithString:@"Transactions.xls"];

QZWorkbook *excelReader = [[QZWorkbook alloc] initWithContentsOfXLS:url];

QZWorkSheet *firstWorkSheet = excelReader.workSheets.firstObject;
[firstWorkSheet open];

NSLog(@"%@", firstWorkSheet.rows.firstObject);

I have included the library in my .h file.

But the output from my NSLog is (null).

What am I missing?

Any help would be greatly appreciated!

ghost commented 10 years ago

Hi Olivares,

I am getting the same problem as amelie88, using this code:

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Historico" ofType:@"xls"];
NSURL *url = [NSURL URLWithString:filePath];

QZWorkbook *excelReader = [[QZWorkbook alloc] initWithContentsOfXLS:url];

QZWorkSheet *firstWorkSheet = excelReader.workSheets.firstObject;
[firstWorkSheet open];

NSLog(@"%@", firstWorkSheet.rows.firstObject);
guiltm commented 10 years ago

me too..

silviu-geronimo commented 8 years ago

I know this is super outdated but you could solve your problem using this way to get the url after dragged and dropped your excel file into the project tree:

NSURL *urlPath = [[NSBundle mainBundle]
                    URLForResource: @"Historico" withExtension:@"xls"];
QZWorkbook *excelReader = [[QZWorkbook alloc] initWithContentsOfXLS:urlPath];
guiltm commented 8 years ago

A little outdated ^^ I solved in the season, but thanks for attention,

2016-09-21 7:55 GMT-03:00 silviu-geronimo notifications@github.com:

I know this is super outdated but you could solve your problem using this way to get the url after dragged and dropped your excel file intro the project tree: NSURL urlPath = [[NSBundle mainBundle] URLForResource: @"Historico" withExtension:@"xls"]; QZWorkbook excelReader = [[QZWorkbook alloc] initWithContentsOfXLS:urlPath];

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/QuetzalMX/QuetzalXLSReader/issues/3#issuecomment-248577574, or mute the thread https://github.com/notifications/unsubscribe-auth/AHrLJWx2EsUlWTR8q5AEZvxeeIWMC7bvks5qsQ0MgaJpZM4Bsl7m .