Dear Aspose Team,
I am using Aspose cell for .Net.
I have a problem in printing the downloaded excel using ASPOSE.
Print coming as very small font which is not at all readable
Please see the attached screenshot for your reference that i have taken from print preview.
Please note that this excel got more columns and text also some what big in some columns.
All want is to print that excel download without any issues and should be fit in all the columns in single page irrespective of no of columns or length of the text inside any row
Please see the block of code that i am using currently.
bool UseAspose = Convert.ToBoolean(ConfigurationManager.AppSettings[“UseAspose”]);
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
if (UseAspose)
{
wb = new Aspose.Cells.Workbook();
Aspose.Cells.Worksheet worksheet = wb.Worksheets[0];
worksheet.PageSetup.PaperSize = Aspose.Cells.PaperSizeType.PaperA4Rotated;
worksheet.PageSetup.Orientation = Aspose.Cells.PageOrientationType.Landscape;
worksheet.Cells.ImportDataTable(dt, true, 0, 0, dt.Rows.Count, 1000, true, “dd-MMM-yyyy”, true);
worksheet.AutoFitRows();
worksheet.AutoFitColumns();
wb.Save(this.Response, “Verbatim.xls”, Aspose.Cells.ContentDisposition.Inline, new Aspose.Cells.XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003));
}
Could you please suggest to fix this issue?
Thanks,
Nagamani
Hi,
Hi,
Hi Amjad ,
Thanks for your reply.
Please find the attached sample excel file for your reference.
I am using the following block of code to download excel
wb = new Aspose.Cells.Workbook();
Aspose.Cells.Worksheet worksheet = wb.Worksheets[0];
worksheet.PageSetup.PaperSize = Aspose.Cells.PaperSizeType.PaperA4Rotated;
worksheet.PageSetup.Orientation = Aspose.Cells.PageOrientationType.Landscape;
worksheet.PageSetup.FitToPagesWide = 1;
worksheet.Cells.ImportDataTable(dt, true, 0, 0, dt.Rows.Count, 1000, true, “dd-MMM-yyyy”, true);
worksheet.AutoFitRows();
worksheet.AutoFitColumns();
wb.Save(this.Response, “Sample.xls”, Aspose.Cells.ContentDisposition.Inline, new Aspose.Cells.XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003));
That is all the code i am using in my application.
Please set the any other printing options so that data should fit in one page.
And one more thing if the font is very small to read after the print as i attached in my earlier post,
You can wrap the text wherever required so that it will show in single page
Please do the needful ,its a matter of very urgency.You can you the sample excel file that i have attached here to test this issue
I look forward to here from you soon
Thanks
Nagamani
Hi Kasif,
License error is coming if i use the new DLL.Is this issue fixed in this version?
Do i get free update for this? or need to renew the license to use new dll?
Thanks,
Nagamani
Hi Nagmani,
Hi,
Hi Amjad,
i have tried with options you have said in your earlier post,but not able to get the desired output.
Could you please share the actual code to adjust the required settings?
Warp text is not working in my case.
Please share sample code code to get the output you have set manually for the attached document.
Thanks,
Nagamani
Hi,
Hi amjad,
The following is the bock of code that i am using
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
if (UseAspose)
{
wb = new Aspose.Cells.Workbook();
Aspose.Cells.Worksheet worksheet = wb.Worksheets[0];
worksheet.PageSetup.PaperSize = Aspose.Cells.PaperSizeType.PaperA4;
worksheet.PageSetup.Orientation = Aspose.Cells.PageOrientationType.Landscape;
worksheet.PageSetup.FitToPagesWide = 1;
worksheet.PageSetup.FitToPagesTall = 1;
worksheet.Cells.StandardWidth = 10;
worksheet.Cells.ImportDataTable(dt, true, 0, 0, dt.Rows.Count, 1000, true, “dd-MMM-yyyy”, true);
Aspose.Cells.Cell cell = worksheet.Cells[1, 13];
Aspose.Cells.Style style = cell.GetStyle();
style.IsTextWrapped = true;
cell.SetStyle(style);
worksheet.PageSetup.LeftMargin = 0;
worksheet.PageSetup.RightMargin = 0;
wb.Save(this.Response, “Verbatim.xls”, Aspose.Cells.ContentDisposition.Inline, new Aspose.Cells.XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003));
I am trying to set the wrap text for the 13th column in the attached document in last post
Could you please take the document that you sent to me as reference and set the properties thru ASPOSE?
Please do the needful. its very urgent
Thanks,
Nagamani
Hi,
string filePath = @“K:\NewSampleData.xlsx”;Workbook workbook = new Workbook(filePath);Worksheet worksheet = workbook.Worksheets[0];Column col = worksheet.Cells.Columns[13];Style style = new Style();style.IsTextWrapped = true;StyleFlag styleFlag = new StyleFlag();styleFlag.All = true;col.ApplyStyle(style, styleFlag);workbook.Save("K://output.xlsx");
Hi Kasif,
Thanks for your reply.
I rephrase my requirement again.
I have a datable and writing that data into excel using ASPOSE.This part is done doing successfully.
When i take the print
I have to fit all the columns in one page.some case its 13 columns and some times more than 15 columns.
if i don’t use any property then all the columns are not coming in one page.Then i used one property
worksheet.PageSetup.FitToPagesWide = 1;
if i use above property then all the columns fit in one page.
But All the records are coming in one single page.if excel having 30000 records then all these records are coming in one single page hence font is not at all readable.
So please could you please tell me how to fit all the columns in one page and let rows can fit in any number pages ?
Please note that i have also used " worksheet.PageSetup.FitToPagesTall = 1" but this doenst make any difference
Assume that excel having 50,000 records and 15 coulmns and also some text in one or more columns having a very length text as i send a test document to you
How can you do print this excel showing all the columns in one page and let number of pages to accommodate these 50000 records any number of pages?
I hope you understand my requirement
Please let me know if you need anything from my side to fix this issue
Thanks,
Nagamani
Hi,
Hi Support,
Even if i use below “ws.PageSetup.FitToPagesWide = 1;” it is shrinking the columns as 1 page but not able to see the text (it is invisible).
ws.PageSetup.FitToPagesWide = 1;
Please suggest a workaround asap.
Thank you
Hi,
Hi,
Please try the following code. It should work fine.
Please use the latest version:
Aspose.Cells
for .NET v7.2.2.1
I have attached the output.xlsx file generated by it.
C#
string filePath = @“F:\SNewSampleData.xlsx”;
Workbook workbook = new Workbook(filePath);
Worksheet ws = workbook.Worksheets[0];
//Clear all horizontal and verticle page breaks
ws.HorizontalPageBreaks.Clear();
ws.VerticalPageBreaks.Clear();
//Clear the print area
ws.PageSetup.PrintArea = null;
//Fit pages wide and tall
ws.PageSetup.FitToPagesWide = 1;
ws.PageSetup.FitToPagesTall = 1;
workbook.Save(filePath + “.out.xlsx”);
nagamani:
Even if i use below "ws.PageSetup.FitToPagesWide = 1;" it is shrinking the columns as 1 page but not able to see the text (it is invisible).
ws.PageSetup.FitToPagesWide = 1;ws.PageSetup.FitToPagesTall = 0;
Hi
We are not able to print attached document in to single page( breaking in to3pages) and font also not readable(see attached print sample.png). Please suggest us solution for this asap.
Thanks,
Nagamani.
Hi,
When I directly save your xls file into pdf using the Ms-Excel 2010, I get the same result.
So, there is some problem with the file. Could you please download the pdf file and check it at your end?
Hi,
I have downloaded the pdf file with same result. Other than difference that “AllQuestions-TopBox(25-06-2012)(8).xls” contains formulas, we are not able to trace ‘problem with the file’.
Please confirm whether aspose support excel sheets with formulas to shrink to one page and also can you please suggest conditions to check (or) give us directions on how to investigate and solve the issue in this excel if there is any.
Thanks,
Nagamani