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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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