you may face a necessity to edit many reports or templates to add some minor
changes there. When the quantity of these reports is over dozens, this becomes
Reports provides a handy API to interact with a report. There are many useful
samples which come with the product package.
following sample: Reports\Samples\SharpShooter Reports\CSharp\Dynamic demonstrates
how to create a report dynamically from code.
let’s see how to edit an existing report.
following sample will be very helpful in this case:
textbox positioned 2mm from the top and 2mm from the left is added to the
existing report and saved.
To use API, it is needed to build a report.
Here, it is not necessary to draw it, but it is necessary to call
that, the whole object model of a report is available.
following code adds a text box:
zipBox = new PerpetuumSoft.Reporting.DOM.TextBox();
= new Vector(0.2f,
= new Vector(3.5f,
zipBox.DataBindings.Add(new ReportDataBinding("Value", "\"ZIPCODE\""));
= zipBox.CanShrink = zipBox.GrowToBottom = true;
need to save the changes. Since we don’t want to re-write the original report,
we save it to a separate file. To do this, it is needed to create a temporary
slot and save changes to it.
FileReportSlot outputSlot = new
Now you can create handlers for any number of
reports, keep the legacy and make changes to them.