This is a simple dashboard drop down control to view and export sections.
This allows end users to preview the selected section as well as exporting the report or section in the required format and with the desired name.
Reqs: Dashboard (“Dashboard”), drop down control (“drop_ctl1″).
This document has three report sections, Sales Report, Finance Report, and Marketing Reporting.
In the values tab of the drop down property editor I’ve added the following values:
Select Report Option
——————————
Sales Report
Finance Report
Marketing Report
——————————
Export Sales Report
Export Finance Report
Export Marketing Report
The drop down script:
//first section previews
var drop_pick;
drop_pick=drop_ctl1.Item(drop_ctl1.SelectedIndex);
if (drop_pick==”Sales Report”)
{ActiveDocument.Sections["Sales Report"].Activate();
}
if (drop_pick==”Finance Report”)
{ActiveDocument.Sections["Finance Report"].Activate();
}
if (drop_pick==”Marketing Report”)
{ActiveDocument.Sections["Marketing Report"].Activate();
}
//export section using bqExportFormatPDF and CSV
if (drop_pick==”Export Sales Report”)
{ActiveDocument.Sections["Sales Report"].ExportToStream( “Sales Report”, bqExportFormatPDF, true, true, true );
}
if (drop_pick==”Export Finance Report”)
{ActiveDocument.Sections["Finance Report"].ExportToStream( “Finance Report”, bqExportFormatPDF, true, true, true );
}
if (drop_pick==”Export Marketing Reportt”)
{ActiveDocument.Sections["Marketing Report"].ExportToStream( “Marketing Report”, bqExportFormatCSV, true, true, true );
}
//reset the drop down to default value
var MyIndex =ActiveDocument.Sections["Dashboard"].Shapes["drop_ctl1"].SelectedIndex=1
ActiveDocument.Sections["Dashboard"].Shapes["drop_ctl1"].Select(MyIndex)
Baeball Cards
7 years ago
No comments:
Post a Comment