Advertisement
Guest User

Untitled

a guest
Aug 4th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 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.  
  7. public with sharing class CH_Account_Summary_Report_Controller {
  8. @AuraEnabled
  9. public static string getReportURL(Id AccountId)
  10. {
  11. system.debug(AccountId);
  12. Account act = [SELECT SEG_SCH_ID__c FROM Account WHERE Id=:AccountId];
  13. string UCN = act.SEG_SCH_ID__c;
  14. 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';
  15.  
  16. return Url;
  17. }
  18.  
  19. ({
  20. doInit : function(component, event, helper) {
  21. var action = component.get("c.getReportURL");
  22. action.setParams({
  23. "AccountId": component.get("v.recordId")
  24. });
  25. action.setCallback(this, function(response) {
  26. if(response.getState() == "SUCCESS"){
  27. component.set("v.Url", response.getReturnValue());
  28. //alert(response.getReturnValue());
  29. }
  30. else if (response.getState() == "ERROR"){
  31. $A.log("ERRORS", response.getError());
  32. }
  33. });
  34. $A.enqueueAction(action);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement