Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function EmbedPowerBIReport(reportLink, reportId, pageName) {
Promise.all(promises).then(
function (values) {
embed.off("rendered");
CopilotSummary();
RaiseReportLoaded(reportFilters, reportPages, pageFilters, embedCorrelationId);
},
function (error) {
Expand Down Expand Up @@ -303,6 +304,34 @@ function FullScreen() {
embed.fullscreen();
}

function CopilotSummary() {
const summaryRequest = {
prompt: "Summarize this.",
reportSelection: {
isEntireReportSelected: true,
}
};

console.log(embed);
const uid = embed.config.uniqueId; // Correct usage of UID
console.log("🔁 Sending summary request:", summaryRequest);
console.log("🆔 UID:", uid);

embed.service.hpm.post(
"/report/copilotSummary",
summaryRequest,
uid ? { uid } : {},
embed.iframe.contentWindow
)
.then((response) => {
console.log("📄 Summary response:\n" + JSON.stringify(response));
})
.catch((err) => {
console.error("❌ Error calling /report/copilotSummary:", err);
console.log("Summary error:\n" + JSON.stringify(err));
});
}

function UpdateReportFilters(filters) {
var newFilters = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function EmbedPowerBIReport(reportLink, reportId, pageName) {
Promise.all(promises).then(
function (values) {
embed.off("rendered");
CopilotSummary();
RaiseReportLoaded(reportFilters, reportPages, pageFilters, embedCorrelationId);
},
function (error) {
Expand Down Expand Up @@ -303,6 +304,34 @@ function FullScreen() {
embed.fullscreen();
}

function CopilotSummary() {
const summaryRequest = {
prompt: "Summarize this.",
reportSelection: {
isEntireReportSelected: true,
}
};

console.log(embed);
const uid = embed.config.uniqueId; // Correct usage of UID
console.log("🔁 Sending summary request:", summaryRequest);
console.log("🆔 UID:", uid);

embed.service.hpm.post(
"/report/copilotSummary",
summaryRequest,
uid ? { uid } : {},
embed.iframe.contentWindow
)
.then((response) => {
console.log("📄 Summary response:\n" + JSON.stringify(response));
})
.catch((err) => {
console.error("❌ Error calling /report/copilotSummary:", err);
console.log("Summary error:\n" + JSON.stringify(err));
});
}

function UpdateReportFilters(filters) {
var newFilters = null;
try {
Expand Down
Loading