Forum Discussion

FerYelAco93's avatar
FerYelAco93
Frequent Visitor
5 years ago

How i use powerbi-router in reactjs

Hello,

I need help with the powerbi-router component installed with npm in my Reactjs project.

How i use, if i want a dynamic menu in my app that connect to my power BI embeded report, used the powerbi-report-component library in reactjs with the <Report /> tag.

 

This is my <Report /> tag:

<Report
tokenType="Embed"
accessToken={localStorage.getItem('accessToken')}
embedUrl={"https://app.powerbi.com/reportEmbed?reportId=" + REACT_APP_EMBED_REPORT_ID}
embedId={REACT_APP_EMBED_REPORT_ID}
reportMode="View"
datasetId={REACT_APP_EMBED_DATASET_ID}
groupId={REACT_APP_EMBED_GROUP_ID}
extraSettings={extraSettings}
permissions="View"
style={reportStyle}
onLoad={this.handleReportLoad}
onRender={this.handleReportRender}
/>

I store the name and displayName of the pages I need from power BI report, and I loaded dynamicly according to the rol of the user loged. I need te specific route to connect my dynamic menu with the report embed.
 
Please and thank you for everything! 

2 Replies