We have been trying to create a chart on a webworksheet but with no success. We managed to do this on a normal Workbook - Worksheet but since we use a web platform for our applications we need this to work on the WebGrid for reports.
We have supported to import chart and shape images from excel files in Aspose.Cells.GridWeb v22.214.171.1242.
Please update the dll and acwmain.js files.
- Generate a Chart from the code behind and put it onto a Webgrid next to the data.
- Or even better have a Chart generated dynamically from existing data on the Webgrid.
You are right, both should work fine.
Did you see our offlines demos of GridWeb? You can run them in Visual Studio 2005 or 2008 or 2010, whatever is available to you.
I will highly recommend you to use our offline demos, it will help you increase your knowledge and skill of Aspose.Cells gridweb manifold.
Please visit this link and download: Aspose.Cells.GridWeb C# Demos
Please do readme.txt file before running the demos.
Any updates on the above please?
Sorry for late update. We will look into this issue and provide you a code example. We need more time and we will get back to you asap.
Thanks for your patience.
Please see the code below and the sample. It first creates a chart using Aspose.Cells for .NET then it imports the output excel file into GridWeb using Aspose.Cells for GridWeb
Please see the screenshot. For your more help, I have attached the complete project.
//Create a workbook with a chart using Aspose.Cells
//and then import it into GridWeb using Aspose.Cells.GridWeb
Workbook workbook = new Workbook();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Aspose.Cells.Worksheet worksheet = workbook.Worksheets;
//Adding a sample value to “A1” cell
//Adding a sample value to “A2” cell
//Adding a sample value to “A3” cell
//Adding a sample value to “B1” cell
//Adding a sample value to “B2” cell
//Adding a sample value to “B3” cell
//Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(Aspose.Cells.Charts.ChartType.Column3D, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
Aspose.Cells.Charts.Chart chart = worksheet.Charts[chartIndex];
//Adding SeriesCollection (chart data source) to the chart ranging from “A1” cell to “B3”
//Save the workbook into memory stream
MemoryStream ms = new MemoryStream();
ms.Position = 0;
//Import the excel file with chart into gridweb
Thank you for your help, unfortunately it seems that it is still not working.
Thanks for your feedback. We will look into your project soon and update you asap.
Please don’t forget to update the dll and acwmain.js files in the zipped archive too.
Please copy “acw_client” folder with files (according to Aspose.Cells.GridWeb v126.96.36.1992) into your project, and add these configurations into appSettings section in your web.config:
<add key=“aspose.cells.gridweb.acw_client_path” value="~/acw_client/"/>
<add key=“aspose.cells.gridweb.force_script_path” value=“true”/>
<add key=“aspose.cells.gridweb.forcepath” value=“true”/>
Your project works fine now.