Advertisement
Guest User

Untitled

a guest
Aug 4th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. <aura:component controller="CH_Account_Summary_Report_Controller" implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId">
  2. <aura:attribute name="recordId" type="Id" />
  3. <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
  4. <aura:attribute name="Url" type="String"/>
  5. <iframe source="{!v.Url}" width="100%"/>
  6. </aura:component>
  7.  
  8. public with sharing class CH_Account_Summary_Report_Controller {
  9. @AuraEnabled
  10. public static string getReportURL(Id AccountId)
  11. {
  12. system.debug(AccountId);
  13. Account act = [SELECT SEG_SCH_ID__c FROM Account WHERE Id=:AccountId];
  14. string UCN = act.SEG_SCH_ID__c;
  15. 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';
  16.  
  17. return Url;
  18. }
  19. }
  20.  
  21. ({
  22. doInit : function(component, event, helper) {
  23. var action = component.get("c.getReportURL");
  24. action.setParams({
  25. "AccountId": component.get("v.recordId")
  26. });
  27. action.setCallback(this, function(response) {
  28. if(response.getState() == "SUCCESS"){
  29. component.set("v.Url", response.getReturnValue());
  30. //alert(response.getReturnValue());
  31. }
  32. else if (response.getState() == "ERROR"){
  33. $A.log("ERRORS", response.getError());
  34. }
  35. });
  36. $A.enqueueAction(action);
  37. }
  38.  
  39. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement