Link to home
Start Free TrialLog in
Avatar of npelletier
npelletier

asked on

Exporting in Excel with column width based on details (CR10)

I'm trying to export my reports in Excel format using the CR10 version
with the "Column width based on objects in the Details" option.

I've been able to do it in CR11, but for some reasons I am restricted
to use CR10 in that project.

Working in CR11 (note code is in c#, hoping it's no problem):

ReportClientDocument crReportDocument;
crReportDocument = new ReportClientDocument();
crReportDocument.ReportAppServer = ConfigurationSettings.AppSettings["RASServer"];
filename = "rassdk://" + this.m_applicationPath + Reports\\" + this.m_ReportFile;
crReportDocument.Open( ref filename, 1 );
SetFormulaFields( crReportDocument );
crReportDocument.DatabaseController.SetDataSource(DataSetConverter.Convert(ds),crReportDocument.Database.Tables[0].Alias, ds.Tables[0].TableName );
PrintOutputController ctrl = crReportDocument.PrintOutputController;
CrystalDecisions.ReportAppServer.CommonObjectModel.ByteArray byteArray = null;

ExcelExportFormatOptions excelOptions = new ExcelExportFormatOptions();
excelOptions.BaseAreaType = CrAreaSectionKindEnum.crAreaSectionKindDetail;
ExportOptions exportExcel = new ExportOptions();
exportExcel.ExportFormatType= ReportExportFormatEnum.crReportExportFormatMSExcel
exportExcel.FormatOptions = excelOptions;
byteArray = ctrl.ExportEx(exportExcel);

CR10:

There is no ExportEx method attached to the PrintOutputController
object. I am using

byteArray = ctrl.Export(CrReportExportFormatEnum.crReportExportFormatMSExcel, 1);

Anybody has an idea on how to set the excel options in CR10 like we can do in CR11?

Thanks!
Avatar of Mike McCracken
Mike McCracken

Here are some samples for CR9 they should work with CR10 http://support.businessobjects.com/communityCS/FilesAndUpdates/vbnet_win_samples.exe.asp

mlmcc
Avatar of npelletier

ASKER

Thank you for your responses.

We finally have to opportunity to deploy the RAS for CR11 and are currently testing it.  If it's OK, that will solve this issue.

I will keep you posted.

Npelletier
Thank you all for your help.  We deployed the RAS for CR11 and it's working OK.  Still didn't worked before with CR10 solution....
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial