Friday, September 2, 2011

Few "Salesforce Reports" tips and tricks

Again, it's been long time since my last post. But, better late than never. Isn't it? :)

Lets discuss about some tips and tricks for salesforce reports.

1. First of all, if we want to access a list of all the  reports programatically, you can get it in xml format by opening following URL:
"https://instance.salesforce.com/servlet/servlet.ReportList". Needless to say, you have to be logged into your salesforce instance.

2. Next, let us say we want to show a particular report in a visualforce page on a link/button click. Simply include an iFrame in the page with src="https://instance.salesforce.com/00Ox000000xxxxx".
This was simple one. Right? :)

3. But, the above page will have one problem, it will show the headers in the iFrame which looks kind of odd to have two headers (list of tabs visible).
So, how to remove this. Simple, just modify the URL by putting "?isdtp=mn" in the end. Which makes the URL look like this:
"https://instance.salesforce.com/00Ox000000xxxxx?isdtp=mn". And whooshh. The header is gone.

4. Now, let us assume you need to give a direct download link to a report in csv/xls format. The url for the link would be:
"https://instance.salesforce.com/00Ox0000000xxxx?export=1&enc=UTF-8&xf=csv" or "https://instance.salesforce.com/00Ox0000000xxxx?export=1&enc=UTF-8&xf=xls".
This is done by setting the parameters export, enc (encoding) and xf (the format). One thing is quite interesting here, the "xls" format report is not "a native excel file".
They just format it in this way and put an ".xls" extension, so that by default it opens with MS Excel. However, if you try to open this file in some mobile application which supports excel files, it wont open properly as it is not actually an excel file.

5. Finally, this one will look an old one, but still useful.
Suppose we want to give some filter criteria for a report at run time (e.g. there is report link visible to all but the filter criteria for country depends on user's country).
For this, create a report; create the filter but don't but any values in the filter. Keep them empty.Now, build a URL in the following format:
"https://instance.salesforce.com/00Ox0000000xxxx?pv0=India&pv1=Active" (assuming filter 1 is for country and 2 is for some status field).
The values "India" and "Active" can be dynamically generated in a controller class.
If you have more filters, you can continue to pv2, pv3 and so on.

There are some more parameters that you pass in the URL to do a thing or two. For example to delete a report the URL would be something like this:
"https://instance.salesforce.com/00Ox0000000xxxx?delrep". Want to explore more thing? Open a report, view HTML source and find out the actions of the buttons/links on the report page.


Don't forget to put Id of your report instead of the ones given in the examples :).


Please note that the salesforce may change any of the above parameters without notice (may be not so soon though) bacause they don't provide standard API access to these thing and not even standard documentation.


These tricks are for in situations when you are asked "just do it" and you have no standard documented way of doing it.

There are very little documentation for point 5. You can find one of them here.

You can find some more references from "Salesforce Heretic blog (http://sfdc-heretic.warped-minds.com/2006/04/10/progmatic-access-to-salesforcecom-reports/)" and developer force discussion boards.

Let me know if any of the above tricks don't work for you.



Cheers. Happy Clouding :)

