Creates a PDF document by inserting database content into an RTF template and then converting the RTF to a PDF.
This component has a database interface identical to the RTF Component.
Sql to retrieve RTF template from database.
SQL to retrieve information to fill the RTF template, this SQL is called first once, without the @container parameter set, then once for each container-tag.
Retrieves the PDF templates and fonts that may be used to generate the document.
The id of the template.
Binary data of the template.
Id of the font.
Binary data of the font.
Call to create the finished document from the templates.
Determines which pages from the templates should be used and in what order. The pages will be added to the finished document based on how the table is sorted.
The id of the template to use pages from.
Which page to use from the template.
The text that should be inserted in the finished document.
The text that should be inserted.
Which page of the finished document that the text should be inserted into.
Id of the font to use.
X-coordinate that the text should be inserted at.
Y-coordinate that the text should be inserted at.
Font size of the text.
Line height of the text. If not specified, the component will try its best to calculate it from the font.
Maximum width of the text. Determines when line breaks are inserted.
Images to insert in the document. The image data will be retreived in a later call.
The id of the image.
Which page of the finished document that the image should be inserted into.
X-coordinate that the image should be inserted at.
Y-coordinate that the image should be inserted at.
Width of the inserted image. Images will always retain its aspect ratio.
Height of the inserted image. Images will always retain its aspect ratio.
Will be called once for each unique image.
Binary data of the image.
You do not need to implement this call. It is only made if the menu item has dynamic forwarding.
Displays a user friendly error message to the user. This blocks any forwarding for the user.
Displays a user friendly confirmation message to the user with a delete button as the confirm button. If the user chooses OK the SQL call will be rerun with the parameter @ButtonAction set to 'Delete'.
Displays a user friendly confirmation message to the user with a question style. If the user chooses OK the SQL call will be rerun with the parameter @ButtonAction set to 'Confirm'.
Displays a user friendly confirmation message to the user with a warning style. If the user chooses OK the SQL call will be rerun with the parameter @ButtonAction set to 'Confirm'.
Displays a user friendly info message to the user. When the user clicks OK the user is forwarded.
Displays a user friendly success message to the user. When the user clicks OK the user is forwarded.
The dialog alias of a predefined dialog to show the user. Must be the first column in the result set table. Use multiple result set tables to combine with other forwarding.
Use the menu item "Admin > Dialogs" to register new dialogs or find aliases for existing ones.
Any column without special meaning in the result set with the first column ADMIN_Dialog will be used to make replacements of placeholders in the message and title text.
Additional information to show the developer when using ADMIN_Dialog.
Any column with no other specific meaning will be passed along to the menu item or link you are forwarding to.
Number of steps in the page history to jump back if the user clicks Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelcidstepsback specified in the query string.
Jumps back to the menu item with this alias if the user clicks Cancel in an ADMIN_FORCE dialog (the default being none). If no prior menu item is found with the given alias, then an error is thrown.
Alias of the menu item to execute if the user clicks Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
Deprecated. Use ADMIN_CancelMenuItem instead.
Id of the menuitem to execute if the user clicks Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
Number of steps in the page history to jump back after execution (the default being one step back). This value overrides any destination specified by the query string.
Jumps back to the menu item with this alias after execution. This value overrides any destination specified by the query string. If no prior menu item is found with the given alias, then an error is thrown.
Prompts the user with the specified text and the user may answer OK or cancel. If the user chooses OK the sql call will be rerun with the parameter @force set to 1.
Displays a user friendly message and then forwards to the next menu item.
Alias of the link to forward to.
Alias of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
Deprecated. Use ADMIN_ForwardMenuGroup instead.
Id of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
Alias of the menu item to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
Deprecated. Use ADMIN_ForwardMenuItem instead.
Id of the menu item to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
Displays a user friendly error message to the user.
Pastes HTML into an HTML editor. See ADMIN_SetFieldValueFromPopup.
Sets the value of the field specified in the menuitempopup call. Only select this column if menu item is opened in a popup.
If this column is anything but NULL the popup will be closed. Only select this column if the menu item is opened in a popup.
If this column is anything but NULL the popup will be closed and the parent will be reloaded. Only select this column if the menu item is opened in a popup. Avoid using this feature if the opener is a newEdit as that may interrupt the user's ongoing input.
When the value is not NULL all navigation history is cleared and the user can't navigate back. This is only supported when forwarding to another menu item.
Will trigger a reload of the sidebar if the column is anything but NULL.
Cache key to be cleared. Supports wildcards.
Either a user id or '%'.
Clears all caches (e.g. access permissions) related to the specified user id.
Use '%' to clear caches for all users.
Changes the text of the Cancel button when used with ADMIN_Force, ADMIN_ConfirmWarning, ADMIN_ConfirmQuestion, ADMIN_ConfirmDelete.
Changes the text of the OK button when used with ADMIN_ErrorMessage, ADMIN_ConfirmWarning, ADMIN_ConfirmQuestion, ADMIN_ConfirmDelete, ADMIN_InfoMessage, ADMIN_SuccessMessage, ADMIN_Message, ADMIN_Force, or ADMIN_Forward. ADMIN_Force,
Allows you to validate the SQL parameters before any other SQL is run in the component. This call is only made if the SQL is a stored procedure and Validate parameters is checked.
Message explaining why the parameters are rejected.
Use this call to restrict which entries a user is allowed to view and edit, and to log which entries a user views.
Access to a menu item is normally controlled through functions and roles alone but some entities need more fine grained control. For example, a user may have access to the View Member menu item for normal members but not for members with a protected identity.
The menu items a user visits are always logged (in ADMINLogMenuItem) but for sensitive data you may need to log exactly what entries are viewed. Do the logging in this call as the common ways of viewing data (grid and InfoSQL) are not allowed to modify the database.
If you bind a scalar function instead of a stored procedure to this call then its name must end with '_GrantAccess'.
If you allow end users to administer their own templates then they will occassionally create templates with misspelled or completely unsupported containers. You can use RAISERROR prefixed with ADMIN_MESSAGE to display an error message to the user trying to use the broken template.
ALTER PROCEDURE Examples.RtfWithInvalidContainers
@Template bit = 0,
@Container sysname = NULL
AS
BEGIN
IF @Container IS NOT NULL
BEGIN
IF @Container = 'Container1'
BEGIN
SELECT 1 AS ValueInContainer;
RETURN 0;
END;
IF @Container = 'Container2'
BEGIN
SELECT 2 AS ValueInContainer;
RETURN 0;
END;
DECLARE @TemplateName varchar(300) = 'ExampleTemplate';
RAISERROR('ADMIN_MESSAGEThe template %s contains an unsupported container %s.', 16, 1, @TemplateName, @Container);
RETURN -1;
END;
Keep it simple, if the needed features are supported, create/save the template in WordPad instead of Word to get a less bloated template. This makes the documents smaller, faster to generate and less prone to errors.
When creating tables with a container tag the start container should be put in column 1 of the table, and the end container tag should be put after the table.
This should result in this order of data in the rtf file:
\trowd
\pard\intbl <##Container##>\cell\row
\pard </##Container##>
Presenting URLs as hyperlinks in RTF requires specific keywords to be used:
{\field{*\fldinst HYPERLINK "<hyperlink url>"}{\fldrslt{\ul <hyperlink text>}}}
This could be implemented with the placeholders <hyperlink url> and <hyperlink text> as replaceable tags or by replacing a tag with the entire string above (where the placeholders are already replaced).