I am using Aspose.Cells version 7.1.1.0 and am having a few problems with the pivot and another problem with a textbox. I have attached the template I am using, the file output, and the code is below.
Here are the problems:
1. After I run this and refresh the pivot the formatting is off (first line is highlighted grey).
2. The headers are also not showing up in the pivot.
3. The filter drop downs in the pivot do not show “Zone 2” or “Region 2” as they should.
4. When I am update the Textbox with the date, is displaying as “DaAe:”.
If you refresh the pivot then problems 1-3 are fixed. Any suggestions?
workbook = New Workbook(System.IO.Directory.GetCurrentDirectory() + “” & TemplateName)
workbook.FileFormat() = Aspose.Cells.FileFormatType.Xlsm
Dim worksheet As Worksheet = workbook.Worksheets(“Pricing Report”)
Dim TextBox As Aspose.Cells.Drawing.TextBox = worksheet.TextBoxes(0)
TextBox.Font.Size = 12
TextBox.Font.IsBold = True
Dim sDate As String = DateTime.Now.ToString(“Date: MM/dd/yyyy”).ToString()
TextBox.Text = sDate
Dim range As Range = workbook.Worksheets(“Data”).Cells.CreateRange(0, 0, 8, 27)
range.Name = "DataSource"
Dim pivotable As Pivot.PivotTable
pivotable = workbook.Worksheets(“Pricing Report”).PivotTables(“PvtPricing”)
pivotable.RefreshData()
pivotable.CalculateData()
workbook.Save(System.IO.Directory.GetCurrentDirectory() + “” + SaveName, Aspose.Cells.SaveFormat.Xlsm)