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.ReportApp Server = ConfigurationSettings.AppS ettings["R ASServer"] ;
filename = "rassdk://" + this.m_applicationPath + Reports\\" + this.m_ReportFile;
crReportDocument.Open( ref filename, 1 );
SetFormulaFields( crReportDocument );
crReportDocument.DatabaseC ontroller. SetDataSou rce(DataSe tConverter .Convert(d s),crRepor tDocument. Database.T ables[0].A lias, ds.Tables[0].TableName );
PrintOutputController ctrl = crReportDocument.PrintOutp utControll er;
CrystalDecisions.ReportApp Server.Com monObjectM odel.ByteA rray byteArray = null;
ExcelExportFormatOptions excelOptions = new ExcelExportFormatOptions() ;
excelOptions.BaseAreaType = CrAreaSectionKindEnum.crAr eaSectionK indDetail;
ExportOptions exportExcel = new ExportOptions();
exportExcel.ExportFormatTy pe= ReportExportFormatEnum.crR eportExpor tFormatMSE xcel
exportExcel.FormatOptions = excelOptions;
byteArray = ctrl.ExportEx(exportExcel) ;
CR10:
There is no ExportEx method attached to the PrintOutputController
object. I am using
byteArray = ctrl.Export(CrReportExport FormatEnum .crReportE xportForma tMSExcel, 1);
Anybody has an idea on how to set the excel options in CR10 like we can do in CR11?
Thanks!
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.ReportApp
filename = "rassdk://" + this.m_applicationPath + Reports\\" + this.m_ReportFile;
crReportDocument.Open( ref filename, 1 );
SetFormulaFields( crReportDocument );
crReportDocument.DatabaseC
PrintOutputController ctrl = crReportDocument.PrintOutp
CrystalDecisions.ReportApp
ExcelExportFormatOptions excelOptions = new ExcelExportFormatOptions()
excelOptions.BaseAreaType = CrAreaSectionKindEnum.crAr
ExportOptions exportExcel = new ExportOptions();
exportExcel.ExportFormatTy
exportExcel.FormatOptions = excelOptions;
byteArray = ctrl.ExportEx(exportExcel)
CR10:
There is no ExportEx method attached to the PrintOutputController
object. I am using
byteArray = ctrl.Export(CrReportExport
Anybody has an idea on how to set the excel options in CR10 like we can do in CR11?
Thanks!
The CR9 samples will work with CR10. The c# samples are here if that's your preference:
http://support.businessobjects.com/communityCS/FilesAndUpdates/csharp_win_samples.exe.asp
http://support.businessobjects.com/communityCS/FilesAndUpdates/csharp_web_samples.exe.asp
frodoman
http://support.businessobjects.com/communityCS/FilesAndUpdates/csharp_win_samples.exe.asp
http://support.businessobjects.com/communityCS/FilesAndUpdates/csharp_web_samples.exe.asp
frodoman
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
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
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mlmcc