Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can examples can be a little more elaborated ? Errors so far running them. #96

Closed
anicolas-richard opened this issue Apr 27, 2024 · 3 comments

Comments

@anicolas-richard
Copy link

Hello,
I'd love to integrate the library, though I can't manage to do so into a js script runned with Node v21.
Every example lead to errors, and for instance : TypeError : generateSingleQueryWorkbook is not a function
Maybe the Readme file also outdated with very recent v3 release of the library ?
Though, forcing running the 2.1.25 release doesn't help.
I hope to get some assistance.
Best regards,
Antoine

@ron-b
Copy link
Contributor

ron-b commented Apr 28, 2024

Hi Antoine,

Can you share a sample project with your issues?

@anicolas-richard
Copy link
Author

Hello Ron,

Sure. I basically try to execute one of the README example, using Node (tried latest v20 & v21) :

import workbookManager from '@microsoft/connected-workbooks';
const grid = {
  config: { promoteHeaders:true, adjustColumnNames:true },
  data: [
      ["Product", "Price", "InStock", "Category", "Date"],
      ["Widget A", 19.99, true, "Electronics", "10/26/2024"],
      ["Gizmo B", 9.99, true, "Accessories", "10/26/2024"],
      ["Bubala", 14.99, false, "Accessories", "10/22/2023"],
      ["Thingamajig C", 50, false, "Tools", "5/12/2023"],
      ["Doohickey D", 50.01, true, "Home", "8/12/2023"]
  ]
};
const blob = workbookManager.generateTableWorkbookFromGrid(grid);    
workbookManager.downloadWorkbook(blob, "MyTable.xlsx");

I have several issues with some (maybe normal) workarounds :

  • I need to ass a comma in const grid, between the 2 properties
  • I have to save as a module (mjs extension) to use the 'import' declaration/syntax
  • Though, I still get an error stating 'generateTableWorkbookFromGrid is not a function', which I can't manage to fix.

Hopes this is more clear for you :)
I am very looking forward using such a solution to generate Excel files with specific Power Query already built in !

Best regards,
Antoine

@mabezen
Copy link
Collaborator

mabezen commented May 22, 2024

Hi Antoine, could you check out the beta version we've just release?

@mabezen mabezen closed this as completed May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants