• Steven Buelow 17
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi, I'm actually trying to find out if there is an easy way to do this. I'm looking to use as much non-custom class salesforce as possible. 

I'd like to create a Apex:Page.StandardController:User that does something like this:
<apex:pageBlock> <apex:pageBlockTable value="{!users}" var="a" > <apex:column value="{!a.name}"/> <apex:column value="{!a.ProfileId}"/> <apex:column value="{!a.UserRoleId}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>


But as I've read, vaguely, the system defaults to the last viewed Filtered list of that Object Type.  We're instructed to use something like this: 
 
<apex:panelGrid columns="2"> 
 <apex:outputLabel value="View:"/> 
  <apex:selectList value="{!filterId}" size="1"> 
  <apex:actionSupport event="onchange" rerender="opp_table"/> 
 <apex:selectOptions value="{!listviewoptions}"/> 
</apex:selectList> 
</apex:panelGrid>


My Question: Can I programatically set  the fcf value on the StandardObject User as it pulls the information for the view? I DON'T want this to be user selected. I'd like it to be a forced selection that whenever they'd go to a specific page, they'd get a specific view.

Can this be done without a custom controller OR any .JS hacking?

I was hopeing for something like 
 
<apex:page standardController="User" recordSetVar="users" tabstyle="user" sidebar="false" fcf="00Bo0000002sTnZ">

 
Hi, I'm actually trying to find out if there is an easy way to do this. I'm looking to use as much non-custom class salesforce as possible. 

I'd like to create a Apex:Page.StandardController:User that does something like this:
<apex:pageBlock> <apex:pageBlockTable value="{!users}" var="a" > <apex:column value="{!a.name}"/> <apex:column value="{!a.ProfileId}"/> <apex:column value="{!a.UserRoleId}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>


But as I've read, vaguely, the system defaults to the last viewed Filtered list of that Object Type.  We're instructed to use something like this: 
 
<apex:panelGrid columns="2"> 
 <apex:outputLabel value="View:"/> 
  <apex:selectList value="{!filterId}" size="1"> 
  <apex:actionSupport event="onchange" rerender="opp_table"/> 
 <apex:selectOptions value="{!listviewoptions}"/> 
</apex:selectList> 
</apex:panelGrid>


My Question: Can I programatically set  the fcf value on the StandardObject User as it pulls the information for the view? I DON'T want this to be user selected. I'd like it to be a forced selection that whenever they'd go to a specific page, they'd get a specific view.

Can this be done without a custom controller OR any .JS hacking?

I was hopeing for something like 
 
<apex:page standardController="User" recordSetVar="users" tabstyle="user" sidebar="false" fcf="00Bo0000002sTnZ">

 
Hi,

We want to fetch standard report data in apex so we are using following approach but we are just getting 1st column of standard report data.
How can we get all standard report data in apex?

Our approach:

Step -1
<Salesforce instance>/servlet/servlet.ReportList
From above link we are getting list of all reports with their report id and url.

Step - 2
sample response:

<result>
<report foldername="My Personal Custom Reports" name="Contact-Account Report">
<id><ID></id>
<url>
<![CDATA[ <ID>?isExcel=1 ]]>
</url>
<isPublic>false</isPublic>
</report>
<report foldername="Administrative Reports" name="All Active Users">
<url>
<![CDATA[
/00O?rt=32&retURL=%2Fservlet%2Fservlet.ReportList&t=active&c=FN&c=LN&c=RO&c=PR&c=UN&c=LL&duel0=FN%2CLN%2CRO%2CPR%2CUN%2CLL&details=yes
]]>
</url>
<description>Who are the active salesforce.com users?</description>
</report>
</result>
From above response we are just fetching "All Active Users" report url i.e
/00O?rt=32&retURL=%2Fservlet%2Fservlet.ReportList&t=active&c=FN&c=LN&c=RO&c=PR&c=UN&c=LL&duel0=FN%2CLN%2CRO%2CPR%2CUN%2CLL&details=yes
This url we are appending with &export=1&enc=UTF-8&xf=csv, by using this we can download file in csv form.

step -3
We are using following code to fetch standard report("All Active Users") data.
PageReference page = new PageReference('/00O?rt=32&retURL=%2Fservlet%2Fservlet.ReportList&t=active&c=FN&c=LN&c=RO&c=PR&c=UN&c=LL&duel0=FN%2CLN%2CRO%2CPR%2CUN%2CLL&details=yes&export=1&enc=UTF-8&xf=csv'); 
system.debug('response data=='+page.getContent().toString());
When we are executing above code then in response we are just getting 1st column data.
You can see column names in above url whose parameter name is "&c". In above case 1st parameter column name is &c=FN so I am just getting "FN" data.

If we are trying above url directly in browser then we are getting csv file with all data but in pageReference we are just getting 1st column data.
If we are removing all column parameter i.e "&c" param then in pageReference code we are getting all data for all columns but We don't want that because we want selected column data.

Instead of pageReference we have also tried with Http callout but there we are getting authentication failure.
We have also added session Id but facing with authentication failure.

How can we fetch standard report data in apex?

Thanks,
Rupali


Where is the report data stored for SF reports?  I would like to pull report data and graphs into a visual force page so I can create a custom report package (similar to a dashboard, but much more customizable), but I don't know where this data is stored.

 

Is there an object type or something of the sort where report filters and data are stored?  It would also work if I could call dashboard components if they're stored as well, just so that I could skip calling the data tables and go straight to the charts.

 

Thanks