13

I'm facing issues in inserting reports inside the lightning component. As in VF pages we have analytics report tag or iframe..but in lightning i'm not able to find a solution. If any body has done it..please share your thoughts. I have to place bar graphs,..pie chart..line graphs etc in my components.

Thanks in advance

3
  • can't we add reports in VF page and use that VF page in lightning page ?
    – Ratan Paul
    Commented Dec 30, 2015 at 3:55
  • u hv a reportchart component for lightning page built via app builder (no need to go via VF). but if u r building ur own lightning component or a page using community builder its not possible. Commented Dec 30, 2015 at 6:32
  • @VamsiKrishna Did you find solution for this ?
    – brahma
    Commented Sep 11, 2017 at 10:51

3 Answers 3

5

There is a Report Chart component that can be added to the lightning app builder, however, it is currently not available in the community builder. Documentation have a lightning component in the AppExchange which can be used in the Community Builder, however, it does still require some code/configuration to get it working, but it will handle the rendering for you.

3

there is a developer blog post on this.

It basically amounts to:

  • let Apex Controller get Report Data by Report MetaData API
  • process to your needs and return to lightning component
  • render as needed
  • you can also use some JavaScript charting liberaries

General approach: Transforming Report Data for Lightning Component by D. Peter JS charting library, and a slightly different approach by p. Battison enter link description here

1
  • thx Christian, I've seen this blog series before. what I'm after is a more direct way of adding a reporting chart to a lightning app. currently there is a standard report chart lightning component but its only available in App builder. we can't use it in our custom lightning apps built using developer console or in the community builder. Commented Dec 29, 2015 at 4:49
1

I'd like to share a little information related to Christian's answer. We built a component following the concepts laid out in the developer blog: Transforming Report Data for Lightning Component by D. Peter. I love this approach because it allows us to modify reports for our clients without going into the code of the component to update the report. We have delegated the content of these reports to the business side, so they can update them on the fly.

However, we've recently run into issues with it on large datasets due to CPU timeouts. This approach creates objects for each individual cell in each row of the report, so as the report gets bigger it takes longer to generate.

For reference, we currently have 3 reports that we're using this for:

  • Reports 1 & 2 have about 10 groups and 2000 records, these take about 30 seconds to load
  • Report 3 has about 800 groups and 2000 records, these time out.

Update: We were able to improve the component by making the rendering asynchronous. I wrote a blog post outlining the strategy: Salesforce Lightning Reports Component Optimization There isn't a lot of code besides a few references to methods, but the strategy should be useful to solving similar problems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .