Save chart as image in word

Hi Team, we are working on generating word report by linq reporting engine. We have situation to insert the chart in document. But that chart should be insert as image. Is there any possibility for this scenario?

@manojdesai272 If it is required to replace DML charts in the generated report with images, you can achieve this by postprocessing the generated the report. For example, see the following code that converts charts to images:

Document doc = new Document(@"C:\Temp\in.docx");

// Get chart shapes
List<Shape> charts = doc.GetChildNodes(NodeType.Shape, true).Cast<Shape>()
    .Where(s => s.Chart != null).ToList();

// Convert each chart to image and replace the original shapes.
foreach (Shape chart in charts)
{
    using (MemoryStream chartImage = new MemoryStream())
    {
        // Render chart to image.
        chart.GetShapeRenderer().Save(chartImage, new ImageSaveOptions(SaveFormat.Png));

        // Create a shape with the image and place it next to the original chart shape.
        Shape imgShape = new Shape(doc, ShapeType.Image);
        imgShape.ImageData.SetImage(chartImage);
        imgShape.Width = chart.Width;
        imgShape.Height = chart.Height;
        imgShape.WrapType = chart.WrapType;
        imgShape.HorizontalAlignment = chart.HorizontalAlignment;
        imgShape.VerticalAlignment = chart.VerticalAlignment;
        imgShape.RelativeHorizontalPosition = chart.RelativeHorizontalPosition;
        imgShape.RelativeVerticalPosition = chart.RelativeVerticalPosition;
        imgShape.Left = chart.Left;
        imgShape.Top = chart.Top;

        chart.ParentNode.InsertAfter(imgShape, chart);
        // Remove chart 
        chart.Remove();
    }
}

doc.Save(@"C:\Temp\out.docx");

@alexey.noskov Thanks for the information. It worked. Is there any way to control axes of the chart (like minimum/maximum value in axes) in linq reporting?
For example, we need to change minimum and maximum value on x-axis/y-axis based on value passes

@manojdesai272

I am afraid, there is no way to set minimum and maximum values of a chart axis using LINQ Reporting Engine. The recommended way is setting them to auto within a template, so they are aligned depending on chart series values automatically.