Charts uneditable after generation

Hi,

For this data (though the same thing happens with any data):

TherapeuticArea cnt
Alimentary & Metabolism 21
Anti-cancer 61
Anti-infectives 17
Blood 15
Cardiovascular 10
Dermatologicals 3
Genitourinary & sex hormones 3
Immunomodulators 3
Musculoskeletal 9
Nervous system 17
Respiratory 6
Sensory 1

I have got a problem with my generic chart population procedure.

It populates perfectly, but when I open the generated file, neither Edit Data or Select Data work, but I can change the axis/colours/data labels, etc!

This really is a bit of a show stopper.

I have attached the template file: Just376.pptx (can edit)

I have attached the result file:Just 376P07.pptx (can't edit)

Code here:

Public Shared Function CreateGraphAquireFormating(ByVal rstResult As DataSet, ByVal oGraph As ChartEx, ByVal bAddZeroColumn As Boolean) As String

Dim intCount As Integer
Dim scurRow As Object
Dim strReportResult As String

Dim intRow As Integer

Dim chtSeries As Integer
Dim intCategories As Integer

'Reference the Chart data
Dim chdata As ChartDataEx = oGraph.ChartData

'Reference the category collection
Dim oChartCategoryCollection As ChartCategoryExCollection = chdata.Categories

'Refence to individual category item
Dim CatValue As ChartCategoryEx

'Refence to individual series item
Dim seriesValue As ChartDataCell

Try

'Reference the underlying Excel data sheet
Dim fact As ChartDataCellFactory

chtSeries = chdata.Series.Count
intCategories = chdata.Categories.Count

Dim series As ChartSeriesEx

fact = oGraph.ChartData.ChartDataCellFactory

'Reference the data table returned by the stored procedure.
Dim extractedData As DataTable = rstResult.Tables(0)

'Count the rows in the actual data set
Dim noOfRows As Integer = extractedData.Rows.Count

If bAddZeroColumn = True Then
extractedData.Columns.Add("CmpyLabel", GetType(Integer))
For intRow = 0 To noOfRows - 1
extractedData.Rows(intRow)("CmpyLabel") = 0
Next
End If

'Check whether there is less rows in the stored procedure than in the dummy template file
Dim intDiffCat As Integer

intDiffCat = intCategories - noOfRows
Dim intCurMaxSeries As Integer

If intDiffCat > 0 Then

For intCount = 1 To intDiffCat


For intRow = 0 To chtSeries - 1
'Remove the last record from each series

fact.GetCell(0, intCount + noOfRows, intRow, Nothing)

series = chdata.Series(intRow)
intCurMaxSeries = series.Values.Count
series.Values.RemoveAt(intCurMaxSeries - 1)

Next

'Remove the data from the worksheet
fact.GetCell(0, intCount + noOfRows, chtSeries, Nothing)

'Remove the last category
oChartCategoryCollection.Remove(oChartCategoryCollection(oChartCategoryCollection.Count - 1))

Next

End If

'Count the columns
Dim noOfColumns As Integer = extractedData.Columns.Count

'Note to self - remember the 1st column is the headings which are the categories

'This offset is so we can put the columns names from the stored procedure into the datasheet.
Dim intOffSet As Integer = 1
Dim strColName As String

'Loop through the columns in the dataset, not the chart
For intCount = 0 To noOfColumns - 1

'For the series add the first item as the name
strColName = extractedData.Columns(intCount).ColumnName

'This is just the data so write into the series
If intCount > 0 Then
series = chdata.Series(intCount - 1)
series.Values(0).Value = strColName
End If

For intRow = 0 To noOfRows - 1

If intCount = 0 Then
'It's the category column so add the data to that and not the series

scurRow = extractedData.Rows(intRow)(intCount).ToString()

'Then do the actual value
If intRow < intCategories Then
CatValue = oChartCategoryCollection(intRow)
CatValue.ChartDataCell.Value = scurRow
Else
'Note no offset as it'
oChartCategoryCollection.Add(fact.GetCell(0, intRow + intOffSet, intCount, scurRow))
End If
Else

'This section adds the series points

If IsNumeric(extractedData.Rows(intRow)(intCount).ToString()) Then
scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Double)
Else
scurRow = Nothing
End If

If intRow < intCategories Then
seriesValue = series.Values(intRow)
seriesValue.Value = scurRow
Else
series.Values.Add(fact.GetCell(0, intRow + intOffSet, intCount, scurRow))
End If
End If
Next intRow
Next intCount

'Initialise Status
strReportResult = "Success"
Catch ex As Exception
strReportResult = ex.Message

End Try

Return strReportResult

End Function

Hi Andrew,


I have observed the sample code shared by you and have been able to observe the issue specified. There is an issue with ID SLIDESNET-34098 has already been created to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Howdy

