Hi Babar,
Yes I am using the .NET version of this product. I just checked with the latest version of Aspose.Cells. Issue is still there. I checked fonts are installed properly in the server and DPI settings is also set to 100%.
Following the source code -
Workbook _workbook = new Workbook();
Worksheet _worksheet = _workbook.Worksheets[0];
_worksheet.Name = "Branch Archive Log";
_worksheet.IsGridlinesVisible = false;
Cells cells = _worksheet.Cells;
Style reportHeaderStyle = AsposeHelper.GetReportHeaderStyle();
Style reportTitleStyle = AsposeHelper.GetReportTitleStyle();
Style tableHeaderStyle = AsposeHelper.GetTableHeaderStyle();
Style tableBodyStyle = AsposeHelper.GetTableBodyStyle();
cells.Rows[0].Height = 75;
cells.Merge(1, 0, 1, 7);
cells[1, 0].SetStyle(reportHeaderStyle);
cells[1, 0].HtmlString = "Change Log for Archiving";
_worksheet.AutoFitRow(1);
cells.Rows[1].Height = 20;
cells.Merge(2, 0, 1, 6);
cells[4, 0].SetStyle(reportTitleStyle);
cells[4, 0].HtmlString = "Start Date " + startDate.ToShortDateString() + " End Date " + endDate.ToShortDateString();
_worksheet.AutoFitRow(4);
cells.Rows[4].Height = 20;
cells[7, 0].SetStyle(tableHeaderStyle);
cells[7, 0].PutValue("POD Branch Id");
cells.Columns[0].Width = 20;
cells[7, 1].SetStyle(tableHeaderStyle);
cells[7, 1].PutValue("Change In");
cells.Columns[1].Width = 10;
cells[7, 2].SetStyle(tableHeaderStyle);
cells[7, 2].PutValue("Operation");
cells.Columns[2].Width = 10;
cells[7, 3].SetStyle(tableHeaderStyle);
cells[7, 3].PutValue("Property Name");
cells.Columns[3].Width = 15;
cells[7, 4].SetStyle(tableHeaderStyle);
cells[7, 4].PutValue("Old Value");
cells.Columns[4].Width = 24;
cells[7, 5].SetStyle(tableHeaderStyle);
cells[7, 5].PutValue("New Value");
cells.Columns[5].Width = 24;
cells[7, 6].SetStyle(tableHeaderStyle);
cells[7, 6].PutValue("Change Date");
cells.Columns[6].Width = 17;
_worksheet.AutoFitRow(7);
if (logs != null)
{
int rowCount = 8;
for (int count = 0; count < logs.Count; count++)
{
if (rowCount == 8)
{
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
cells[rowCount, 0].SetStyle(tableBodyStyle);
cells[rowCount, 0].HtmlString = string.IsNullOrEmpty(logs[count].BranchName) ? "" + logs[count].BranchId.ToString() + "" : "" + logs[count].BranchId.ToString() + "
(" + logs[count].BranchName + ")";
cells[rowCount, 1].SetStyle(tableBodyStyle);
cells[rowCount, 1].PutValue(logs[count].TableName);
}
else
{
if (logs[count - 1].BranchId != logs[count].BranchId)
{
cells.Rows[rowCount].Height = 20;
rowCount = rowCount + 1;
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
cells[rowCount, 0].SetStyle(tableBodyStyle);
cells[rowCount, 0].HtmlString = string.IsNullOrEmpty(logs[count].BranchName) ? "" + logs[count].BranchId.ToString() + "" : "" + logs[count].BranchId.ToString() + "
(" + logs[count].BranchName + ")";
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
cells[rowCount, 1].SetStyle(tableBodyStyle);
cells[rowCount, 1].PutValue(logs[count].TableName);
}
else
{
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.None;
cells[rowCount, 0].SetStyle(tableBodyStyle);
if (logs[count - 1].TableName != logs[count].TableName)
{
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
cells[rowCount, 1].SetStyle(tableBodyStyle);
cells[rowCount, 1].PutValue(logs[count].TableName);
}
else
{
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.None;
cells[rowCount, 0].SetStyle(tableBodyStyle);
}
}
}
tableBodyStyle.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
cells[rowCount, 2].SetStyle(tableBodyStyle);
cells[rowCount, 2].PutValue(logs[count].Operation);
cells[rowCount, 3].SetStyle(tableBodyStyle);
cells[rowCount, 3].PutValue(logs[count].ColumnName);
cells[rowCount, 4].SetStyle(tableBodyStyle);
cells[rowCount, 4].PutValue(AsposeHelper.SplitAndMerge(logs[count].OldValue, 24));
cells[rowCount, 5].SetStyle(tableBodyStyle);
cells[rowCount, 5].PutValue(AsposeHelper.SplitAndMerge(logs[count].NewValue, 24));
cells[rowCount, 6].SetStyle(tableBodyStyle);
cells[rowCount, 6].PutValue(logs[count].ChangedDate.ToString());
_worksheet.AutoFitRow(rowCount);
/*
if (Convert.ToDecimal(cells.Rows[rowCount].Height.ToString().Length >= 5 ? cells.Rows[rowCount].Height.ToString().Substring(0, 5) : cells.Rows[rowCount].Height.ToString()) != 12.60M)
cells.Rows[rowCount].Height = cells.Rows[rowCount].Height + (cells.Rows[rowCount].Height * 33 / 100);
*/
rowCount++;
}
}
using (var _imgStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("Ubs.LocationsDb.Content.Resources.ubs_regular_rgb.jpg"))
{
_worksheet.Pictures.Add(0, 0, ImageHelper.ResizeImgae(_imgStream, 28));
}
_worksheet.PageSetup.Orientation = PageOrientationType.Landscape;
_worksheet.PageSetup.CenterHorizontally = true;
_worksheet.PageSetup.PrintTitleRows = "$8:$8";
_worksheet.PageSetup.SetFooter(1, "Page &P of &N");
_worksheet.PageSetup.SetFooter(2, "Report produced on: " + DateTime.Today.ToString("dd MMMM yyyy") + " by " + SecurityManager.User.Identity);
_worksheet.PageSetup.LeftMarginInch = AsposeHelper.ConvertMMToInch(18);
_worksheet.PageSetup.RightMarginInch = AsposeHelper.ConvertMMToInch(18);
_worksheet.PageSetup.TopMarginInch = AsposeHelper.ConvertMMToInch(10);
_worksheet.PageSetup.BottomMarginInch = AsposeHelper.ConvertMMToInch(13);
_worksheet.PageSetup.FooterMarginInch = AsposeHelper.ConvertMMToInch(5);
MemoryStream stream = new MemoryStream();
_workbook.Save(stream, new PdfSaveOptions() { });
byte[] fileContent = stream.GetBuffer();
stream.Close();
Thanks,
Dip