Skip to content

Conversation

@ali-hamud
Copy link
Contributor

Live Demo with visible code.

@msftclas msftclas added the documentation Improvements or additions to documentation label Nov 13, 2016
<div id="left-pane" class="halfWidth right">
<div id="embedArea">
<h3>Embedded Report Area</h3>
<h5>The following div id is <b>reportContainer</b>. In code, we embed a report to it.</h5>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to go through text scrubbing for the texts here..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is sure.
I will do it in another increment.

<br/>
<div class="line">
<h4>Flow</h4>
Once you have a report imported to PowerBI Workspace, you are ready to Embed it.<br/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*embed.. no caps..

please go through text scrubbing


function _Report_GetId() {
report = powerbi.embeds[0];
$('#result').html(report.getId());
Copy link
Contributor

@noanu noanu Nov 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is"report" always defined? is there a chance for referencing a null here? (and same comment for the below code thar references the report object without checking if it is defined.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually report can be null if there is no embeds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the code will not be that clear.
this is a sample code for developers, they should add the check after copying.


function UpdateSessions() {
var txtAccessToken = $('#txtAccessToken').val();
if (txtAccessToken)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if these strings are empty strings? do you want to update the session with them anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

}
}

function SetAccessTokenFromSession() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the session should always be updated with correct values and is responsible for checking for nulls when it is updates, so is it neccessary do check it also here?

@@ -0,0 +1,32 @@
var embedWithSpecificReportDivExpanded = false;

function ExpandEmbedWithSpecificReportDiv() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this function name be somethings with "toggle" (that was it does doesn't it?)

if (parts && parts.length > 0)
{
var guidParts = parts[parts.length -1].split("&");
id = guidParts[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a chance "guidParts" is null?

@ali-hamud ali-hamud merged commit 744c0b7 into dev Nov 14, 2016
tenshi13 pushed a commit to tenshi13/PowerBI-JavaScript that referenced this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants