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
data_edifyedu
New Member

Flask App not passing variable to Javascript function

I'm kind of newbie in Power Bi embedded, webapps and similar topics.

But, I'm trying to create a portal, for sharing reports with people outside my organization (It's a little compaty, and doesn't fit the Power Bi Premium on our budget).

For this, I've discovered the Power Bi embedded solution and get the hands on the Webapplication.

I already have a power bi Pro licence, and I've created the application id, and etc 

So far so good, except the parameter for the embed_info is not passing to the javascript function. (All of those I've got on microsoft's github).

 

Here is the route code:

@views.route('/render_report/<string:rep>/<string:usr>', methods=['GET','POST'])
@login_required
def render_report(rep,usr):
    userid = usr
    reportid = rep

    new_record = ReportViews(report_id=reportid, user_id=userid)
    db.session.add(new_record)
    db.session.commit()
    
    user=current_user.id
    report = Report.query.filter(Report.id.like(reportid)).first()
    wrkid = report.pbiworkspaceid
    repid = report.pbireportid

    embed_info = PbiEmbedService().get_embed_params_for_single_report(workspace_id=wrkid, report_id=repid)
    embed_json = json.loads(embed_info)
    url = embed_json['reportConfig'][0]['embedUrl']

    #return embed_info
    return render_template("render.html", embed_info=embed_info, user=current_user, report=report, url=url)
 
@views.route('/render', methods=['GET'])
@login_required
def render():
    return jsonify({})
 
And here the HTML page of "render" is here
data_edifyedu_0-1618327466898.png

 

In my base.html I've the script part aswell

data_edifyedu_1-1618327496927.png

 

Please help me!
 
Many thanks
Omar
1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @data_edifyedu ,

Please review the content in the following links, hope they can help you.

Easily embed secure Power BI reports in your internal portals or websites

Power BI embedded analytics Client APIs

What You Need to Know About Power BI Embedded (With Examples)

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.