Please can I have an update on where we are with this? I really need some sort of fix or work around.

Kind regards

Andy

Hi Andy,


I regret to share that the issue shared has not yet been resolved and scheduled for investigation. I have raised the issue priority and have requested our development team to investigate the issue for resolution and share ETA. I will share the feedback with you as soon as it will be shared by our development team.

Many Thanks,

Hi Mudassir,

I have been having a play myself as I thought the problem might be where I had been adding values to the series and not to the FACT so I've tweaked my code slightly, still didn't work, but here it is for reference:

Dim intCount As Integer

Dim scurRow As Object

Dim strReportResult As String

Dim intRow As Integer

Dim chtSeries As Integer

Dim intCategories As Integer

'Reference the Chart data

Dim chdata As ChartDataEx = oGraph.ChartData

'Reference the category collection

Dim oChartCategoryCollection As ChartCategoryExCollection = chdata.Categories

'Refence to individual category item

Dim CatValue As ChartCategoryEx

'Refence to individual series item

Dim seriesValue As ChartDataCell

Try

'Reference the underlying Excel data sheet

Dim fact As ChartDataCellFactory

chtSeries = chdata.Series.Count

intCategories = chdata.Categories.Count

'OK lets try deleteing all the data from all the categories and series

''Remove the last category

'While oChartCategoryCollection.Count > 0

' oChartCategoryCollection.Remove(oChartCategoryCollection(oChartCategoryCollection.Count - 1))

'End While

'For intCount = 0 To chtSeries - 1

' 'Remove the last category

' While chdata.Series(intCount).Values.Count > 0

' chdata.Series(intCount).Values.RemoveAt(chdata.Series(intCount).Values.Count - 1)

' End While

'Next

'End removing stuff

' chtSeries = chdata.Series.Count

'intCategories = chdata.Categories.Count

Dim series As ChartSeriesEx

fact = oGraph.ChartData.ChartDataCellFactory

'Let's all try clearing the Excel sheet

' fact.Clear(0)

'Reference the data table returned by the stored procedure.

Dim extractedData As DataTable = rstResult.Tables(0)

'Count the rows in the actual data set

Dim noOfRows As Integer = extractedData.Rows.Count

If bAddZeroColumn = True Then

extractedData.Columns.Add("CmpyLabel", GetType(Integer))

For intRow = 0 To noOfRows - 1

extractedData.Rows(intRow)("CmpyLabel") = 0

Next

End If

'Check whether there is less rows in the stored procedure than in the dummy template file

Dim intDiffCat As Integer

intDiffCat = intCategories - noOfRows

Dim intCurMaxSeries As Integer

If intDiffCat > 0 Then

For intCount = 1 To intDiffCat

For intRow = 0 To chtSeries - 1

'Remove the last record from each series

fact.GetCell(0, intCount + noOfRows, intRow, Nothing)

series = chdata.Series(intRow)

intCurMaxSeries = series.Values.Count

series.Values.RemoveAt(intCurMaxSeries - 1)

Next

'Remove the data from the worksheet

fact.GetCell(0, intCount + noOfRows, chtSeries, Nothing)

'Remove the last category

oChartCategoryCollection.Remove(oChartCategoryCollection(oChartCategoryCollection.Count - 1))

Next

End If

'Count the columns

Dim noOfColumns As Integer = extractedData.Columns.Count

'Note to self - remember the 1st column is the headings which are the categories

'This offset is so we can put the columns names from the stored procedure into the datasheet.

Dim intOffSet As Integer = 1

Dim strColName As String

'Loop through the columns in the dataset, not the chart

For intCount = 0 To noOfColumns - 1

'For the series add the first item as the name

strColName = extractedData.Columns(intCount).ColumnName

'This is just the data so write into the series

If intCount > 0 Then

series = chdata.Series(intCount - 1)

' series.Values.Add(fact.GetCell(0, 0, intCount, strColName))

'series.Values(0).Value = strColNam#

seriesValue = series.Values(0)

seriesValue = fact.GetCell(0, 0, intCount, strColName)

End If

For intRow = 0 To noOfRows - 1

If intCount = 0 Then

'It's the category column so add the data to that and not the series

scurRow = extractedData.Rows(intRow)(intCount).ToString()

'Then do the actual value

If intRow < intCategories Then

CatValue = oChartCategoryCollection(intRow)

'

CatValue.ChartDataCell = fact.GetCell(0, intRow + intOffSet, intCount, scurRow)

'CatValue.ChartDataCell.Value = scurRow

Else

'Note no offset as it'

oChartCategoryCollection.Add(fact.GetCell(0, intRow + intOffSet, intCount, scurRow))

End If

Else

'This section adds the series points

If IsNumeric(extractedData.Rows(intRow)(intCount).ToString()) Then

