Need to build an Excel report with Salesforce using Aspose APIs

We want to generate a report in Excel. I am attaching a sample report.

The report has a cover page and the body has a table. The data resides in Salesforce.

The last column of the report body is picked up from a Rich Text Field in Salesforce and can have images and formatted text too.

We want to know if Aspose

can support this. Happy to have a call to discuss further.

Intertek GMA - TP-2788 - 2025-03-05.pdf (1.3 MB)

Aspose can handle Excel generation but embedding rich text with images from Salesforce might need some workarounds

Thanks @Legacyashton for a quick response!
Would it possible for you to guide us on how we can get started with using Aspose for Salesforce?

@prathamesh.dalvi,

By the way, maybe you could try to use Aspose.Cell Cloud API methods in Apex. See the examples/samples here.
https://github.com/asposeforcloud/Aspose_for_SalesForce

@prathamesh.dalvi,

If you want to use on-premise APIs and do not intend to use cloud APIs, you may use Aspose.Cells which supports generating Excel reports with a cover page, a table in the body, and handling rich text fields (including images and formatted text) retrieved from Salesforce. But the process will be sort of manual.

Cover Page
You can create a cover page in Excel using Aspose.Cells by:

  • Adding text, images, and formatting to the first sheet.
  • Using methods like Worksheet.Cells[row, column].PutValue() to add text.
  • Applying styles (font, color, alignment) using the Style class.
  • Inserting images using Worksheet.Pictures.Add().
    (See the document with examples for your reference)

Table in the Body
You can create a table in the body of the report by:

  • Adding data to the worksheet starting from a specific row and column.
  • Using Worksheet.Cells.ImportData() or Worksheet.Cells[row, column].PutValue() to populate the table.
  • Formatting the table with borders, colors, and styles.

Handling Rich Text Field
Aspose.Cells supports rich text formatting, including images and formatted text. To handle a Salesforce rich text field:

  • Parse the rich text field to extract text and images by yourselves (It may contain HTML, images, and text formatting).
  • Use HtmlString of Aspose.Cells.Cell class to add formatted text to a cell.
  • Use Worksheet.Pictures.Add() to insert images.

Save the Workbook

Once the report is created, save the workbook to Excel file:

workbook.Save("SalesforceReport.xlsx", SaveFormat.Xlsx);

Hope, this helps a bit.

Thanks a lot @amjad.sahi for the detailed help! Much Appreaciated!
We DO intend to use cloud APIs. It would be great if you could let us know on how below the steps you have explained can be achieved using Cloud APIs.
Thanks Again! :slight_smile:

@prathamesh.dalvi,

Even if you choose cloud APIs, the process won’t be entirely straightforward or automatic and may require several steps. Anyways, a member of our Aspose Cloud team will review your request and get back to you here soon.