using (Stream stream = reportDocument.ExportToStream(ExportFormatType.Excel))
{
using (MemoryStream memoryStream = new MemoryStream())
{
stream.CopyTo(memoryStream);
//Save to DB
}
}
}
when I retrieve from db and download the excel it looks unformatted. How to make the cells Autowidth for the column in the excel file?
Thanks for your help
C#Crystal Reports
Last Comment
Shanmugam Rajagopal
8/22/2022 - Mon
AndyAinscow
Not tried this. The following line
formatOptions.ExcelUseConstantColumnWidth = true;
looks like you instruct not to use an autowidth, try setting the value to false.
formatOptions.ExcelUseCons
looks like you instruct not to use an autowidth, try setting the value to false.