Apply Note style:
Set None Fill:
Add support for creating Tables and applying tables styles (predefined ones or custom).
Add support for pivot tables.
Use the following code to create the document:
Workbook workbook = new Workbook();
Worksheet graphWorksheet = workbook.Worksheets.Add();
FloatingChartShape chartShape = new FloatingChartShape(graphWorksheet,
new CellIndex(0, 0),
new CellRange(0, 0, 0, 0), ChartType.Column)
{
Width = 500,
Height = 500,
};
graphWorksheet.Charts.Add(chartShape);
DocumentChart chart = new DocumentChart();
BarSeriesGroup barSeriesGroup = new BarSeriesGroup();
barSeriesGroup.BarDirection = BarDirection.Column;
StringChartData barCategoryData = new StringChartData(new List<string>() { "1.1", "1.2", "1.3", "1.4", "2.1", "3.1", "4.1", "4.2", "4.3" });
IEnumerable<double> percentEvidentList = new List<double>() { Math.Round((double)0.9914 * 100, 4) , Math.Round((double)0.7719 * 100, 4), Math.Round((double)1 * 100, 4) };
NumericChartData barValues = new NumericChartData(percentEvidentList);
BarSeries series = new BarSeries();
series.Categories = barCategoryData;
series.Values = barValues;
ThemableColor themableColor = ThemableColor.FromArgb(255, 125, 0, 125);
series.Fill = new SolidFill(themableColor);
series.Title = new TextTitle("FY 20");
barSeriesGroup.Series.Add(series);
chart.SeriesGroups.Add(barSeriesGroup);
ValueAxis valueAxis = new ValueAxis();
valueAxis.Min = 0;
valueAxis.Max = 100;
valueAxis.NumberFormat = "0%";
CategoryAxis categoryAxis = new CategoryAxis();
chart.PrimaryAxes = new AxisGroup(categoryAxis, valueAxis);
chart.Legend = new Legend();
chart.Legend.Position = LegendPosition.Left;
chartShape.Chart = chart;
valueAxis.NumberFormat = "0%";
string outputFilePath = "SampleFile.xlsx";
File.Delete(outputFilePath);
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream output = new FileStream(outputFilePath, FileMode.Create))
{
formatProvider.Export(workbook, output, TimeSpan.FromSeconds(10));
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });
Some fonts are not measured correctly by RadTextMeasurer.
Hello! I'd like to request that the WorksheetPrintOptions library be able to specify what duplex to print. This is regarding:
namespace Telerik.Windows.Documents.Spreadsheet.Model;
In Excel there are currently 3 options (for my printer):
Print One Sided
Print on Both Sides (pages flip on Long Edge)
Print on Both Sides (pages flip on Short Edge)
Currently at my company, in order to save paper the default for everyone's printers is Print on Both Sides (Long Edge). (Our printer, btw, is a Canon iR-ADV C3826 UFR II).
On a report I have created in Excel with Telerik, it's 3 pages but it's meant to clip onto a clipboard so it can't be double sided. So I would like the option to do this:
worksheet.WorksheetPageSetup.PrintOptions.Duplex = PrintOptionsDuplex.OneSided;
something like that. However you want to implement it is fine. Duplex may be the wrong word here. Maybe just .OneSided = true; or .BothSidesLong = true; or something.
Anyhow, I think that would be handy for my particular instance, and I think printing both sided for most people might save a lot of paper too so it might benefit other situations as well.
For now, I will instruct my clients they have to just manually switch to One Sided each time the print this report.
Thanks!
Currently, the chart is generated considering the format applied to the cells. Thus, when the decimal part is clipped, duplicated values may occur and the developer doesn't have the option to update it:
This is the code:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();
List<string> categories = new List<string> { "New", "In Progress", "Ready for Test", "Done", "Declined" };
worksheet.Cells[0, 0].SetValue("New");
worksheet.Cells[0, 1].SetValue(1);
worksheet.Cells[0, 2].SetValue(2.5);
worksheet.Cells[1, 0].SetValue("In Progress");
worksheet.Cells[1, 1].SetValue(2.8);
worksheet.Cells[1, 2].SetValue(0);
worksheet.Cells[2, 0].SetValue("Ready for Test");
worksheet.Cells[2, 1].SetValue(2);
worksheet.Cells[2, 2].SetValue(1);
worksheet.Cells[3, 0].SetValue("Done");
worksheet.Cells[3, 1].SetValue(1.4);
worksheet.Cells[3, 2].SetValue(0);
worksheet.Cells[4, 0].SetValue("Declined");
worksheet.Cells[4, 1].SetValue(3);
worksheet.Cells[4, 2].SetValue(0);
FloatingChartShape chartShape = new FloatingChartShape(worksheet, new CellIndex(5, 5), new CellRange(0, 0, 4, 2),ChartType.Column)
{
Width = 400,
Height = 250
};
worksheet.Charts.Add(chartShape);
CellSelection cellSelection = worksheet.Cells[new CellIndex(0, 1), new CellIndex(4, 2)];
CellValueFormat specialFormat = new CellValueFormat("0");
cellSelection.SetFormat(specialFormat);
string outputFilePath = "SampleFile.xlsx";
Telerik.Windows.Documents.Spreadsheet.FormatProviders.IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using (Stream output = new FileStream(outputFilePath, FileMode.Create))
{
formatProvider.Export(workbook, output);
}
Process.Start(new ProcessStartInfo() { FileName = outputFilePath, UseShellExecute = true });
The requires options are setting the major/minor units for the axis:
Error bars in charts you create can help you see margins of error and standard deviations at a glance. They can be shown on all data points or data markers in a data series as a standard error amount, a percentage, or a standard deviation. You can set your own values to display the exact error amounts you want.