• HSinghal
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi All

 

I am trying to download multiple reports in PRINTABLE VIEW with user-specified names(like , "MyReport.xls" and not with default random name given by SFDC such as "report000023232.xls" ) with the help of custom URLs.

 

I am able to download a single report at a time using the following custom URL:

"https://ap1.salesforce.com/00ON0000000YJKB?excel=1&details=no"

 

 

But now I want to hit multiple such URLs on a single click, but unable to do so.

 

My current code is as follows:

 

VF Page code:

 

 

<apex:page controller="exportReport"  contentType="application/vnd.ms-excel#{!$Request.fileName}"  showHeader="false" showChat="false"  >

<apex:outputText escape="false" value="{!reportData}"/>
</apex:page>

 


APEX Custom Controller:

 

public with sharing class exportReport {
    public String getReportData() {

        
        Id reportId='00ON0000000YJKB';
        if(reportId != null && reportId.getSobjectType() == Report.SobjectType) {
            PageReference ref = new PageReference('/'+reportId+'?pv1=FIS-UK&excel=1');
            System.debug(logginglevel.error,ref.geturl());
            return ref.getContent().toString();
        }        
        return null;
    }
}

 

The underlined code represents the renaming attribute used and the custom link called on VF Pageload respectively.

 

Now I want multiple reports to be downloaded with a single button click using these custom links and simultaneously specifying new report names using "content type" attribute as done above.

 

Urgent HELP REQD.....

 

Thanks in advance!!

HSinghal

 

 

I am brand new to the Data Loader, if I have a business rule that I need to apply to a column before it gets loaded can I implement it in the data loader process or do I need to write special code after the load is done to take care of it.

 

Is the best practice to do my business logic in a trigger?

 

Thanks to all for any help.

 

-Jim