Code duplication refers to the significant repeating of blocks, statements, or even groupings of common member declarations. It doesn't refer to the repeating of language keywords, identifiers, patterns, etc. You wouldn't be able to achieve polymorphism otherwise.
The example you provide doesn't really demonstrate the Open/Closed Principle because you haven't demonstrated how a given class's behavior can be extended without modification. The Open/Closed principle is about creating new classes each time variant behavior is desired. This can be achieved using inheritance along with the Template Method pattern (i.e. calling abstract or virtual methods in a base class which are overridden in subclasses to achieve the desired/new behavior), but it's more often demonstrated using composition using the Strategy pattern (i.e. encapsulating the variant behavior in class and passing it to the closed type to be used in determining the overall behavior achieved).
From your example, it appears you were thinking more along the lines of trying to achieving OCP through inheritance, but starting with a base report formatter to establish the interface with subtypes to indicate different types of formats for a given report is actually a good start toward showing OCP through composition. What's needed to demonstrate OCP with a composition-based approach is a class which consumes the formatters ... say a ReportWriter.
public class ReportWriter : IReportWriter
{
Write(IReportData data, IReportFormatter reportFormatter)
{
// ...
var formattedStream = reportFormatter.Format(data, stream);
// ...
}
}
Just for the sake of demonstration, I've made some assumptions about how our new formatter might behave, so don't focus too heavily on that part. The thing to focus on is that ReportWriter is open for extension by allowing new formatters to be passed in, thus affecting how reports are ultimately written, but closed for modification of code needed to achieve this new behavior (i.e. the presence of if statements, switch statements, etc. to achieve multiple ways to format).
Not only does the Open/Closed principle not cause code duplication, when achieved through the use of composition over inheritance it actually can help reduce duplication. If true code duplication occurs in the course of creating your inheritance hierarchy or strategy classes then that points to a factoring issue unrelated to the fact that it might exist in the context of you trying to achieve OCP.