SAP Knowledge Base Article - Public

1294510 - How to create a report off in Crystal Reports using your own SOQL query?


  • How to use your own query in Crystal Reports?
  • Can we use Salesforce Object Query Language (SOQL) to write your own query to in Crystal Reports?
  • Note: Images and data in this SAP Knowledge Base Article is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.


  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016


  • When reporting off in Crystal Reports, it is possible to use your own query written in Salesforce Object Query Language (SOQL), by using a Command Object:
    1. In Crystal Reports, under the menu "File", select "New - Blank Report"
    2. In the "Database Expert", under "Available Data Sources:" double click on ""
       SForce - SP - 01.png    
    3. In the "" window, enter the user credential, and click "Finish"
       SForce - SP - 03 - 01.png 
    4. To write your own query (SOQL), double click on "Add Command" under the connection created.
        01- SForce - 05.png  
    5. In the "Add Command to Report" window, type your Salesforce Query (SOQL), then click "OK"
       01- SForce - 06.png  
    6. Back to the previous window, notice under "Selected Tables", the object "Command" as been added.
      This command, is the Salesforce Query you just entered. To continue click "OK" or "Finish"
       01- SForce - 07.png
    7. In the "Design" view of the report, add the desired database fields.
      You are  now reporting off a Salesforce Query in Crystal Reports.
  • Notes:
    • For information on how to write a Salesforce Query (SOQL), see the following link on website: Salesforce Object Query Language
    • For questions or issues using SOQL, contact Support, or search the website.


CR, SForce, Add Command, SFDC, , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To


SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016