public static void Run()
{
// ExStart:LoadDataInXMLTemplate
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_AsposePdfGenerator_AdvanceFeatures();
// Creating a new Pdf object
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
// Binding the content from the named XML file
pdf.BindXML(dataDir + "Sample.xml", null);
// In a real scenario, data is usually input from Database. So, we can get data
// From a database. In this case, we are using a method that will provide us an
// Instance of DataTable. The implementation of this method is also given below.
DataTable getDT = creatDataTable();
// Accessing a table through its ID
Aspose.Pdf.Generator.Table contenTable = (Aspose.Pdf.Generator.Table)pdf.GetObjectByID("Content");
// Importing data from a DataTable and filling the table in PDF document
contenTable.ImportDataTable(getDT, false, 1, 1, 5, 4);
// Saving the results
pdf.Save(dataDir + "Sample_out.pdf");
// ExEnd:LoadDataInXMLTemplate
}
// ExStart:creatDataTable