private void ordersReport_AfterGenerateWorkbook(object sender, FlexCel.Report.GenerateEventArgs e) { if (encryptionType.SelectedItem == encryptionType.Items[1]) { e.File.Protection.EncryptionType = TEncryptionType.Xor; } else { e.File.Protection.EncryptionType = TEncryptionType.Standard; } e.File.Protection.OpenPassword = OpenPassGenerated.Text; e.File.Protection.SetModifyPassword(ModifyPassGenerated.Text, RecommendReadOnly.Checked, ReservingUser.Text); e.File.Protection.SetWorkbookProtection(ProtectWorkbookPass.Text, new TWorkbookProtectionOptions(false, ProtectWorkbook.Checked)); }
private void MinesReport_AfterGenerateWorkbook(object sender, FlexCel.Report.GenerateEventArgs e) { //do some "pretty" up for the final user. //we could do this directly on the template, but doing it here allows us to keep the template unprotected and easier to modify. e.File.ActiveSheet = 2; e.File.SheetVisible = TXlsSheetVisible.Hidden; e.File.ActiveSheet = 1; e.File.Protection.SetSheetProtection(null, new TSheetProtectionOptions(true)); for (int r = 20; r <= FlxConsts.Max_Rows97_2003 + 1; r++) { e.File.SetRowHidden(r, true); } for (int c = 12; c <= FlxConsts.Max_Columns97_2003 + 1; c++) { e.File.SetColHidden(c, true); } }
private void ordersReport_AfterGenerateSheet(object sender, FlexCel.Report.GenerateEventArgs e) { e.File.Protection.SetSheetProtection(ProtectSheetPass.Text, new TSheetProtectionOptions(ProtectSheet.Checked)); }
private void ordersReport_BeforeReadTemplate(object sender, FlexCel.Report.GenerateEventArgs e) { e.File.Protection.OpenPassword = OpenPassTemplate.Text; }