Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another export to excel question

Status
Not open for further replies.

espltd

Programmer
Apr 6, 2005
233
US
Hi, just wondering if anyone knows if there is a way to set fixed column lengths when exporting a report to excel? Also is there a way to remove specific fields when the report is exported in excel? I was thinking of passing a parameter to the report but not sure if this would help.
 
Which version of Crystal? That makes a big difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi, thanks for the response. I am using the version that comes with visual studio 2005, I think a scaled down version of 10. Also I have the following code and checked with a break point to make sure it was executing but it does not seem to make a difference on the excel exported file. I check the export type and if excel then set the excelformatoptions. I put the page start and end as 2,3 just to test but the output report still has 40+ pages.

if (format == ExportFormatType.Excel)
{
ExcelFormatOptions excelformat = new ExcelFormatOptions();
excelformat.ExcelUseConstantColumnWidth = true ;
excelformat.ExcelConstantColumnWidth = 20;
excelformat.ExcelTabHasColumnHeadings = false;
excelformat.LastPageNumber = 2;
excelformat.FirstPageNumber = 3;
excelformat.UsePageRange = true;
document.ExportOptions.ExportFormatOptions = excelformat;
}
 
I don't know visual studio 2005. Can anyone else help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top