function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JBabuJBabu 

Redirecting a Visualforce page to a report

Hi,

 

I have a visulaforce page and when I click on a account name then it will be directed to report whose filter values are filtered by that account name which I clicked on the visualforce page and the report data will be displayed for that particular account.

Please let me know how to do this.

 

Thanks,

Jbabu

 

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

First of all create a report from the wizard and add the filter criteria in the report.save the report and note down the report id.

After creating the report create a vf page where you want to access the report

Try the below code snippet as reference:

----------- Vf page --------------

<apex:page >

 <Apex:form >

 

 <script>

function open_win()

{

window.open("/00O900000021RgQ?pv0=test12234",true) // pass report id and account name

}

</script>

 

<apex:commandButton value="open report" onclick="open_win()" />

 </Apex:form>

</apex:page>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

First of all create a report from the wizard and add the filter criteria in the report.save the report and note down the report id.

After creating the report create a vf page where you want to access the report

Try the below code snippet as reference:

----------- Vf page --------------

<apex:page >

 <Apex:form >

 

 <script>

function open_win()

{

window.open("/00O900000021RgQ?pv0=test12234",true) // pass report id and account name

}

</script>

 

<apex:commandButton value="open report" onclick="open_win()" />

 </Apex:form>

</apex:page>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

This was selected as the best answer
JBabuJBabu

Thank you Navatar..

AdilewaAdilewa

What if I want to redirect direclty to report and not to a button?