Here are the Steps to create Report with BI publisher on Apex
Need to generate xml data of your query
So to generate the XML data of the query there are various methods and here is the simple method to generate XML data of your query
STEP 1: Go to Shared components → Report Queries
so when the user clicks the button they can able to download the PDF report with the data
Need to generate xml data of your query
So to generate the XML data of the query there are various methods and here is the simple method to generate XML data of your query
STEP 1: Go to Shared components → Report Queries
STEP 2: In the Report, Queries add a name and desired output format, I have selected as PDF as my report will be downloaded as PDF file
STEP 3: Type in your query and click Next
Note(in a single query you must have all data that you are going to display in the report)
STEP 4: Select data source for the report as XML and click Download this will download the xml file of the query output
STEP 5: Select Create report query in this wizard and select create in the final wizard
Our XML file has been generated and now we need to Create an RTF layout for report
We need to have BI Publisher Add-ins in our MS WORD to generate RTF FILE
STEP 6: Open MS WORD Select the BI Publisher Tab and in Load Data select Sample XML
and select the downloaded employee details XML here
STEP 7: After loading it successfully, select all fields as marked below to get the entire data in a table format which will loop the data automatically.
STEP 8: Now you can customize your report as you wish, add or remove columns from the table
I have shown a sample layout of the invoice table in the below image(don't confuse it with the employee table xml data )
STEP 9: Select RTF in the Preview tab
STEP 10: Which will be saved as a separate rtf file and your data will be shown in that file
STEP 11: Go to Shared components → Report Layout
STEP 12: Select Create and select Report layout type as RTF and click next
STEP 13: Name the layout and choose the RTF File generated from MS word here and select create layout
STEP 14:Go to Shared components → Report Queries, select the report query we have already created and select the report layout as invoice layout that we have created in report layout
You can use the session values in the page where you are going to download the PDF be checking the session state checkbox and we need to list the page items below it
STEP 15: Copy the URL ie in the print URL item,
Create a button in a page and in the button behaviour make it as a redirect to URL and in the Target paste the copied URL. That's all now user can download the pdf report












