Sometimes 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 a problem.


SharpShooter Reports provides a handy API to interact with a report. There are many useful samples which come with the product package.

The following sample: Reports\Samples\SharpShooter Reports\CSharp\Dynamic demonstrates how to create a report dynamically from code.


And now let’s see how to edit an existing report.

The following sample will be very helpful in this case: 

Here, a 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           




After that, the whole object model of a report is available.


The following code adds a text box:


var zipBox = new PerpetuumSoft.Reporting.DOM.TextBox();

zipBox.Name = "zipBox";

zipBox.Location = new Vector(0.2f, 0.2f).ConvertUnits(Unit.Centimeter,

zipBox.Size = new Vector(3.5f, 0.5f).ConvertUnits(Unit.Centimeter,

zipBox.DataBindings.Add(new ReportDataBinding("Value", "\"ZIPCODE\""));

zipBox.TextAlign = System.Drawing.ContentAlignment.TopLeft;

zipBox.CanGrow = zipBox.CanShrink = zipBox.GrowToBottom = true;


Now we 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.

outputSlot = new FileReportSlot();

outputSlot.FilePath = "output.rst";




Now you can create handlers for any number of reports, keep the legacy and make changes to them.

Add Feedback