Hello,
I’m creating a table using document builder. This works fine… Now I want to set a left indent for the table because my document uses a left margin. The table gets generated nearer to the document border than other content.
Thats how I create the table:
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToMergeField(“ServiceCostsAlt”);
builder.Font.Name = “Arial”;
builder.Font.Size = 10;
BorderCollection borders = builder.CellFormat.Borders;
borders.LineStyle = LineStyle.Single;
borders.LineWidth = 1;
Table objTable = builder.StartTable();
for (int i = 1; i <= iPeriod; i++)
{
string strPID = objParameterServiceCosts.PID.Replace(“n”, i.ToString());
string strCaption = objParameterServiceCosts.GetTranslation().Replace("#", i.ToString());
double dValue = (double)Calculator.getDynamicCalculationParameterValue(objCalculation, strPID, false);
Cell objCell1 = builder.InsertCell();
objCell1.CellFormat.Width = 250;
builder.Write(strCaption);
Cell objCell2 = builder.InsertCell();
objCell2.CellFormat.Width = 100;
builder.Write(dValue.ToString());
builder.EndRow();
}
builder.EndTable();