Class QuoteDocumentGenerator
Class for generating mail-merged Quote documents based on a DataSet with multiple, related tables
Namespace: SuperOffice.CRM.Sale
Assembly: SoDataBase.dll
Syntax
public static class QuoteDocumentGenerator : Object
Remarks
It's not quite arbitrary - the Thumbnail and Image fields, if present, lead to Quote images being fetched. There is also special functionality to merge two documents, also a requirement for Quote. Possibly not the prettiest thing we could do.
Fields
QuoteDetailsTag
Class for generating mail-merged Quote documents based on a DataSet with multiple, related tables
Declaration
public const string QuoteDetailsTag = "QuoteDetails"
Field Value
Type | Description |
---|---|
String |
Remarks
It's not quite arbitrary - the Thumbnail and Image fields, if present, lead to Quote images being fetched. There is also special functionality to merge two documents, also a requirement for Quote. Possibly not the prettiest thing we could do.
Methods
MergeToPdf(Stream, Stream, DataSet)
Taking streams of bytes (main doc, lines doc) and a Dataset (merge data), produce a merged PDF document
Declaration
public static Stream MergeToPdf(Stream template, Stream mainDoc, DataSet data)
Parameters
Type | Name | Description |
---|---|---|
Stream | template | The template for the 'quote lines' document, containing Aspose tags |
Stream | mainDoc | The main document, if there is one, to which the quote lines will be appended |
DataSet | data | Merge data from the Quote Manager or another compatible source |
Returns
Type | Description |
---|---|
Stream | Stream (backed by a byte array) containing a PDF document ready to save |
Remarks
If there is only a main doc, then it will be merged with the dataset and saved as PDF.
If there is only a details doc, then it will be merged with the database and saved as PDF. If both are defined and there is no "QuoteDetails" tag in the main doc, then both will be merged with the dataset, and the details doc will be appended to the main doc. The result is saved as PDF. If both are defined and the main doc contains a "QuoteDetails" tag, then both will be merged with the dataset, and the details doc will be inserted at the position of the tag in the main doc (the tag is removed).PrescanForTags(Int32)
Find out which tags are present in a Word document; this is used to control the final data-generation process
Declaration
public static string[] PrescanForTags(int documentId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | documentId |
Returns
Type | Description |
---|---|
String[] |
Remarks
It's not quite arbitrary - the Thumbnail and Image fields, if present, lead to Quote images being fetched. There is also special functionality to merge two documents, also a requirement for Quote. Possibly not the prettiest thing we could do.
PrescanForTags(Stream)
Class for generating mail-merged Quote documents based on a DataSet with multiple, related tables
Declaration
public static string[] PrescanForTags(Stream content)
Parameters
Type | Name | Description |
---|---|---|
Stream | content |
Returns
Type | Description |
---|---|
String[] |
Remarks
It's not quite arbitrary - the Thumbnail and Image fields, if present, lead to Quote images being fetched. There is also special functionality to merge two documents, also a requirement for Quote. Possibly not the prettiest thing we could do.