34 comments:

  1. Reallu useful post Thanks .
    Keep bloging

    ReplyDelete
  2. This is awesome!!! Precisely what I needed.

    ReplyDelete
  3. I just see the post i am so happy to the communication science post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be replay for your great thinks and I hope you post again soon.

    digital marketing course in chennai
    hadoop training in chennai

    ReplyDelete

  4. Great presentation of Salesforce form of blog and Salesforce tutorial. Very helpful for beginners like us to understand Salesforce course. if you're interested to have an insight on Salesforce training do watch this amazing tutorial.https://www.youtube.com/watch?v=5FTe-ah3WBU

    ReplyDelete
  5. Thanks for such a great article here. I was searching for something like this for quite a long time and at last I’ve found it on your blog. It was definitely interesting for me to read  about their market situation nowadays.
    Java training in Pune

    Java interview questions and answers

    Java training in Chennai | Java training institute in Chennai | Java course in Chennai

    Java training in Bangalore | Java training institute in Bangalore | Java course in Bangalore

    ReplyDelete
  6. You got an extremely helpful website I actually have been here reading for regarding an hour. I’m an initiate and your success is incredibly a lot of a concept on behalf of me.

    angularjs Training in bangalore

    angularjs Training in bangalore

    angularjs interview questions and answers

    angularjs Training in marathahalli

    angularjs interview questions and answers

    angularjs-Training in pune

    ReplyDelete
  7. Really appreciate this wonderful post that you have provided for peoples. Its really good. Nice information.


    ExcelR Data Science Course Bangalore

    ReplyDelete
  8. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
    ExcelR Data science courses in Bangalore

    ReplyDelete
  9. Attend The Python Training in Bangalore From ExcelR. Practical Python Training in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python Training in Bangalore.

    ReplyDelete
  10. Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!
    data analytics course malaysia

    ReplyDelete
  11. PhenQ Reviews - Is PhenQ a new Scam?
    Does it really work? Read this honest review and make a wise purchase decision. PhenQ ingredients are natural and ...
    It has been deemed fit for use in the market. It is not found to be a Scam weight loss pill.
    By far it is the safest and most effective weight loss pill available in the market today.

    Phenq reviews ..This is a powerful slimming formula made by combining the multiple weight loss
    benefits of various PhenQ ingredients. All these are conveniently contained in one pill. It helps you get the kind of body that you need. The ingredients of
    the pill are from natural sources so you don’t have to worry much about the side effects that come with other types of dieting pills.Is PhenQ safe ? yes this is completly safe.
    Where to buy PhenQ ? you can order online. you don`t know Where to order phenq check this site .

    visit https://mpho.org/ this site to know more about PhenQ Reviews.

    ReplyDelete
  12. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
    data analytics courses in hyderabad

    ReplyDelete
  13. I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!

    ReplyDelete
  14. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.data science course in Hyderabad

    ReplyDelete
  15. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.data science course in Hyderabad

    ReplyDelete
  16. Nice to be visiting your blog again. it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college. and it has same topic with your article. Thanks. great share.
    Best CBD Oil UK

    ReplyDelete
  17. And indeed, I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had.Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
    sap training in chennai

    sap training in tambaram

    azure training in chennai

    azure training in tambaram

    cyber security course in chennai

    cyber security course in tambaram

    ethical hacking course in chennai

    ethical hacking course in tambaram

    ReplyDelete
  18. This post is so interactive and informative.keep update more information...
    Java Training in Bangalore
    Java Classes in Pune

    ReplyDelete
  19. Cheap Web Hosting Plans In India with the best key features like Free Domain, Free SSL, Daily Backup, 24*7 Support, and Control Panel.

    ReplyDelete
  20. Nice blog and informative content. Keep up this awesome work in your further blogs. Thank you. If you want to become a data scientist, then follow the below link.
    Online Data Science Training

    ReplyDelete
  21. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
    data science course fee in hyderabad

    ReplyDelete
  22. This post is very simple to read and appreciate without leaving any details out. Great work!
    business analytics course in hyderabad

    ReplyDelete
  23. In the ever-evolving digital landscape, businesses seeking versatility and reliability often turn to Adult Hosting services, where privacy and performance are paramount, and the cornerstone of this online presence frequently resides in the form of an Offshore Dedicated Server or the more budget-friendly alternative, Cheap Offshore VPS Hosting, as they navigate the complex web of data privacy, content regulation, and diverse customer demands, with Adult Hosting providers offering a specialized haven for mature content creators and entrepreneurs, where the need for robust, secure hosting solutions aligns seamlessly with the choice of an Offshore Dedicated Server, a fortress of online privacy that offers complete control over resources, bandwidth, and security, making it the go-to solution for businesses whose content requires a discreet and impervious home on the internet

    ReplyDelete