If extractedData.Columns(intCount).DataType.Name = "Int32" Then

scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Integer)

ElseIf extractedData.Columns(intCount).DataType.Name = "Decimal" Then

scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Double)

End If

Else

scurRow = Nothing

End If

If intRow < intCategories Then

seriesValue = series.Values(intRow)

seriesValue = fact.GetCell(0, intRow + intOffSet, intCount, scurRow)

'seriesValue.Value = scurRow

Else

series.Values.Add(fact.GetCell(0, intRow + intOffSet, intCount, scurRow))

End If

End If

Next intRow

Next intCount

'Initialise Status

strReportResult = "Success"

Catch ex As Exception

strReportResult = ex.Message

End Try

Return strReportResult

End Function

Sorry missed the top of the function, here it is in full:

Public Shared Function CreateGraphAquireFormating(ByVal rstResult As DataSet, ByVal oGraph As ChartEx, ByVal bAddZeroColumn As Boolean) As String

Dim intCount As Integer

Dim scurRow As Object

Dim strReportResult As String

Dim intRow As Integer

Dim chtSeries As Integer

Dim intCategories As Integer

'Reference the Chart data

Dim chdata As ChartDataEx = oGraph.ChartData

'Reference the category collection

Dim oChartCategoryCollection As ChartCategoryExCollection = chdata.Categories

'Refence to individual category item

Dim CatValue As ChartCategoryEx

'Refence to individual series item

Dim seriesValue As ChartDataCell

Try

'Reference the underlying Excel data sheet

Dim fact As ChartDataCellFactory

chtSeries = chdata.Series.Count

intCategories = chdata.Categories.Count

'OK lets try deleteing all the data from all the categories and series

''Remove the last category

'While oChartCategoryCollection.Count > 0

' oChartCategoryCollection.Remove(oChartCategoryCollection(oChartCategoryCollection.Count - 1))

'End While

'For intCount = 0 To chtSeries - 1

' 'Remove the last category

' While chdata.Series(intCount).Values.Count > 0

' chdata.Series(intCount).Values.RemoveAt(chdata.Series(intCount).Values.Count - 1)

' End While

'Next

'End removing stuff

' chtSeries = chdata.Series.Count

'intCategories = chdata.Categories.Count

Dim series As ChartSeriesEx

fact = oGraph.ChartData.ChartDataCellFactory

'Let's all try clearing the Excel sheet

' fact.Clear(0)

'Reference the data table returned by the stored procedure.

Dim extractedData As DataTable = rstResult.Tables(0)

'Count the rows in the actual data set

Dim noOfRows As Integer = extractedData.Rows.Count

If bAddZeroColumn = True Then

extractedData.Columns.Add("CmpyLabel", GetType(Integer))

For intRow = 0 To noOfRows - 1

extractedData.Rows(intRow)("CmpyLabel") = 0

Next

End If

'Check whether there is less rows in the stored procedure than in the dummy template file

Dim intDiffCat As Integer

intDiffCat = intCategories - noOfRows

Dim intCurMaxSeries As Integer

If intDiffCat > 0 Then

For intCount = 1 To intDiffCat

For intRow = 0 To chtSeries - 1

'Remove the last record from each series

fact.GetCell(0, intCount + noOfRows, intRow, Nothing)

series = chdata.Series(intRow)

intCurMaxSeries = series.Values.Count

series.Values.RemoveAt(intCurMaxSeries - 1)

Next

'Remove the data from the worksheet

fact.GetCell(0, intCount + noOfRows, chtSeries, Nothing)

'Remove the last category

oChartCategoryCollection.Remove(oChartCategoryCollection(oChartCategoryCollection.Count - 1))

Next

End If

'Count the columns

Dim noOfColumns As Integer = extractedData.Columns.Count

'Note to self - remember the 1st column is the headings which are the categories

'This offset is so we can put the columns names from the stored procedure into the datasheet.

Dim intOffSet As Integer = 1

Dim strColName As String

'Loop through the columns in the dataset, not the chart

For intCount = 0 To noOfColumns - 1

'For the series add the first item as the name

strColName = extractedData.Columns(intCount).ColumnName

'This is just the data so write into the series

If intCount > 0 Then

series = chdata.Series(intCount - 1)

' series.Values.Add(fact.GetCell(0, 0, intCount, strColName))

'series.Values(0).Value = strColNam#

seriesValue = series.Values(0)

seriesValue = fact.GetCell(0, 0, intCount, strColName)

End If

For intRow = 0 To noOfRows - 1

If intCount = 0 Then

'It's the category column so add the data to that and not the series

scurRow = extractedData.Rows(intRow)(intCount).ToString()

'Then do the actual value

If intRow < intCategories Then

CatValue = oChartCategoryCollection(intRow)

'

