Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
karlrez
Frequent Visitor

create new report using powerbi-client-react

I am using the demo example for powerbi-client-react: https://github.com/microsoft/powerbi-client-react

I've added a onCreate() function to generate a new report but running into this 'no create support' error. Is there another approach that should be taken to create new reports?

 

karlrez_0-1731437245756.png

 

const [report, setReport] = useState();

const onCreate = () => {
   report.create()
}

 

 

<PowerBIEmbed
      embedConfig={sampleReportConfig}
      eventHandlers={eventHandlersMap}
      cssClassName={'report-container'}
      getEmbeddedComponent={(embedObject) => {
        setReport(embedObject);
      }}
    />  
2 REPLIES 2
v-fenling-msft
Community Support
Community Support

Hi, @karlrez 

I am glad to help you.

 

There is no create() method in the Power BI JavaScript API.

 

const [report, setReport] = useState();

const onCreate = () => {
   report.create()
}

 

 

You can create, edit, and save embedded reports in a React app according to the official documentations, hope they helps:

How to embed a Power BI item in a React app | Microsoft Learn

Create, edit, and save an embedded report | Microsoft Learn

 

You can also refer to this blog, hope it helps:

How to Embed A Power BI Report in React | by Diksha Chhablani | Globant | Medium

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am trying to following the example from this screenshot in the link:

Create, edit, and save an embedded report | Microsoft Learn 

karlrez_0-1731521171112.png

 

I am still getting 'createReport is not a function'.

 

Do you have a link to an example of creating a new report using the powerbi-client-react library?

Also do you have the link for the CreateReportEmbedUrl?

 

karlrez_0-1731529607094.png

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.