/// <summary>
/// Render all data add and writes it to the specified writer
/// </summary>
/// <param name="model">
/// The model to render
/// </param>
/// <param name="os">
/// The output to write to
/// </param>
public override void RenderAllTables(IDataSetModel model, Stream os)
{
// TODO check the number of horizontal & vertical key values to determine the orientation of the page
var doc = new Document(this._pageSize, 80, 50, 30, 65);
// This doesn't seem to do anything...
doc.AddHeader(Markup.HTML_ATTR_STYLESHEET, "style/pdf.css");
doc.AddCreationDate();
doc.AddCreator("NSI .NET Client");
try
{
PdfWriter.GetInstance(doc, os);
doc.Open();
this.WriteTableModels(model, doc);
}
catch (DocumentException ex)
{
Trace.Write(ex.ToString());
LogError.Instance.OnLogErrorEvent(ex.ToString());
}
catch (DbException ex)
{
Trace.Write(ex.ToString());
LogError.Instance.OnLogErrorEvent(ex.ToString());
}
finally
{
if (doc.IsOpen())
{
doc.Close();
}
}
}