Select to view content in your preferred language

Benchmark Report Excel Format Issue

639
3
04-06-2010 06:56 AM
NateHadro
Emerging Contributor
I am creating a custom Benchmark Report with the below code.  The issue I am having is when I request the format of type "Excel" to be returned.  A window starts to popup and then goes away without returning any report.  PDF works just fine, but I need it in Excel format.

ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkReportParameters benchmarkReportParams =
                new ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkReportParameters();

            //Attempt to load Area_ID as Store Name
            //benchmarkReportParams.TALayersFields.Add("Area_ID");

            benchmarkReportParams.BenchmarkOptions = ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkOptions.useNone;
            benchmarkReportParams.FieldSortType = ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkSortOptions.sortNone;
            benchmarkReportParams.OutputTypes.GetReport = true;
           
            benchmarkReportParams.StandardReportOptions = new ESRI.ArcGIS.Client.BAO.Tasks.ReportOptions();
            benchmarkReportParams.StandardReportOptions.Format = "Excel";
            benchmarkReportParams.StandardReportOptions.Header.Subtitle = reportSubtitleTextBox.Text;
            //  See http://resources.esri.com/help/9.3/BusinessAnalyst/Docs/OnlineAPIs/summarization.htm
            //  for summarizations variables and downloadable files.
            benchmarkReportParams.Summarizations.Add("TOTPOP00");
            benchmarkReportParams.Summarizations.Add("TOTPOP_CY");
            benchmarkReportParams.Summarizations.Add("TOTPOP_FY");

ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkReportTask benchMarkReportTask =
                new ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkReportTask();

            //  Wire up async event handlers
            benchMarkReportTask.Failed +=
                new EventHandler<ESRI.ArcGIS.Client.Tasks.TaskFailedEventArgs>(task_Failed);
            benchMarkReportTask.ExecuteCompleted +=
                new EventHandler<ESRI.ArcGIS.Client.BAO.Tasks.BenchmarkReportEventArgs>(benchMarkReportTask_ExecuteCompleted);

            benchMarkReportTask.Token = BAOAPIAuth.Current.Token;
            benchMarkReportTask.ExecuteAsync(benchmarkReportParams);
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
A workaround might be to uncheck the option 'Confirm Open After Download' for the xls files.

The steps are depending on OS but should be something like this:
1) Open a folder (any folder),
2) Tools > Folder Options > File Type tab,
3) Scroll down to the XLS extension,
4) Click "Advanced",
5) Uncheck the "Confirm Open After Download" box,
0 Kudos
NateHadro
Emerging Contributor
I don't think the Vista, or Windows 7 (Which I am using) have this option.  I looked in the control panel as well and didn't see any options for this.   Thanks for the idea though.
0 Kudos
NateHadro
Emerging Contributor
I was able to fix this issue by not opening the Excel document in a new window.  With a PDF I was opening the report in a new window, but with Excel that was not working.   After changing it to open in the current window, it prompts me to open or save the document.
0 Kudos