Hi,
This is Rohin and Our company has a license
. We are trying to get an image from a chart in excel sheet.
Export Image is not in correct format.
X-axis dates are in slanting position in the attached excel.
But the exported image doesn’t have date as slanting, it’s just horizontally positioned. (attached Image001)
Can you please look into it??
Code snippet:
ws = wb.Worksheets[“FQ Backtest Summary”];
ws.PageSetup.PrintArea = strCellRange;
ws.AutoFitColumns();
// Set all margins as 0
ws.PageSetup.LeftMargin = 0;
ws.PageSetup.RightMargin = 0;
ws.PageSetup.TopMargin = 0;
ws.PageSetup.BottomMargin = 0;
ws.PageSetup.PrintGridlines = true;
ws.PageSetup.FitToPagesTall = 1;
ws.PageSetup.FitToPagesWide = 1;
ws.PageSetup.ClearHeaderFooter();
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.ImageType = ImageType.Jpeg;
options.HorizontalResolution = 200;
options.VerticalResolution = 200;
options.PrintingPage = PrintingPageType.IgnoreBlank;
options.GridlineType = GridlineType.Hair;
options.OnePagePerSheet = true;
chart = ws.Charts[“Chart 1”];
Regards
–Rohin Rana
(Attachment ChartTesting.xlsx is missing)
ChartTesting.zip (1.5 MB)
image001.png (244 KB)