Search results

Print and Export

Print

The rendered range navigator can be printed directly from the browser by calling the public method print. The ID of the range navigator div element must be passed as argument to that method.

print.razor
@using Syncfusion.EJ2.Blazor.Charts

<EjsRangeNavigator @ref="RangeObj" Value="@Value" ValueType="Syncfusion.EJ2.Blazor.Charts.RangeValueType.DateTime">
    <RangeNavigatorSeriesCollection>
        <RangeNavigatorSeries DataSource="@StockDetails" XName="Date" Type="RangeNavigatorType.StepLine" YName="Close" Width="2"></RangeNavigatorSeries>
    </RangeNavigatorSeriesCollection>
</EjsRangeNavigator>

<Syncfusion.EJ2.Blazor.Buttons.EjsButton Id="button" Content="Print" @Onclick="@Click" IsPrimary="true" CssClass="e-flat"></Syncfusion.EJ2.Blazor.Buttons.EjsButton>

@code {

    EjsRangeNavigator RangeObj;

    public DateTime[] Value = new DateTime[] { new DateTime(2006, 01, 01), new DateTime(2008, 01, 01) };

    private void Click(UIMouseEventArgs args)
    {
        RangeObj.Print();
    }
    
    public class Data
    {
        public DateTime Date;
        public double Close;
    }

    public List<Data> StockDetails = new List<Data> 
    {
        new Data { Date = new DateTime(2005, 01, 01), Close = 21 },
        new Data { Date = new DateTime(2006, 01, 01), Close= 24},
        new Data { Date = new DateTime(2007, 01, 01), Close = 36 },
        new Data { Date = new DateTime(2008, 01, 01), Close = 38},
        new Data { Date = new DateTime(2009, 01, 01), Close = 54 },
        new Data { Date = new DateTime(2010, 01, 01), Close = 57 },
        new Data { Date = new DateTime(2011, 01, 01), Close = 70 }
    };
}

Export

The rendered range navigator can be exported to JPEG, PNG, SVG, or PDF format using the export method in the range navigator. The input parameters for this method are Export Type for format and fileName for result.

Contents
Contents