 |
General
What is Gnostice eDocEngine?
Why do I need electronic document creation?
Why should I use Gnostice eDocEngine for electronic document creation?
Who can use eDocEngine?
Can I edit PDF or other supported document formats using eDocEngine?
What are the minimum requirements for using eDocEngine?
Can I try eDocEngine before I buy?
What are the limitations of the trial version?
Does Gnostice eDocEngine require Adobe® Acrobat™ or Microsoft® Office™ to work?
Do I need to supply any additional files with my application for eDocEngine to work?
How do I buy Gnostice eDocEngine?
Technical
How do I generate a minimal blank document with multiple pages in it?
What important document properties would I set before starting to render?
How do I render a single line of text?
How do I insert a paragraph of text with a single method call and get the text to justify?
How do I insert a table or grid with text in it?
How do I insert images to the document I'm creating?
How do I insert shapes to the document I'm creating?
How do I render a metafile to PDF?
How do I insert a watermark?
How do I use stamping feature?
How do I set Header/Footer content?
What do I need to do for eDocEngine to show all messages in my language/How do I localize?
How do I include form elements to the PDF document I'm creating?
How do I build a Table of Contents page when creating an HTML document?
How do I add bookmarks when creating a PDF document?
How do I place values in specific cells and set the format when creating an Excel document?
How do I export reports from the reporting tools Preview window?
How do I export reports programmatically?
How do I create a PDF document with different page sizes and orientations?
How do I Export RTF file to PDF/HTML and other formats?
How do I export more than one report to a single document?
How do I email the generated document?
How do I export from TMS Grid to different formats?
How do I export from DevExpress to different formats?
How do I enable multiple export formats to show in the Report Preview?
How do I save the PDF I export, to a database?
How do I save my ReportBuilder report as .raf file and export it using eDocEngine?
General
What is Gnostice eDocEngine?
Gnostice eDocEngine is a generic electronic document creation component suite for Borland® Delphi™ and Borland® C++Builder™. eDocEngine enables developers to deliver information straight from the applications they develop in over 20 popular electronic document formats. Rich content can be easily formatted to the precise look and feel required and delivered directly to users’ web browsers, sent as email attachments or saved to disk. Actionable and navigational elements can be easily added to created documents to provide interactivity and enhance the overall user experience. eDocEngine currently supports the creation of documents in PDF, RTF, HTML, XHTML, EXCEL, TEXT, CSV, Quattro Pro, LOTUS 1-2-3, DIF, SYLK, TIFF, PNG, SVG (XML based vector graphics), JPEG, GIF, BMP, EMF and WMF formats. Metafile, BMP, DIF, SYLK and Text can be directly output to the Windows® Clipboard.
Why do I need electronic document creation?
For information to be delivered electronically, it needs to be stored in a form that is accessible by means of a computer. We can call this form an electronic document. Delivering information electronically has many advantages over traditional paper-based methods. Some of these advantages are: reduced operating costs, reusability of information; it can be interactive, easily archived, accessed and searched. For today’s businesses where information needs to flow to its users in a timely and intelligent way, electronic document creation plays a vital role.
Why should I use Gnostice eDocEngine for electronic document creation?
Gnostice eDocEngine is the most comprehensive and generic electronic document creation component suite available for Borland® Delphi™ and Borland® C++Builder™. It has been built from the understanding gained from several years of research and knowing user needs. eDocEngine does all you need done with electronic document creation out of a single box and yet remains cost effective and highly optimized. eDocEngine is built on an open extensible architecture with a built-in flexible report exporting interface. It is a 100% native embedded solution with the widest support for features and formats.
Who can use eDocEngine?
If you are a software developer and you use Borland® Delphi™ or Borland® C++Builder™ to develop your software, you can use eDocEngine. eDocEngine can be embedded to enable your applications to create electronic document that can be distributed and used by the end-users of your application.
Can I edit PDF or other supported document formats using eDocEngine?
Editing of PDF or other documents is not supported in the current version of eDocEngine.
What are the minimum requirements for using eDocEngine?
Please see the System Requirements for complete details.
Can I try eDocEngine before I buy?
YES. The FREE full-feature trial versions of eDocEngine are available on the Download page.
What are the limitations of the trial version?
Trial versions have the following limitations:
• Created documents will contain no more than 5 pages of the programmed output.
• Each page of the created document will contain a message stating the document was created using the trial version of Gnostice eDocEngine and the Gnostice web site address printed at the top.
Does Gnostice eDocEngine require Adobe® Acrobat™ or Microsoft® Office™ to work?
NO. eDocEngine is a 100% native, embeddable solution that does not require any external software or DLLs.
Do I need to supply any additional files with my application for eDocEngine to work?
NO. You need to supply only your final compiled executable (EXE) application to your users. Further, the License restricts the distribution of certain files supplied with eDocEngine. Please check the License section for details.
How do I buy Gnostice eDocEngine?
You can buy eDocEngine online and get instant access to the registered version. There are several payment options available. Please check the
Order section for details.
Technical
How do I generate a minimal blank document with multiple pages in it?
The following example uses a TgtPDFEngine component to create a blank PDF document. You can use any other engine component to achieve the same for another document format.
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'C:\BlankDoc.pdf';
Page.PaperSize := A4;
//... Set any other document properties as required
BeginDoc;
// 1st Page: Render text, image and other items here
NewPage;
// 2nd Page: Render text, image and other items here
// Similarly, insert any number of pages by calling the NewPage method
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine->FileName = "C:\\BlankDoc.pdf";
gtPDFEngine->Page->PaperSize = A4;
//... set any other document properties as required
gtPDFEngine->BeginDoc();
// 1st Page: Render text, image and other items here
gtPDFEngine->NewPage();
// 2nd Page: Render text, image and other items here
// Similarly, insert any number of pages by calling the NewPage method
gtPDFEngine->EndDoc();
}
What important document properties would I set before starting to render?
FileName - specifies the document filename
MeasurementUnit - specifies the unit of measurement for subsequent properties and rendering (default is Inches)
Page.PaperSize - size of the paper like A3, A4, or even Custom
Preferences.ShowSetupDialog - Specifies whether the standard or user provided custom Setup dialog be shown for run-time end-user configuration.
How do I render a single line of text?
Delphi:
procedure TForm1.Button1Click(Sender: TObject) ;
begin
with gtPDFEngine do
begin
FileName := 'C:\BlankDoc.pdf';
Page.PaperSize := A4;
//... Set any text properties as required
BeginDoc;
//... Set any text properties as required
TextOut(3, 4, 'This is a sample line of text');
//... Change settings if necessary
TextOut (3, 6, ''This is another sample'') ;
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//... set any text properties as required
gtPDFEngine1->BeginDoc( );
gtPDFEngine->TextOut(3, 4,"This is a sample line of text");
//... change settings if necessary
gtPDFEngine->TextOut(3, 6,"This is another sample");
gtPDFEngine1->EndDoc( );
}
How do I insert a paragraph of text with a single method call and get the text to justify?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'C:\Paragraph.pdf';
Page.PaperSize := A4;
//... Set any other document properties as required
BeginDoc;
TextFormatting.BeforeSpace := 1.5;
TextFormatting.LeftIndent := 3.5;
TextFormatting.Alignment := haJustify;
//... Set left indent, right indent and any other text formatting properties
BeginPara;
TextOut ( ' This is a paragraph of text rendered using the advanced' +
' paragraph rendering feature of Gnostice eDocEngine. You can get the text' +
' in the paragraph to align any way you want just by setting the' +
' TextFormatting.Alignment property. This paragraph is justified.') ;
EndPara;
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->TextFormatting->BeforeSpace = 1.5;
gtPDFEngine1->BeginDoc( );
gtPDFEngine->TextFormatting->Alignment = haJustify;
//... set left indent, right indent and any other text formatting properties
gtPDFEngine->BeginPara( );
gtPDFEngine->TextOut("This is a paragraph of text is rendered using the advanced
paragraph rendering feature of Gnostice eDocEngine. You can get the text in the
paragraph to align any wayyou want just by setting the TextFormatting. Alignment
property. This paragraph is justified.");
gtPDFEngine->EndPara( );
gtPDFEngine1->EndDoc();
}
How do I insert a table or grid with text in it?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
var
List1: TList ;
I, J: Integer ;
begin
with gtPDFEngine do
begin
FileName := 'C:\Table.pdf';
Page.PaperSize := A4;
//... Set any other document properties as required
BeginDoc;
// Set attributes of the table being drawn using the Table Settings property
// Drawing a table of 5 columns at x=2, y=2 units
List1 := BeginTable(2, 2, 5);
// Returns a list of TgtColumns to which
//you can set specific column properties
for J:=0 to 3 do//4 Rows in the table
begin
NewRow; // Height of the row can also be specified as parameter.
for I: =0 to 4 do
begin
TextOut(I, DBGrid.Fields[I].AsString);
end;
end;
EndTable;
EndDoc;
end;
end;
C++Builder:
TList *List1;
// Set attributes of the table being drawn using the TableSettings property
gtPDFEngine->TableSettings->RowHeight = 0.5;
gtPDFEngine->TableSettings->ColumnWidth = 1;
// Drawing a table of 5 columns at x=2, y=2 units
List1 = gtPDFEngine->BeginTable(2, 2, 5);
//Returns a list of TgtColumns to which you can set specific column properties
DBGrid1->DataSource->DataSet->First( );
for(int J=0; J<=3; J++) //4 Rows in the table
{
gtPDFEngine->NewRow( ); //Height of the row can also be specified as parameter.
for(int I=0; I<=3; I++)
{
gtPDFEngine->TextOut(I, DBGrid1->Fields[I]->AsString);
}
DBGrid1->DataSource->DataSet->Next( );
}
gtPDFEngine->EndTable( );
How do I insert images to the document I'm creating?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'C:\Image.pdf';
Page.PaperSize := A4;
//... Set any other document properties as required
BeginDoc;
//... Set any image properties through ImageSettings property
// Insert image at x=1, y=2 units
DrawImage(1, 2, Image1.Picture.Graphic);
// Insert image within a specified rectangle
DrawImage(gtRect(0.5, 0.5, 4, 4), Image2.Picture.Graphic);
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->BeginDoc();
//... set any image properties through ImageSettings property
// Insert image at x=1, y=2 units
gtPDFEngine->DrawImage(1, 2, Image1->Picture->Graphic);
//Insert image within a specified rectangle
gtPDFEngine->DrawImage(gtRect(0.5, 0.5, 4, 4), Image2->Picture->Graphic);
gtPDFEngine1->EndDoc( );
}
Images that appear more than once in a document can be inserted as resources and reused to minimize output file size and creation time.
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
var
I:Integer;
begin
with gtPDFEngine do
begin
FileName := 'C:\ImageResource.pdf';
Page.PaperSize := A4;
//... Set any other document properties as required
BeginDoc;
I := AddImageAsResource(Image1.Picture.Graphic);
//... Set any image properties as required
// Draw image once
DrawImage(gtRect(0.5, 0.5, 4, 4), I);
NewPage;
// Draw image again
DrawImage (gtRect (2, 2, 6, 6), I);
EndDoc
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->BeginDoc();
int I = 0;
I = gtPDFEngine->AddImageAsResource(Image1->Picture->Graphic);
//... set any image properties as required
//Draw image once
gtPDFEngine->DrawImage(gtRect(0.5, 0.5, 4, 4), I);
gtPDFEngine->NewPage();
//Draw image again
gtPDFEngine->DrawImage(gtRect(2, 2, 6, 6), I);
gtPDFEngine1->EndDoc();
}
How do I insert shapes to the document I'm creating?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
var
LI: Integer;
gtPoints1, gtPoints2, gtPoints3: TgtPoints;
begin
with gtPDFEngine do
begin
FileName := 'C:\Shapes';
Page.PaperSize := A4;
Page.LeftMargin := 0.5;
Page.RightMargin := 0.5;
Page.BottomMargin := 0.5;
Page.TopMargin := 0.5;
//... Set any other document properties as required
BeginDoc;
Pen.Color := clBlue;
Brush.Color := clLtGray;
//... Set/Change Pen and Brush at any point.
//Last parameter specifies if the shape needs to be filled with
//the current brush
Ellipse(1.5, 2.5, 4, 3.5, False);
Pen.Style := psDashDot;
Brush.Style := bsFDiagonal;
Brush.Color := clGreen;
RoundRect(6.3, 5.6, 7.3, 7.5, 0.25, 0.15, True);
Arc(4.2, 2.2, 6, 2.6, 4.5, 6, 4, 4);
Chord(0.2, 4, 3, 5, 2.3, 3, 4.3, 5, True);
Pie(4.2, 4, 5, 5, 3, 3, 4.5, 5.2, False);
Pen.Color := clBlue;
Brush.Color := clLtGray;
Line(0.5, 5.5, 1.75, 7.7);
Rectangle(2, 5.5, 6, 7.8, True);
//gtPoints1, gtPoints2, gtPoints3 are array of TgtPoint
Polygon([gtPoint(100, 300), gtPoint(200, 600), gtPoint(400, 200), gtPoint(300, 100
)], True)
PolyLine([gtPoint(100, 300), gtPoint(200, 600), gtPoint(400, 200), gtPoint(300, 100
)]);
PolyBezier([gtPoint(100, 300), gtPoint(200, 600), gtPoint(400, 200), gtPoint(300, 100)]);
EndDoc
end;
end;
C++Builder:
gtPDFEngine1->FileName = "C:\\Shapes";
gtPDFEngine1->Page->PaperSize = A4;
gtPDFEngine1->Page->LeftMargin = 0.5;
gtPDFEngine1->Page->RightMargin = 0.5;
gtPDFEngine1->Page->BottomMargin = 0.5;
gtPDFEngine1->Page->TopMargin = 0.5;
//... Set any other document properties as required
gtPDFEngine1->BeginDoc();
gtPDFEngine1->Pen->Color = clBlue;
gtPDFEngine1->Brush->Color = clLtGray;
//... Set/Change Pen and Brush at any point.
//Last parameter specifies if the shape needs to be filled with
//the current brush
gtPDFEngine1->Ellipse(1.5, 2.5, 4, 3.5, False);
gtPDFEngine1->Pen->Style = psDashDot;
gtPDFEngine1->Brush->Style = bsFDiagonal;
gtPDFEngine1->Brush->Color = clGreen;
gtPDFEngine1->RoundRect(0.2, 2.2, 1.3, 4, 0.25, 0.15, True);
gtPDFEngine1->Arc(4.2, 2.2, 6, 2.6, 4.5, 6, 4, 4);
gtPDFEngine1->Chord(0.2, 4, 3, 5, 2.3, 3, 4.3, 5, True);
gtPDFEngine1->Pie(4.2, 4, 5, 5, 3, 3, 4.5, 5.2, False);
gtPDFEngine1->Line(0.5, 5.5, 1.75, 7.7);
gtPDFEngine1->Rectangle(2, 5.5, 6, 7.8, True);
//gtPoints1, gtPoints2, gtPoints3 are array of TgtPoint
gtPDFEngine1->Polygon(gtPoints1, 2, True);
gtPDFEngine1->PolyLine(gtPoints2,2);
gtPDFEngine1->PolyBezier(gtPoints3,2);
gtPDFEngine1->EndDoc();
How do I render a metafile to PDF?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
var
LMetafile: TMetafile;
begin
with gtPDFEngine1 do
begin
FileName := 'C:\Metafile';
BeginDoc;
if (gtPDFEngine1.EngineStatus <> esStarted) then Exit;
LMetafile := TMetafile.Create;
LMetafile.Assign(Image1.Picture.Graphic);
PlayMetafile(LMetafile);
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->FileName = "C:\\Metafile";
gtPDFEngine1->BeginDoc();
if (gtPDFEngine1->EngineStatus == esStarted)
{
TMetafile *LMetafile = new TMetafile();
LMetafile->Assign(Image1->Picture->Graphic);
gtPDFEngine1->PlayMetafile(LMetafile);
gtPDFEngine1->EndDoc();
delete LMetafile;
}
}
How do I insert a watermark?
With the following code a watermark is inserted into every page of the created document:
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'Watermark';
BeginDoc;
if (gtPDFEngine1.EngineStatus <> esStarted) then Exit;
BeginWaterMark;
with Font do
begin
Name := 'Verdana';
Size := 12;
Color := clBlue;
end;
TextFormatting.Alignment := haCenter;
TextFormatting.BeforeSpace := 2;
BeginPara;
TextOut('Gnostice Information Technologies Private Limited');
EndPara;
ImageSettings.Stretch := True;
ImageSettings.KeepAspectRatio := True;
DrawImage(2.5, 2.5, Image1.Picture.Graphic);
NewPage;
NewPage;
EndWaterMark;
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->FileName = "Watermark";
gtPDFEngine1->BeginDoc();
if (gtPDFEngine1->EngineStatus == esStarted)
{
gtPDFEngine1->BeginWaterMark();
gtPDFEngine1->Font->Name = "Verdana";
gtPDFEngine1->Font->Size = 6;
gtPDFEngine1->Pen->Width = 2;
gtPDFEngine1->TextFormatting->Alignment = haCenter;
gtPDFEngine1->TextFormatting->BeforeSpace = 2;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("Gnostice Information Technologies Private Limited");
gtPDFEngine1->EndPara();
gtPDFEngine1->ImageSettings->Stretch = True;
gtPDFEngine1->ImageSettings->KeepAspectRatio = True;
gtPDFEngine1->DrawImage(2.5, 2.5, Image1->Picture->Graphic);
gtPDFEngine1->EndWaterMark();
gtPDFEngine1->EndDoc()
}
}
How do I use stamping feature?
With the following code usage of stamping feature is demonstrated.
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'Stamping';
BeginDoc;
if (gtPDFEngine1.EngineStatus <> esStarted) then Exit;
BeginStamp;
with Font do
begin
Name := 'Verdana';
Size := 12;
Color := clBlue;
end;
TextFormatting.Alignment := haCenter;
TextFormatting.BeforeSpace := 2;
BeginPara;
TextOut('Gnostice Information Technologies Private Limited');
EndPara;
ImageSettings.Stretch := True;
ImageSettings.KeepAspectRatio := True;
DrawImage(2.5, 2.5, Image1.Picture.Graphic);
EndStamp;
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->FileName = "Stamping";
gtPDFEngine1->BeginDoc();
if (gtPDFEngine1->EngineStatus == esStarted)
{
gtPDFEngine1->BeginStamp();
gtPDFEngine1->Font->Name = "Verdana";
gtPDFEngine1->Font->Size = 6;
gtPDFEngine1->Pen->Width = 2;
gtPDFEngine1->TextFormatting->Alignment = haCenter;
gtPDFEngine1->TextFormatting->BeforeSpace = 2;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("Gnostice Information Technologies Private Limited");
gtPDFEngine1->EndPara()
gtPDFEngine1->ImageSettings->Stretch = True;
gtPDFEngine1->ImageSettings->KeepAspectRatio = True;
gtPDFEngine1->DrawImage(2.5, 2.5, Image1->Picture->Graphic);
gtPDFEngine1->EndStamp();
gtPDFEngine1->EndDoc();
}
}
How do I set Header/Footer content?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'C:\HeaderFooter';
Page.BottomMargin := 1;
Page.HeaderHeight := 1;
Page.FooterHeight := 1;
BeginDoc;
BeginHeader;
with Font do
begin
Name := 'Courier New';
Size := 10;
Color := clBlue;
end;
TextFormatting.Alignment := haRight;
TextFormatting.BeforeSpace := 1.1;
BeginPara;
TextOut('Document Header');
EndPara;
ImageSettings.Stretch := True;
ImageSettings.KeepAspectRatio := True;
DrawImage(gtRect(0.3, 0.9, 2, 2), Image1.Picture.Graphic);
EndHeader;
BeginFooter;
with Font do
begin
Name := 'Verdana';
Size := 10;
Color := clRed;
end;
TextOut(0.3, 0.9, 'Gnostice Information Technologies Private Limited');
TextOut(6, 0.9, 'www.gnostice.com');
EndFooter
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->Page->BottomMargin = 1;
gtPDFEngine1->Page->HeaderHeight = 1;
gtPDFEngine1->Page->FooterHeight = 1;
gtPDFEngine1->FileName = "C:\\HeaderFooter";
gtPDFEngine1->BeginDoc();
if (gtPDFEngine1->EngineStatus == esStarted)
{
gtPDFEngine1->Page->TopMargin = 1;
gtPDFEngine1->BeginHeader();
gtPDFEngine1->Font->Name = "Courier New";
gtPDFEngine1->Font->Size = 10;
gtPDFEngine1->Font->Color = clBlue;
gtPDFEngine1->TextFormatting->Alignment = haRight;
gtPDFEngine1->TextFormatting->BeforeSpace = 1.1;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("Document Header");
gtPDFEngine1->EndPara();
gtPDFEngine1->ImageSettings->Stretch = True;
gtPDFEngine1->ImageSettings->KeepAspectRatio = True;
gtPDFEngine1->DrawImage(gtRect(0.3, 0.9, 2, 2), Image1->Picture->Graphic);
gtPDFEngine1->EndHeader();
gtPDFEngine1->BeginFooter();
gtPDFEngine1->Font->Name = "Verdana";
gtPDFEngine1->Font->Size = 10;
gtPDFEngine1->Font->Color = clRed;
gtPDFEngine1->TextOut(0.3, 0.9, "Gnostice Information Technologies Private Limited");
gtPDFEngine1->TextOut(6, 0.9, "www.gnostice.com");
gtPDFEngine1->EndFooter();
gtPDFEngine1->EndDoc();
}
}
What do I need to do for eDocEngine to show all messages in my language/How do I localize?
To simplify localization of user messages, Gnostice eDocEngine uses resourcestrings throughout, wherever strings need to be displayed, including captions of controls on the dialogs. All these resourcestrings are located in the unit gtDocResStrs.pas, if you need to change them. Resource files will be provided in the future.
How do I include form elements to the PDF document I'm creating?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
var
PDFButton: TgtPDFFormPushButton;
PDFTextField: TgtPDFFormTextField;
begin
with gtPDFEngine1 do
begin
FileName := 'FormFields'
MeasurementUnit := muPixels;
Preferences.OpenAfterCreate := True;
BeginDoc;
//Single line text
PDFTextField := TgtPDFFormTextField.Create;
with PDFTextField do
begin
Rect := gtRect(240, 660, 565, 685);
Font.Size := 10;
Font.Color := clBlack;
FieldName := 'TestField';
BackgroundColor := clSkyBlue;
Value := 'Gnostice eDocEngine';
MaxLength := 30;
end;
AddFormItem(PDFTextField);
(* Push Button with Reset Action. *)
PDFButton := TgtPDFFormPushButton.Create;
with PDFButton do
begin
Rect := gtRect(500, 200, 620, 250);
Font.Name := 'Comic Sans MS';
Font.Size := 15;
FieldName := 'JavaScriptButton';
NormalCaption := 'Reset';
RolloverCaption := 'Rollover';
DownCaption := 'Down';
Action := pbaReset;
BackgroundColor := clBtnFace;
end;
AddFormItem(PDFButton);
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TgtPDFFormPushButton *PDFButton;
TgtPDFFormTextField *PDFTextField;
gtPDFEngine1->FileName = "FormFields";
gtPDFEngine1->MeasurementUnit = muPixels;
gtPDFEngine1->BeginDoc();
// Single line text
PDFTextField = new TgtPDFFormTextField();
PDFTextField->Rect = gtRect(240, 660, 565, 685);
PDFTextField->Font->Size = 10;
PDFTextField->Font->Color = clBlack;
PDFTextField->FieldName = "TestField";
PDFTextField->BackgroundColor = clSkyBlue;
PDFTextField->Value = "Gnostice eDocEngine";
PDFTextField->MaxLength = 30;
gtPDFEngine1->AddFormItem(PDFTextField);
// Push Button with Reset Action.
PDFButton = new TgtPDFFormPushButton()
PDFButton->Rect = gtRect(500, 200, 620, 250);
PDFButton->Font->Name = "Comic Sans MS";
PDFButton->Font->Size = 15;
PDFButton->FieldName = "JavaScriptButton";
PDFButton->NormalCaption = "Reset";
PDFButton->RolloverCaption = "Rollover";
PDFButton->DownCaption = "Down";
PDFButton->Action = pbaReset;
PDFButton->BackgroundColor = clBtnFace;
gtPDFEngine1->AddFormItem(PDFButton);
gtPDFEngine1->EndDoc();
}
How do I build a Table of Contents page when creating an HTML document?
Delphi:
A Table of Contents page can be created using the following code sample:
procedure TForm1.Button1Click(Sender: TObject);
var
LI: Integer;
begin
with gtHTMLEngine1 do
begin
FileName := 'C:\TableOfContents';
MeasurementUnit := muPixels;
Preferences.SingleFile := False;
Navigator.Enabled := True;
with TOCPageSettings.ItemFont do
begin
Name := 'Arial';
Size := 12;
Color := clBlue;
end;
with TOCPageSettings.TitleFont do
begin
Name := 'Verdana';
Size := 16
Color := clRed;
Style := [fsBold, fsUnderline];
end;
BeginDoc;
if (EngineStatus <> esStarted) then Exit;
TextFormatting.BeforeSpace := 400;
BeginPara;
TextOut('eDocEngine');
EndPara;
TextFormatting.BeforeSpace := 50;
BeginPara;
TextOut('HTML Table of Contents Demo');
EndPara;
NewPage;
TextFormatting.BeforeSpace := 120;
BeginPara;
TextOut('Introduction');
EndPara;
TextFormatting.BeforeSpace := 150;
BeginPara;
TextOut('1.1. What is eDocEngine?');
EndPara;
BeginPara;
TextOut('1.2. System Requirements')
EndPara;
BeginPara;
TextOut('1.3. Legal Notices');
EndPara;
LI := AddTOCItem('1. Introduction', -1, 2, 145);
AddTOCItem('1.1. What is eDocEngine?', LI, 2, 320);
AddTOCItem('1.2. System Requirements', LI, 2, 495);
AddTOCItem('1.3. Legal Notices', LI, 2, 670);
AddTOCItem('www.gnostice.com', -1, 'http://www.gnostice.com');
//Add more TOC items as required.
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtHTMLEngine1->FileName = "C:\\TableOfContents";
gtHTMLEngine1->MeasurementUnit = muPixels;
gtHTMLEngine1->Preferences->SingleFile = False;
gtHTMLEngine1->Navigator->Enabled = True;
gtHTMLEngine1->TOCPageSettings->ItemFont->Name = "Arial";
gtHTMLEngine1->TOCPageSettings->ItemFont->Size = 12;
gtHTMLEngine1->TOCPageSettings->ItemFont->Color = clBlue;
gtHTMLEngine1->TOCPageSettings->TitleFont->Name = "Verdana";
gtHTMLEngine1->TOCPageSettings->TitleFont->Size = 16;
gtHTMLEngine1->TOCPageSettings->TitleFont->Color = clRed;
gtHTMLEngine1->TOCPageSettings->TitleFont->Style =
TFontStyles()<< fsBold << fsUnderline;
gtHTMLEngine1->TOCPageSettings->Title = "Table of Contents";
gtHTMLEngine1->BeginDoc();
if(gtHTMLEngine1->EngineStatus == esStarted)
{
gtHTMLEngine1->TextFormatting->BeforeSpace = 400;
gtHTMLEngine1->BeginPara();
gtHTMLEngine1->TextOut("eDocEngine")
gtHTMLEngine1->EndPara();
gtHTMLEngine1->TextFormatting->BeforeSpace = 50;
gtHTMLEngine1->BeginPara();
gtHTMLEngine1->TextOut("HTML Table of Contents Demo");
gtHTMLEngine1->EndPara();
gtHTMLEngine1->NewPage();
gtHTMLEngine1->TextFormatting->BeforeSpace = 120;
gtHTMLEngine1->BeginPara();
gtHTMLEngine1->TextOut("1. Introduction");
gtHTMLEngine1->EndPara();
gtHTMLEngine1->TextFormatting->BeforeSpace = 150;
gtHTMLEngine1->BeginPara();
gtHTMLEngine1->TextOut("1.1. What is eDocEngine?");
gtHTMLEngine1->EndPara();
gtHTMLEngine1->BeginPara();
gtHTMLEngine1->TextOut("1.2. System Requirements")
gtHTMLEngine1->EndPara();
gtHTMLEngine1->BeginPara();
gtHTMLEngine1->TextOut("1.3. Legal Notices");
gtHTMLEngine1->EndPara();
int LI = gtHTMLEngine1->AddTOCItem("1. Introduction", -1, 2, 145);
gtHTMLEngine1->AddTOCItem("1.1. What is eDocEngine?", LI, 2, 320);
gtHTMLEngine1->AddTOCItem("1.2. System Requirements", LI, 2, 495);
gtHTMLEngine1->AddTOCItem("1.3. Legal Notices", LI, 2, 670);
gtHTMLEngine1->AddTOCItem("www.gnostice.com", -1, "http://www.gnostice.com");
gtHTMLEngine1->EndDoc();
}
}
How do I add bookmarks when creating a PDF document?
procedure TForm1.Button1Click(Sender: TObject);
var
LI: Integer;
begin
with gtPDFEngine1 do
begin
FileName := 'PDFBookmarks';
MeasurementUnit := muPixels;
with Preferences do
begin
ShowSetupDialog := True;
OpenAfterCreate := True;
end;
Page.PaperSize := A4;
Page.LeftMargin := 25;
Page.RightMargin := 25;
Page.BottomMargin := 25;
Page.TopMargin := 25;
BeginDoc;
if (EngineStatus <> esStarted) then Exit;
Font.Name := 'Times New Roman';
Font.Size := 20;
Font.Color := clBlue;
TextFormatting.BeforeSpace := 400;
TextFormatting.Alignment := haCenter;
BeginPara;
TextOut('eDocEngine');
EndPara;
Font.Size := 18;
TextFormatting.BeforeSpace := 50;
BeginPara;
TextOut('PDF Bookmarks Demo');
EndPara;
NewPage;
TextFormatting.BeforeSpace := 120;
TextFormatting.Alignment := haRight;
Font.Size := 18;
Font.Color := clBlack;
Font.Style := [fsBold, fsUnderline];
BeginPara;
TextOut('Introduction');
EndPara;
TextFormatting.BeforeSpace := 150;
Font.Style := [fsBold];
TextFormatting.Alignment := haLeft;
Font.Size := 16;
BeginPara;
TextOut('1.1. What is eDocEngine?');
EndPara;
BeginPara;
TextOut('1.2. System Requirements');
EndPara;
BeginPara;
TextOut('1.3. Legal Notices');
EndPara;
// Bookmarks
AddTOCItem('PDF Bookmarks Demo', -1, 1, 0);
LI := AddTOCItem('1. Introduction', -1, 2, 145);
AddTOCItem('1.1. What is eDocEngine?', LI, 2, 320);
AddTOCItem('1.2. System Requirements', LI, 2, 495);
AddTOCItem('1.3. Legal Notices', LI, 2, 670);
AddTOCItem('www.gnostice.com', -1, 'http://www.gnostice.com');
ViewerPreferences.PageMode := pmUseOutlines;
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int LI;
gtPDFEngine1->Preferences->ShowSetupDialog = True;
gtPDFEngine1->Preferences->OpenAfterCreate = True;
gtPDFEngine1->FileName = "PDFBookmarks";
gtPDFEngine1->MeasurementUnit = muPixels;
gtPDFEngine1->Page->PaperSize = A4;
gtPDFEngine1->Page->LeftMargin = 25;
gtPDFEngine1->Page->RightMargin = 25;
gtPDFEngine1->Page->BottomMargin = 25;
gtPDFEngine1->Page->TopMargin = 25;
gtPDFEngine1->BeginDoc()
if (gtPDFEngine1->EngineStatus == esStarted)
{
gtPDFEngine1->Font->Name = "Times New Roman";
gtPDFEngine1->Font->Size = 20;
gtPDFEngine1->Font->Color = clBlue;
gtPDFEngine1->TextFormatting->BeforeSpace = 400;
gtPDFEngine1->TextFormatting->Alignment = haCenter;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("eDocEngine");
gtPDFEngine1->EndPara();
gtPDFEngine1->Font->Size = 18;
gtPDFEngine1->TextFormatting->BeforeSpace = 50;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("PDF Bookmarks Demo");
gtPDFEngine1->EndPara();
gtPDFEngine1->NewPage();
gtPDFEngine1->TextFormatting->BeforeSpace = 120;
gtPDFEngine1->TextFormatting->Alignment = haRight;
gtPDFEngine1->Font->Size = 18;
gtPDFEngine1->Font->Color = clBlack;
gtPDFEngine1->Font->Style = TFontStyles() << fsBold << fsUnderlinegtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("Introduction");
gtPDFEngine1->EndPara();
gtPDFEngine1->TextFormatting->BeforeSpace = 150;
gtPDFEngine1->Font->Style = TFontStyles() << fsBold;gtPDFEngine1->TextFormatting->Alignment = haLeft;
gtPDFEngine1->Font->Size = 16;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("1.1. What is eDocEngine?");
gtPDFEngine1->EndPara();
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("1.2. System Requirements");
gtPDFEngine1->EndPara();
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("1.3. Legal Notices");
gtPDFEngine1->EndPara();
// Bookmarks
gtPDFEngine1->AddTOCItem("PDF Bookmarks Demo", -1, 1, 0);
LI = gtPDFEngine1->AddTOCItem("1. Introduction", -1, 2, 145);
gtPDFEngine1->AddTOCItem("1.1. What is eDocEngine?", LI, 2, 320);
gtPDFEngine1->AddTOCItem("1.2. System Requirements", LI, 2, 495);
gtPDFEngine1->AddTOCItem("1.3. Legal Notices", LI, 2, 670);
gtPDFEngine1->AddTOCItem("www.gnostice.com", -1, "http://www.gnostice.com");
gtPDFEngine1->ViewerPreferences->PageMode = pmUseOutlines;
gtPDFEngine1->EndDoc();
}
}
How do I place values in specific cells and set the format when creating an Excel document?
Delphi:
Excel document can be created with values in specific cells using the following sample.
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtExcelEngine1 do
begin
FileName := 'C:\Example';
BeginDoc;
TextOut(5, 5, ' Text in 5th row, 5th column', haLeft, ctString);
EndDoc;
end;
end;
C++ Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtExcelEngine1->FileName = "C:\\Example";
gtExcelEngine1->BeginDoc();
gtExcelEngine1->TextOut(5, 5, "Text in 5th row, 5th column", haLeft, ctString);
gtExcelEngine1->EndDoc();
}
How do I export reports from the reporting tools Preview window?
Please ensure that you have installed the appropriate Export Interface component first. Instructions for installing Export Interface components are given under "Installing and Re-Compiling eDocEngine Additionals".
Steps:
1) Place an ExportInterface component on the form, i.e.
gtQRExportInterface for QuickReport
gtFRExportInterface for FastReport
gtRaveExportInterface for Rave Reports
gtAceExportInterface for AceReporter
gtRBExportInterface for ReportBuilder
2) Place any Engine component on the form (For Eg. gtPDFEngine component)
3) Set the Engine property of the ExportInterface component to the Engine component(gtPDFEngine)
4) Select Save in the Preview window (or Print dialog, in case of ReportBuilder) to save the report to the required format
How do I export reports programmatically?
Please ensure that you have installed the appropriate Export Interface component first. Instructions for installing Export Interface components are given under "Installing and Re-Compiling eDocEngine Additionals".
Steps:
1) Create/Place the ExportInterface component, i.e.
gtQRExportInterface for QuickReport
gtFRExportInterface for FastReport
gtRaveExportInterface for Rave Reports
gtAceExportInterface for AceReporter
gtRBExportInterface for ReportBuilder
2) Create/Place the Engine (For Eg. gtPDFEngine1 for exporting to PDF document)
3) Set the Engine property of the ExportInterface to the created Engine (gtPDFEngine1)
4) Call one of the overloaded RenderDocument methods, with the appropriate arguments
Examples:
Exporting reports programmatically, for example to PDF document
1) Exporting QuickReport reports
Delphi:
gtPDFEngine1.FileName :=
'C:\ExportFromQR';
gtQRExportInterface1.Engine :=
gtPDFEngine1;
//Exporting a single QuickReport
gtQRExportInterface1.RenderDocument(QuickRep1, False);
//or Exporting a QRP file
gtQRExportInterface1.RenderDocument('C:\Example.QRP');
//or Exporting a CompositeReport
gtQRExportInterface1.RenderDocument(QRCompositeReport1) ;
//or Exporting a Combined Report (a list of QuickReports)
gtQRExportInterface1.RenderDocument(List1, False);
C++Builder:
gtPDFEngine1->FileName = "C:\\ExportFromQR";
gtQRExportInterface1->Engine = gtPDFEngine1;
//Exporting a single QuickReport
gtQRExportInterface1->RenderDocument(QuickRep1, False);
//or Exporting a QRP file
gtQRExportInterface1->RenderDocument("C:\\Example.QRP");
//or Exporting a CompositeReport
gtQRExportInterface1->RenderDocument(QRCompositeReport1)
;
//or Exporting a Combined Report (a list of QuickReports)
gtQRExportInterface1->RenderDocument(List1, False);
2) Exporting FastReport reports
Delphi:
gtPDFEngine1.FileName := 'C:\ExportFromFR';
gtFRExportInterface1.Engine := gtPDFEngine1;
//Exporting a FastReport
gtFRExportInterface1.RenderDocument(frReport1, False, True);
C++Builder:
gtPDFEngine1->FileName = "C:\\ExportFromFR";
gtFRExportInterface1->Engine = gtPDFEngine1;
//Exporting a FastReport
gtFRExportInterface1->RenderDocument(frReport1, False, True);
3) Exporting Rave Reports reports
Delphi:
gtPDFEngine1.FileName := 'C:\ExportFromRave';
gtRaveExportInterface1.Engine := gtPDFEngine1;
//Exporting a RaveRender Report
gtRaveExportInterface1.RenderDocument(RPComponent1, False);
C++Builder:
gtPDFEngine1->FileName = "C:\\ExportFromRave";
gtRaveExportInterface1->Engine = gtPDFEngine1;
//Exporting a RaveRender Report
gtRaveExportInterface1->RenderDocument(RPComponent1, False);
4) Exporting AceReporter reports
Delphi:
gtPDFEngine1.FileName := 'C:\ExportFromAce';
gtAceExportInterface1.Engine :=
gtPDFEngine1;
//Exporting a ACE file
gtAceExportInterface1.RenderDocument('C:\Example.ACE');
//or Exporting an Ace Report
gtAceExportInterface1.RenderDocument(SctReport1);
C++Builder:
gtPDFEngine1->FileName = "C:\\ExportFromAce";
gtAceExportInterface1->Engine = gtPDFEngine1;
//Exporting a ACE file
gtAceExportInterface1->RenderDocument("C:\\Example.ACE");
//or Exporting an Ace Report
gtAceExportInterface1->RenderDocument(SctReport1);
5) Exporting ReportBuilder reports
Delphi:
gtPDFEngine1.FileName := 'C:\ExportFromRB';
gtRBExportInterface1.Engine := gtPDFEngine1;
//Exporting an ReportBuilder Report
gtRBExportInterface1.RenderDocument(ppReport1);
How do I create a PDF document with different page sizes and orientations?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'C:\DiffPages.pdf';
Page.PaperSize := A4;
Page.Orientation := poPortrait;
Page.TopMargin := 0.5; // half inch from top edge
// *** Set any other document properties
BeginDoc;
//*** 1st Page: A4, Portrait
Font.Size := 14;
Font.Style := [fsBold];
TextFormatting.BeforeSpace := 1; // 1 inch down
TextFormatting.Alignment := haCenter;
// *** Set any other text or font properties
BeginPara;
TextOut('This text is on an A4 size page with Portrait orientation');
EndPara;
NewPage; // Start page 2
Page.PaperSize := A5;
Page.Orientation := poLandScape;
// *** 2nd Page: A5, Landscape
TextFormatting.BeforeSpace := 1; // 1 inch down
TextFormatting.Alignment := haCenter;
BeginPara;
TextOut('This text is on an A5 size page with Landscape orientation');
EndPara;
EndDoc;
end;
end;
C++Builder:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
gtPDFEngine1->FileName = "C:\\DiffPages1.pdf";
gtPDFEngine1->Preferences->OpenAfterCreate = True;
gtPDFEngine1->Page->PaperSize = A4;
gtPDFEngine1->Page->Orientation = poPortrait;
gtPDFEngine1->Page->TopMargin = 0.5; // half inch from top edge
// *** Set any other document properties
gtPDFEngine1->BeginDoc();
//*** 1st Page: A4, Portrait
gtPDFEngine1->Font->Size = 14;
gtPDFEngine1->Font->Style = TFontStyles()<<fsBold;
gtPDFEngine1->TextFormatting->BeforeSpace = 1; // 1 inch down
gtPDFEngine1->TextFormatting->Alignment = haCenter;
// *** Set any other text or font properties
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("This text is on an A4 size page with Portrait orientation";
gtPDFEngine1->EndPara();
gtPDFEngine1->NewPage(); // Start page 2
gtPDFEngine1->Page->PaperSize = A3;
gtPDFEngine1->Page->Orientation = poLandScape;
// *** 2nd Page: A5, Landscape
gtPDFEngine1->TextFormatting->BeforeSpace = 1; // 1 inch down
gtPDFEngine1->TextFormatting->Alignment = haCenter;
gtPDFEngine1->BeginPara();
gtPDFEngine1->TextOut("This text is on an A5 size page with Landscape orientation");
gtPDFEngine1->EndPara();
gtPDFEngine1->EndDoc();
}
How do I Export RTF file to PDF/HTML and other formats?
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
// Load the RTF file to RichEdit
RichEdit1.Lines.LoadFromFile('C:\input1.rtf');
with gtPDFEngine1 do
begin
FileName : = 'C:\output';
BeginDoc;
//Pass the RichEdit to the DrawRichText procedure
DrawRichText(RichEdit1, 0.5, 0.5, 6, 7, 0, -1, clYellow);
EndDoc;
end;
end;
How do I export more than one report to a single document?
Delphi:
gtPDFEngine1.FileName := 'ExportFromQR';
gtQRExportInterface1.Engine := gtPDFEngine1;
gtRaveExportInterface1.Engine := gtPDFEngine1;
gtAceExportInterface1.Engine := gtPDFEngine1;
gtQRExportInterface1.DoEndDoc := False;
// Exporting a QuickReport
gtQRExportInterface1.RenderDocument(QuickRep1, False);
gtAceExportInterface1.DoBeginDoc := False;
gtAceExportInterface1.DoEndDoc := False;
// Exporting a ACE file
gtAceExportInterface1.RenderDocument('Example.ACE');
gtRaveExportInterface1.DoBeginDoc := False;
//Exporting a RaveRender Report
gtRaveExportInterface1.RenderDocument(RPComponent1, False);
C++Builder:
gtPDFEngine1->FileName = "ExportFromQR";
gtQRExportInterface1->Engine = gtPDFEngine1;
gtRaveExportInterface1->Engine = gtPDFEngine1;
gtAceExportInterface1->Engine = gtPDFEngine1;
gtQRExportInterface1->DoEndDoc = False;
// Exporting a QuickReport
gtQRExportInterface1->RenderDocument(QuickRep1, False);
gtAceExportInterface1->DoBeginDoc = False;
gtAceExportInterface1->DoEndDoc = False;
// Exporting a ACE file
gtAceExportInterface1->RenderDocument("Example.ACE");
gtRaveExportInterface1->DoBeginDoc = False;
//Exporting a RaveRender Report
gtRaveExportInterface1->RenderDocument(RPComponent1, False);
How do I email the generated document?
Trap the OnEmail event and supply the information required.
Delphi:
procedure TForm1.Button1Click(Sender: TObject);
begin
with gtPDFEngine1 do
begin
FileName := 'EmailDemo';
BeginDoc;
TextOut(1,1,'This is a test for eMail Support');
EndDoc;
end;
end;
procedure TForm1.gtPDFEngine1EMail(Sender: TgtCustomDocumentEngine;
EMailSettings: TgtEMailSettings; var Continue, CancelEmail: Boolean);
begin
with EMailSettings do
begin
Host := 'mail.smtp.yourdomain.com'; { your mail server name }
UserID := 'userid'; { your account id }
Password := 'password';
Body.Add('<put message text here>');
FromAddress := 'userid@yourdomain.com';
Subject := '<put message subject here>';
{ Multiple recipients can be provided in a single string
separated by a semi-colon (;) or by calling the Add method
again for each recipient }
RecipientList.Add('someone@thierdomain.com');
// CCList.Add('<Carbon Copy Addresses>');
// BCCList.Add('<Blind Carbon Copy Addresses>');
end;
end;
How do I export from TMS Grid to different formats?
Please ensure that you have installed the appropriate Export Interface component first. Instructions for installing Export Interface components are given under "Installing and Re-Compiling eDocEngine Additionals".
Steps:
1) Create/Place the ExportInterface component
2) Create/Place the Engine (For Eg. gtPDFEngine1 for exporting to PDF document)
3) Set the Engine property of the ExportInterface to the created Engine (gtPDFEngine1)
4) Set the Grid property of the ExportInterface to the required TMS Grid
5) Call RenderDocument method, with the filename to be created
Delphi:
gtAdvGridExportInterface1.RenderDocument('C:\GridExport');
How do I export from DevExpress to different formats?
Please ensure that you have installed the appropriate Export Interface component first. Instructions for installing Export Interface components are given under "Installing and Re-Compiling eDocEngine Additionals".
Steps:
1) Create/Place the ExportInterface component
2) Create/Place the Engine (For Eg. gtPDFEngine1 for exporting to PDF document)
3) Set the Engine property of the ExportInterface to the created Engine (gtPDFEngine1)
4) Call RenderDocument method, with the TdxComponentPrinter component as parameter
Delphi:
gtXPressPrntInterface1.RenderDocument(dxComponentPrinter
How do I enable multiple export formats to show in the Report Preview?
This is very simple. Just as you enabled the first export format to show up in
the Preview,
1. Place another Export Interface component (the appropriate one for your reporting tool) on your form.
2. Place the Engine component for the format you want to allow exporting to.
3. Set the Engine property of the Export Interface to the Engine you just placed on the form.
For another format to appear in the Report Preview, repeat the steps above. Once
for each format you want to allow exporting to.
How do I save the PDF I export, to a database?
Firstly, it would be better to export the reports programmatically for more
control. Please refer the FAQ item on exporting reports programmatically.
So we setup the Engine component to export the report to a memory stream and the
Export Interface component to point to our Engine component. After we call the
RenderDocument method we can write the stream content to a database field.
Here's a sample:
var
LStream: TMemoryStream;
begin
with gtPDFEngine do
begin
LStream := TMemoryStream.Create;
try
Preferences.OutputToUserStream := True;
UserStream := LStream;
// Call RenderDocument on your Export Interface. For example:
gtRBExportInterface.RenderDocument(ppReport);
// LStream now has the export report in PDF format
// You can write the stream to your database field
finally
LStream.Free;
end;
end;
end;
How do I save my ReportBuilder report as .raf file and export it using eDocEngine?
Without showing the Preview dialog perform these steps:
1. Set ppReport.AllowPrintToArchive to True.
2. Set ppReport.DeviceType to ArchiveFile.
3. Set ppReport.ArchiveFileName to the name you want.
4. Call ppReport.Print on some event (ButtonClick).
When you run the program and click the button you will see the Print dialog. Click OK.
Saving from the Preview dialog:
- Set ppReport.AllowPrintToArchive to True.
- Set ppReport.DeviceType to Screen.
- Call ppReport.Print on some event (ButtonClick).
When you run the program and click the button you will see the Print Preview dialog.
- Click the Print button and select the Print to File option.
- Provide Type as 'Archive File' and a file name for Where and click OK.
You'll find your archive file (.raf) in the folder you specified to save it in.
Load it in the eDocEngine ReportBuilder Export demo and export it.
|
|