我正在使用IF EXISTS (SELECT 1 FROM Users WHERE Reference='USR00000007')
SELECT * FROM Users WHERE Reference='USR00000007'
ELSE
SELECT * FROM Staff WHERE Reference='USR00000007';
gem。
以下是我的代码段:
writeexcel
我收到以下错误:
nil的未定义方法`new':NilClass(NoMethodError)
完整错误:
workbook = WriteExcel.new("graphTest.xls")
worksheet = workbook.add_worksheet(sheetname = "Test")
chart = workbook.add_chart(
:type => "Chart::column",
:name => "Chart",
:embedded => 1
)
如果我直接从找到here的gem文档中获取示例,为什么会收到此错误消息?
答案 0 :(得分:0)
The," Gotcha,"在您的代码段中找到column
中Chart::column
的大写:
chart = workbook.add_chart(
:type => "Chart::Column", #capitalized
:name => "Chart",
:embedded => 1
)
而不是
chart = workbook.add_chart(
:type => "Chart::column", #all lowercase
:name => "Chart",
:embedded => 1
)