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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
397660
New Member

Not able to Create a report in power bi service programatically using Javascript

let embedCreateConfiguration = {
tokenType: models.TokenType.Embed,
accessToken: embedToken,
embedUrl: "https://embedded.powerbi.com/ReportEmbed",
datasetId: datasetId,
permissions: models.Permissions.All,

settings: {
background: models.BackgroundType.Transparent, useCustomSaveAsDialog: false,

localeSettings: {
language: "en-us"
},
bars: { statusBar: { visible: true},
actionBar: { visible: true }},
panes: { bookmarks: { visible: true }, fields: { expanded: false, visible: true }, filters: { expanded: false, visible: true},
pageNavigation: { visible: true}, selection: { visible: false },
syncSlicers: { visible: true}, visualizations: { expanded: false, visible: true}}}};

 

let embedContainer = $('#embedContainer')[0];
// Create report
var report = powerbi.createReport(embedContainer, embedCreateConfiguration);
let saveAsParameters = {
name: "nw report",
targetWorkspaceId: "df98e615-ae6e-41b0-b70e-aa9bac71bd88"
};
report.saveAs(saveAsParameters);
var isReportSaved = report.isSaved();Promisestate.png

1 REPLY 1
Gengar
Resolver I
Resolver I

Hi @397660 ,

 

Maybe asking this question in developer is better than asking it in service 

Developer - Microsoft Fabric Community  

 

Kind regards,

Gengar

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors