i want to create gantt chart in my project. i am using visual studio 4.0 framework and sql server r2 and i want to show the data into gantt chart without using excel sheet and directly data from sql server so is it possible?
Hi,
I would like to address your issue/ requirements from Aspose.Cells perspective.
The component is used to create, manage, render or print MS Excel file formats. It also support to create charts in MS Excel files. MS Excel (2003, 2007/2010) does not offer build-in Gantt chart type. I think you may use Stacked bar chart for your purpose to create your desired Gantt chart in MS Excel file format, see the topic for your reference:
Please see the demo on how to create Stacked bar chart for your reference, you may use Aspose.Cells APIs to create the above mentioned chart (in the article) accordingly for your needs.
Moreover, see the documents in the section on how to create or manipulate charts:
https://docs.aspose.com/cells/net/creating-charts/
Also, you may render the char to image if you want, see the document for your reference:
https://docs.aspose.com/cells/net/chart-to-image/
Thank you.
Thank You So Much For Your Feedback.
But Still I Have An Some Quires.
I Have DB(SQL Server) and my data which i want to show is like (Task Name, Start Date, End Date) into the gantt chart.
So how can i import these data from sql to excel by using aspose API?
After that how can i reflect these data into the gantt chart?
(if possible then please send me some example with source code)
i don’t want to show static data, i want to show data from sql table
also explain me aspose.task
can i achieve my gant chart goal by using aspose.task
i have saw following link:-
http://www.youtube.com/watch?v=mZ5znJP2TrQ&list=PLT-XK2IJEZr9h7bT3aBbAZ8NUsSBQiXQs
Hi,
Well, as I told your earlier in my previous reply
Aspose.Cells does not support to bind data from SQL Server database directly to chart in MS Excel, you have to first import data from database to fill data into worksheet cells (see the document here for your reference: http://www.aspose.com/docs/display/cellsnet/Importing+Data+to+Worksheets ), you got to use e.g Cells.ImportDataTable() method to import data to fill the worksheet with source data and then create the chart based on that data.
Regarding your query on Aspose.Task, my fellow colleague from the respective team will help you soon here.
Thank you.
as you told me i was tried to import data from sql database. For this i have written following code
public void aspose()
{
DataSet ds = (DataSet)ViewState[“DataSet123”];
Workbook WB = new Workbook();
Worksheet WS = WB.Worksheets[0];
WS.Cells[“A1”].PutValue(“Import Data”);
WS.Cells.ImportDataTable(ds.Tables[0], true, “A3”);
WS.AutoFitColumns();
WB.Save(“D:\excel\worksheet.xlsx”, SaveFormat.Xlsx);
}
D:\excel\worksheet.xlsx this file was created but data not displayed into this file.
please suggest me proper way to achieve my target
Hi,
Well, I suspect as you are not getting any data into Excel worksheet, the issue might be on your end due to the following:
1) Either your underlying data table is empty which has no rows at all.
2) You are not fetching data from SQL Server database table to fill the DataTable fine. There might be an issue with your own procedure or technique where you are using .NET APIs to do the task.
It is to be noted here, you have to write your own code and procedures e.g you may use ADO.NET APIs to fetch data from SQL Server database table to fill the DataTable in the DataSet. Aspose.Cells only imports data from the DataTable to fill into the worksheet cells. So, once you have data in the DataTable (from SQL Server Database table) fine, you may easily use the data importing options mentioned on the document/ topic here:
We also recommend you to kindly check if your underlying DataTable (ds.Tables[0]) has any record or not.
Thank you.