CatValue.ChartDataCell = fact.GetCell(0, intRow + intOffSet, intCount, scurRow)

'CatValue.ChartDataCell.Value = scurRow

Else

'Note no offset as it'

oChartCategoryCollection.Add(fact.GetCell(0, intRow + intOffSet, intCount, scurRow))

End If

Else

'This section adds the series points

If IsNumeric(extractedData.Rows(intRow)(intCount).ToString()) Then

If extractedData.Columns(intCount).DataType.Name = "Int32" Then

scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Integer)

ElseIf extractedData.Columns(intCount).DataType.Name = "Decimal" Then

scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Double)

End If

Else

scurRow = Nothing

End If

If intRow < intCategories Then

seriesValue = series.Values(intRow)

seriesValue = fact.GetCell(0, intRow + intOffSet, intCount, scurRow)

'seriesValue.Value = scurRow

Else

series.Values.Add(fact.GetCell(0, intRow + intOffSet, intCount, scurRow))

End If

End If

Next intRow

Next intCount

'Initialise Status

strReportResult = "Success"

Catch ex As Exception

strReportResult = ex.Message

End Try

Return strReportResult

End Function

Hi Andy,


Thank you for your further investigation on your end. I like to share that the issue has been assigned to concerned developer and will hopefully soon be scheduled for investigation and later on for resolution. We will share the updates with you as soon as the issue will be resolved.

We are sorry for your inconvenience,

Hi Mudassir,

I have continue to have a go at finding the problem, but have still failed to do so. What I have done, which might be useful to your developer is create a simple version of my function, it just dumps the data into the excel sheet behind the chart. It generates the slide correctly, but is still not editable, so the probelem remains:

Public Shared Function CreateGraphSimple(ByVal rstResult As DataSet, ByVal oGraph As ChartEx, ByVal bAddZeroColumn As Boolean) As String

Dim intCount As Integer

Dim scurRow As Object

Dim strReportResult As String

Dim intRow As Integer

Dim chtSeries As Integer

Dim intCategories As Integer

'Reference the Chart data

Dim chdata As ChartDataEx = oGraph.ChartData

Try

'Reference the underlying Excel data sheet

Dim fact As ChartDataCellFactory

fact = oGraph.ChartData.ChartDataCellFactory

'Reference the data table returned by the stored procedure.

Dim extractedData As DataTable = rstResult.Tables(0)

'Count the rows in the actual data set

Dim noOfRows As Integer = extractedData.Rows.Count

'Count the columns

Dim noOfColumns As Integer = extractedData.Columns.Count

'This offset is so we can put the columns names from the stored procedure into the datasheet.

Dim intOffSet As Integer = 1

Dim strColName As String

'Loop through the columns in the dataset, not the chart

For intCount = 0 To noOfColumns - 1

For intRow = 0 To noOfRows - 1

If IsNumeric(extractedData.Rows(intRow)(intCount).ToString()) Then

If extractedData.Columns(intCount).DataType.Name = "Int32" Then

scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Integer)

ElseIf extractedData.Columns(intCount).DataType.Name = "Decimal" Then

scurRow = CType(extractedData.Rows(intRow)(intCount).ToString(), Double)

End If

Else

scurRow = extractedData.Rows(intRow)(intCount).ToString()

End If

fact.GetCell(0, intRow + intOffSet, intCount).Value = scurRow

Next intRow

Next intCount

'Initialise Status

strReportResult = "Success"

Catch ex As Exception

strReportResult = ex.Message

End Try

Return strReportResult

End Function

Hi Andy,


Thanks for sharing the further details. Our development team is investigating the issue on their end and we will share the feedback with you as soon as the issue will be resolved.

We are sorry for your inconvenience,

Howdy,

Has there been any progress with this? I have just received my regular "You are 20 days into a 30-day Aspose temp license" from your sales guys and it's really frustrating that I can't move this forwar; especially as there will be some much interest in the product I am working within our company.

Kind regards

Andy

Hi Andy,


I like to share that the issue shared has been resolved in Aspose.Slides for .NET 7.4.0 which shared by early next month. We will share the product notification with you as soon as the release will be made available online. As far as temporary license issue is concerned, you may contact our sales team in this and share that your issue fix will be included in next release and he may then help you further on the basis of that. I am always here to help you with technical inquiries related to Aspose.Slides.

Many Thanks,

Hi Mudassir,

That's great news! Yes please let me know as soon as I can download it so I can complete my development. In the meantime I'll email your sales people.

Kind regards

Andy

Hi,

I'm hoping to have some time available to complete my work on this, any idea when the new release will be available for download?

Kind regards

Andy

Hi Andy,


I like to share that the Aspose.Slides for .NET will be available for release during first week of may 2012. We will share the notification with you as soon as the product release will be shared online.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-34098) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(3)