Hi,
Thanks for providing us the template files and sharing sample code.
After an initial test as I have tested your sample code with your template Excel files. I have found the issue regarding font size which has changed a bit after the merging process is done. The font size in the first worksheet is fine but in the second worksheet, it extends the font size a bit as the you mentioned. I have logged a ticket with an id “CELLSNET-41842” for your issue. We will look into your issue soon.
Once we have any update on it, we will let you know here.
Thank you.
Please make this post public now.
Hi,
Could you click on “Make Public” command button in the first post in the thread:
Thank you.
i cannot see any button to Make public.
see attached screenshot.
please make this public and give me access to make it public for future.
Hi,
Well, it looks like rights issue, you have not sufficient rights to do that.
Anyways, another way is to uncheck “Keep this post private” checkbox (at bottom) when replying to this post if it works for your needs. Also, I cannot do this as you are the owner of your thread.
Thank you.
on reply also “Keep this post private” is disabled for me.
Hi,
I have asked the concerned authorities to look into your issue. Hopefully, they will evaluate your issue and get back to you soon to make your thread public again.
Thank you.
Hi,
We have made your thread public now for your requirements.
Thank you.
Hi,
Thanks for your posting and using Aspose.Cells for .NET.
We have fixed the issue.
Please download and try this fix: Aspose.Cells for .NET v7.5.1.2 and let us know your feedback.
Still the issue is partially solved.
If you review the page 2 of attached pdf then 4th row MISCELLANEOUS is not supposed to be Bold but coming bold in pdf. Which is fine in excel output.
Hi,
Thanks for the template files and the screen shot.
You are right, the issue is still there regarding bold font in the second worksheet of your attached template file when rendering to PDF file format. The original 4th row in the pivot table (in the second sheet of the template Excel file) is not bold where as it is rendered as bold in the output PDF (second page). I have reopened your issue “CELLSNET-41842” again. Our concerned developer will look into it soon.
Once we have any update on it, we will let you know here.
Thank you.
Hi,
Thanks for using Aspose.Cells.
Please add this sample code before saving:
C#
for (int i = 0; i < book.Worksheets.Count; i++)
{
Worksheet sheet = book.Worksheets[i];
if (sheet.PivotTables != null && sheet.PivotTables.Count > 0)
{
for (int j = 0; j < sheet.PivotTables.Count; j++)
{
PivotTable table = sheet.PivotTables[j];
table.RefreshData();
table.CalculateData();
}
}
}
This all i have done and have in my code but still we are having this issue so please fix it from your side.
my code snapshot below
Dim pivot As Aspose.Cells.Pivot.PivotTable
Dim pchart As Aspose.Cells.Charts.Chart
''refreshing pivot tables and charts from all worksheets
For Each ws As Aspose.Cells.Worksheet In myWorkBook.Workbook.Worksheets
For Each pivot In ws.PivotTables
pivot.PreserveFormatting = True
pivot.RefreshData()
pivot.CalculateData()
Next For Each pchart In ws.Charts
pchart.RefreshPivotData()
Next
Next
Hi,
It works fine and I don’t find the issue regarding bold font in the second worksheet of your attached template file when rendering to PDF file format.
Here is my code and please find attached the output PDF file, all the pivot tables are rendered fine.
Sample code:
[VB]
Dim wb As New Workbook(“e:\test2\PIVOT_78_0.xlsx”)
For i As Integer = 0 To wb.Worksheets.Count - 1
Dim sheet As Worksheet = wb.Worksheets(i)
If sheet.PivotTables IsNot Nothing AndAlso sheet.PivotTables.Count > 0 Then
For j As Integer = 0 To sheet.PivotTables.Count - 1
Dim table As PivotTable = sheet.PivotTables(j)
table.RefreshData()
table.CalculateData()
Next j
End If
Next i
wb.Save(“e:\test2\PIVOT_78_0.pdf”)
If you still find the issue, kindly highlight the problematic areas in my attached PDF file comparing with the original file’s sheet(s), we will check it soon.
Thank you.
HI Amzad,
still i am getting issue with your suggested dll.
See attaached pdf and the screenshot.
If you look at the row of MISCELLANEOUS then in your output its not Bold which is correct but in my output its coming Bold which is the issue.
let me know if you need more information about it.
Below is the code which i have used.
Dim wb As New Aspose.Cells.Workbook(“C:\Reports70\temp\PIVOT_78_0.xlsx”)
Dim myWorkBook As Aspose.Cells.WorkbookDesigner
Try
Dim pivot As Aspose.Cells.Pivot.PivotTable
Dim pchart As Aspose.Cells.Charts.Chart
''refreshing pivot tables and charts from all worksheets
For Each ws As Aspose.Cells.Worksheet In myWorkBook.Workbook.Worksheets
For Each pivot In ws.PivotTables
pivot.PreserveFormatting = True
pivot.RefreshData()
pivot.CalculateData()
Next
For Each pchart In ws.Charts
pchart.RefreshPivotData()
Next
ws.AutoFitRows(True)
Next
Catch ex As Exception
End Try
wb.Save(“C:\Reports70\temp\PIVOT_78_0.pdf”)
Hi,
There is an error in your code. Please see the updated code here, it works fine. Please see the lines in bold.
Sample code:
Dim wb As New Aspose.Cells.Workbook(“e:\test2\PIVOT_78_0.xlsx”)
Dim myWorkBook As New Aspose.Cells.WorkbookDesigner()
myWorkBook.Workbook = wb
Try
''refreshing pivot tables and charts from all worksheets
For Each ws As Aspose.Cells.Worksheet In myWorkBook.Workbook.Worksheets
For Each pivot As Aspose.Cells.Pivot.PivotTable In ws.PivotTables
pivot.PreserveFormatting = True
pivot.RefreshData()
pivot.CalculateData()
Next pivot
For Each pchart As Aspose.Cells.Charts.Chart In ws.Charts
pchart.RefreshPivotData()
Next pchart
ws.AutoFitRows(True)
Next ws
Catch ex As Exception
End Try
wb.Save(“e:\test2\outPIVOT_78_0.pdf”)
Hi Amjad,
no this issue is still not resolved.see attached the excel which i converted into pdf. but still getting percentage with big values.
Hi,
Thanks for providing us your template file and output PDF file.
After an initial test, using my previous code, I found the issue as you mentioned with your template file, the percentage values in the PivotTable are wrong and not formatted correctly. I have logged a ticket with an id “CELLSNET-42145” for your issue. We will look into your issue soon.
Once we have any update on it, we will let you know here.
Thank you.
@rajsingh85007,
Please try our latest version/fix: Aspose.Cells for .NET v21.6.3 (attached)
Aspose.Cells21.6.3 For .Net2_AuthenticodeSigned.Zip (5.5 MB)
Aspose.Cells21.6.3 For .Net4.0.Zip (5.5 MB)
Aspose.Cells21.6.3 For .NetStandard20.Zip (5.5 MB)
Your issue should be fixed in it.
Let us know your feedback.