You may need to create an Excel report that contains multiple result sets on a single worksheet. You can do this by exporting result sets to a specific cell in a worksheet. You may also want to make this report attractive. You can do this by using an already-formatted Excel file as a template. In this way, you can use an Excel file that you previously formatted with titles, heading, etc, as a template, and then export data to this file each week, producing an attractive, easy-to-read report, automatically!
In this example, we will use two different queries to export data to two different cells on a single worksheet.
Watch a video version of this tutorial: Automate Complex Excel Reports
Format the Excel file to your preferences. For this example, we added a page title and two section headings on one worksheet. You will export data to a range of cells in each section. Make a note of the first cell address in each range where you want your data to start.
Now click the Select to File activity to add it to the Automation design window. Make sure the activity is added to the Automation workflow below the Copy File activity.
In the Options section, in the Start export at fields, specify the column and row address of the first cell in the range into which you want to export this data. Click OK to close the dialog.
Click
Open the new file by clicking the link in the Log tab. The file retains the formatting and headings from your original template and includes the result sets of the two queries inserted into the cell ranges you specified.
The output of this script is a formatted excel file containing the result sets of multiple queries on a single worksheet.
Note: If you want to create a script that exports the result set of each query into a separate worksheet in your Excel file, you can easily accomplish this by using a SQL file that contains multiple queries. See Automate Exporting to Excel Reports for more information.
See Schedule Your Script to learn how to schedule the Automation script.
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Conditions d’utilisation Confidentialité Cookie Preference Center