Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aura:component controller="CH_Account_Summary_Report_Controller" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId">
- <aura:attribute name="recordId" type="Id" />
- <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
- <aura:attribute name="Url" type="String"/>
- <iframe source="{!v.Url}" width="100%"/>
- public with sharing class CH_Account_Summary_Report_Controller {
- @AuraEnabled
- public static string getReportURL(Id AccountId)
- {
- system.debug(AccountId);
- Account act = [SELECT SEG_SCH_ID__c FROM Account WHERE Id=:AccountId];
- string UCN = act.SEG_SCH_ID__c;
- string Url = 'https://dev-jasper.scholastic.com/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=%2FUAT%2FCRM_Reports%2FRevenue_Summary_Report&ReportFlag=RU&UCN='+UCN+'&ParentFolderUri=%2FUAT%2FCRM_Reports&reportLocale=en_US&j_username=SFDC_user&j_password=%24prinG%23123&standAlone=true&decorate=no';
- return Url;
- }
- ({
- doInit : function(component, event, helper) {
- var action = component.get("c.getReportURL");
- action.setParams({
- "AccountId": component.get("v.recordId")
- });
- action.setCallback(this, function(response) {
- if(response.getState() == "SUCCESS"){
- component.set("v.Url", response.getReturnValue());
- //alert(response.getReturnValue());
- }
- else if (response.getState() == "ERROR"){
- $A.log("ERRORS", response.getError());
- }
- });
- $A.enqueueAction(action);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement