public static void DownLoadFile(WebEasilyReport report) { FileInfo file = new FileInfo(report.FilePath); if (file.Exists) { System.Web.HttpResponse Response = report.Page.Response; Response.Clear(); Response.Buffer = false; Response.ContentType = "application/x-msdownload"; Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name); Response.AddHeader("Content-Length", file.Length.ToString()); Response.Filter.Close(); Response.WriteFile(file.FullName); Response.End(); } }
public WebEasilyReportActionList(IComponent component) : base(component) { webRpt = component as WebEasilyReport; }
public void InitialView(WebEasilyReport report) { throw new Exception("The method or operation is not implemented."); }
public ExtJsRender(WebEasilyReport _report) { report = _report; }
public void InitialView(WebEasilyReport report) { //initial fonttable report.FontTable = new Hashtable(); report.ItemTable = new Hashtable(); this.report.ItemIndexTable = new Hashtable(); report.ImageItemTable = new Hashtable(); report.ImageItemIndexTable = new Hashtable(); //intial header #region header InitialItemView(report.HeaderItems, report.HeaderFont, HEADER); #endregion //initial field #region field //InitialFieldView(report, report.FieldFont); ArrayList list = new ArrayList(); int count = report.DataSourceCount - report.FieldItems.Count; for (int i = 0; i < count; i++) { report.FieldItems.Add(new DataSourceItem()); } foreach (DataSourceItem item in report.FieldItems) { list.Add(XmlConverter.ConvertFrom(item)); } report.LastIndex = -1; report.TempFieldItems = list; Control container = this.report.MultiView; DropDownList dropdownlistField = (DropDownList)container.FindControl(DROPDOWNLIST_FIELD); dropdownlistField.Items.Clear(); for (int i = 0; i < report.DataSourceCount; i++) { dropdownlistField.Items.Add(i.ToString()); } dropdownlistField_SelectedIndexChanged(dropdownlistField, new EventArgs()); #endregion //initial footer #region footer InitialItemView(report.FooterItems, report.FooterFont, FOOTER); #endregion //initial setting #region settting InitialSettingView(report); #endregion //initial database #region template //InitialDataBaseView(); #endregion InitialFileUploadView(); InitialPictureView(); }
private void SaveSetting(WebEasilyReport report) { Control container = this.report.MultiView; CheckBox checkboxColumnGrid = (CheckBox)container.FindControl(CHECKBOX_COLUMNGRID); this.report.Format.ColumnGridLine = checkboxColumnGrid.Checked; CheckBox cbxInnerColumnGrid = (CheckBox)container.FindControl(CHECKBOX_INNER_COLUMNGRID); report.Format.ColumnInsideGridLine = cbxInnerColumnGrid.Checked; CheckBox checkboxRowGrid = (CheckBox)container.FindControl(CHECKBOX_ROWGRID); this.report.Format.RowGridLine = checkboxRowGrid.Checked; CheckBox checkboxHeaderRepeater = (CheckBox)container.FindControl(CHECKBOX_HEADER_REPEAT); this.report.HeaderRepeat = checkboxHeaderRepeater.Checked; RadioButtonList radiobuttonlistPageSize = (RadioButtonList)container.FindControl(RADIOBUTTONLIST_PAGE_SIZE); report.Format.PageSize = (ReportFormat.PageType)Enum.Parse(typeof(ReportFormat.PageType), radiobuttonlistPageSize.SelectedValue); RadioButtonList radiobuttonlistPrintOrientation = (RadioButtonList)container.FindControl(RADIOBUTTONLIST_PRINT_ORIENTATION); report.Format.Orientation = (System.Windows.Forms.Orientation)Enum.Parse(typeof(System.Windows.Forms.Orientation), radiobuttonlistPrintOrientation.SelectedValue); TextBox textboxPageRecords = (TextBox)container.FindControl(TEXTBOX_PAGE_RECORDS); report.Format.PageRecords = Convert.ToInt32(textboxPageRecords.Text); DropDownList dropdownlistExportFormat = (DropDownList)container.FindControl(DROPDOWNLIST_EXPORT_FORMAT); report.Format.ExportFormat = (ReportFormat.ExportType)Enum.Parse(typeof(ReportFormat.ExportType), dropdownlistExportFormat.SelectedValue); TextBox textboxMailTitle = (TextBox)container.FindControl(TEXTBOX_MAIL_TITLE); report.MailSetting.Subject = textboxMailTitle.Text; TextBox textboxMailTo = (TextBox)container.FindControl(TEXTBOX_MAIL_TO); report.MailSetting.MailTo = textboxMailTo.Text; TextBox textboxMailFrom = (TextBox)container.FindControl(TEXTBOX_MAIL_FROM); report.MailSetting.MailFrom = textboxMailFrom.Text; TextBox textboxMailPassword = (TextBox)container.FindControl(TEXTBOX_MAIL_PASSWORD); report.MailSetting.Password = textboxMailPassword.Text; TextBox textboxMailServer = (TextBox)container.FindControl(TEXTBOX_MAIL_SERVER); report.MailSetting.Host = textboxMailServer.Text; TextBox textboxLeftMargin = (TextBox)container.FindControl(TEXTBOX_LEFTMARGIN); if (!string.IsNullOrEmpty(textboxLeftMargin.Text.Trim())) { report.Format.MarginLeft = Convert.ToInt32(textboxLeftMargin.Text.Trim()); } TextBox textboxRightMargin = (TextBox)container.FindControl(TEXTBOX_RIGHTMARGIN); if (!string.IsNullOrEmpty(textboxRightMargin.Text.Trim())) { report.Format.MarginRight = Convert.ToInt32(textboxRightMargin.Text.Trim()); } TextBox textboxTopMargin = (TextBox)container.FindControl(TEXTBOX_TOPMARGIN); if (!string.IsNullOrEmpty(textboxTopMargin.Text.Trim())) { report.Format.MarginTop = Convert.ToInt32(textboxTopMargin.Text.Trim()); } TextBox textboxBottomMargin = (TextBox)container.FindControl(TEXTBOX_BOTTOMMARGIN); if (!string.IsNullOrEmpty(textboxBottomMargin.Text.Trim())) { report.Format.MarginBottom = Convert.ToInt32(textboxBottomMargin.Text.Trim()); } CheckBox checkboxSendMail = (CheckBox)container.FindControl(CHECKBOX_SEND_MAIL); if (checkboxSendMail.Checked) { report.OutputMode = OutputModeType.Email; } else { report.OutputMode = OutputModeType.None; } }
private void SaveFont(WebEasilyReport report) { report.HeaderFont = (Font)report.FontTable[string.Format("{0}{1}", BUTTON_ITEM_FONT, HEADER)]; report.FooterFont = (Font)report.FontTable[string.Format("{0}{1}", BUTTON_ITEM_FONT, FOOTER)]; report.FieldFont = (Font)report.FontTable[BUTTON_FIELD_FONT]; }
private void InitialSettingView(WebEasilyReport report) { Control container = this.report.MultiView; CheckBox cbxColumnGrid = (CheckBox)container.FindControl(CHECKBOX_COLUMNGRID); cbxColumnGrid.Checked = report.Format.ColumnGridLine; CheckBox cbxInnerColumnGrid = (CheckBox)container.FindControl(CHECKBOX_INNER_COLUMNGRID); cbxInnerColumnGrid.Checked = report.Format.ColumnInsideGridLine; CheckBox cbxRowGrid = (CheckBox)container.FindControl(CHECKBOX_ROWGRID); cbxRowGrid.Checked = report.Format.RowGridLine; CheckBox checkboxHeaderRepeater = (CheckBox)container.FindControl(CHECKBOX_HEADER_REPEAT); checkboxHeaderRepeater.Checked = report.HeaderRepeat; RadioButtonList radiobuttonlistPageSize = (RadioButtonList)container.FindControl(RADIOBUTTONLIST_PAGE_SIZE); radiobuttonlistPageSize.SelectedValue = report.Format.PageSize.ToString(); RadioButtonList radiobuttonlistPrintOrientation = (RadioButtonList)container.FindControl(RADIOBUTTONLIST_PRINT_ORIENTATION); radiobuttonlistPrintOrientation.SelectedValue = report.Format.Orientation.ToString(); TextBox textboxPageRecords = (TextBox)container.FindControl(TEXTBOX_PAGE_RECORDS); textboxPageRecords.Text = report.Format.PageRecords.ToString(); DropDownList dropdownlistExportFormat = (DropDownList)container.FindControl(DROPDOWNLIST_EXPORT_FORMAT); dropdownlistExportFormat.SelectedValue = report.Format.ExportFormat.ToString(); Panel panelPageMargin = (Panel)container.FindControl(PANEL_PAGE_MARGIN); if (dropdownlistExportFormat.SelectedValue == ReportFormat.ExportType.Pdf.ToString()) { radiobuttonlistPageSize.Enabled = true; //radiobuttonlistPrintOrientation.Enabled = true; panelPageMargin.Enabled = true; } else { radiobuttonlistPageSize.Enabled = false; //radiobuttonlistPrintOrientation.Enabled = false; panelPageMargin.Enabled = false; } TextBox textboxMailTitle = (TextBox)container.FindControl(TEXTBOX_MAIL_TITLE); textboxMailTitle.Text = report.MailSetting.Subject; TextBox textboxMailTo = (TextBox)container.FindControl(TEXTBOX_MAIL_TO); textboxMailTo.Text = report.MailSetting.MailTo; TextBox textboxMailFrom = (TextBox)container.FindControl(TEXTBOX_MAIL_FROM); textboxMailFrom.Text = report.MailSetting.MailFrom; TextBox textboxMailPassword = (TextBox)container.FindControl(TEXTBOX_MAIL_PASSWORD); textboxMailPassword.Text = report.MailSetting.Password; TextBox textboxMailServer = (TextBox)container.FindControl(TEXTBOX_MAIL_SERVER); textboxMailServer.Text = report.MailSetting.Host; TextBox textboxLeftMargin = (TextBox)container.FindControl(TEXTBOX_LEFTMARGIN); textboxLeftMargin.Text = report.Format.MarginLeft.ToString(); TextBox textboxRightMargin = (TextBox)container.FindControl(TEXTBOX_RIGHTMARGIN); textboxRightMargin.Text = report.Format.MarginRight.ToString(); TextBox textboxTopMargin = (TextBox)container.FindControl(TEXTBOX_TOPMARGIN); textboxTopMargin.Text = report.Format.MarginTop.ToString(); TextBox textboxBottomMargin = (TextBox)container.FindControl(TEXTBOX_BOTTOMMARGIN); textboxBottomMargin.Text = report.Format.MarginBottom.ToString(); CheckBox checkboxSendMail = (CheckBox)container.FindControl(CHECKBOX_SEND_MAIL); if (this.report.OutputMode == OutputModeType.Email) { checkboxSendMail.Checked = true; } else { checkboxSendMail.Checked = false; } }
private void InitialSendMailView(WebEasilyReport report) { Control container = report.FindControl(MULTIVIEW_OUTPUTVIEW); TextBox textboxMailTitle = (TextBox)container.FindControl(TEXTBOX_SENDMAIL_TITLE); textboxMailTitle.Text = report.MailSetting.Subject; TextBox textboxMailTo = (TextBox)container.FindControl(TEXTBOX_SENDMAIL_TO); textboxMailTo.Text = report.MailSetting.MailTo; TextBox textboxMailFrom = (TextBox)container.FindControl(TEXTBOX_SENDMAIL_FROM); textboxMailFrom.Text = report.MailSetting.MailFrom; TextBox textboxMailPassword = (TextBox)container.FindControl(TEXTBOX_SENDMAIL_PASSWORD); textboxMailPassword.Text = report.MailSetting.Password; TextBox textboxMailServer = (TextBox)container.FindControl(TEXTBOX_SENDMAIL_SERVER); textboxMailServer.Text = report.MailSetting.Host; }
private void InitialFieldView(WebEasilyReport report, Font font, int dataSourceIndex) { string fontButtonID = BUTTON_FIELD_FONT; report.FontTable.Add(fontButtonID, font); Control container = this.report.MultiView; ListBox listboxItem = (ListBox)container.FindControl(string.Format("{0}{1}", LISTBOX_FIELD_SELECTED, string.Empty)); listboxItem.Items.Clear(); //ListBox listboxItemGroup = (ListBox)container.FindControl(string.Format("{0}{1}", LISTBOX_FIELD_SELECTED, GROUP)); //listboxItemGroup.Items.Clear(); ListBox listboxItemAll = (ListBox)container.FindControl(string.Format("{0}{1}", LISTBOX_FIELD_ALL, string.Empty)); listboxItemAll.Items.Clear(); //ListBox listboxItemAllGroup = (ListBox)container.FindControl(string.Format("{0}{1}", LISTBOX_FIELD_ALL, GROUP)); //listboxItemAllGroup.Items.Clear(); byte[] value = (byte[])report.TempFieldItems[dataSourceIndex]; DataSourceItem fieldItem = (DataSourceItem)XmlConverter.ConvertTo(value); //�����л�������DataSourceItemû��Collection���� // fieldItem.SetCollection(report.FieldItems); WebDataSource wds = null; if (dataSourceIndex < report.DataSource.Count) { string id = report.DataSource[dataSourceIndex].DataSourceID; wds = report.Parent.FindControl(id) as WebDataSource; if (wds == null) { wds = report.Page.FindControl(id) as WebDataSource; } } if (wds != null) { DataView view = wds.View; if (view != null) { DataTable table = view.Table; //DD DataSet ds = DBUtils.GetDataDictionary(wds, false); foreach (FieldItem field in fieldItem.Fields) { string columnName = field.ColumnName; DataRow[] drDD = ds.Tables[0].Select(string.Format("FIELD_NAME='{0}'", columnName.Replace("'", "''"))); string caption = drDD.Length > 0 ? drDD[0]["CAPTION"].ToString() : columnName; Guid key = Guid.NewGuid(); ; report.ItemTable.Add(key, XmlConverter.ConvertFrom(field)); listboxItem.Items.Add(new ListItem(caption, key.ToString())); } foreach (DataColumn column in table.Columns) { FieldItem field = fieldItem.Fields[column.ColumnName]; string columnName = column.ColumnName; DataRow[] drDD = ds.Tables[0].Select(string.Format("FIELD_NAME='{0}'", columnName.Replace("'", "''"))); string caption = drDD.Length > 0 ? drDD[0]["CAPTION"].ToString() : columnName; if (field == null) { listboxItemAll.Items.Add(new ListItem(caption, columnName)); } } } } Label labelFontSample = (Label)container.FindControl(LABEL_FIELD_FONT_SAMPLE); labelFontSample.Font.CopyFrom((FontInfo)WebFontConverter.ConvertFrom(report.FieldFont)); CheckBox checkboxFieldGroupTotal = (CheckBox)container.FindControl(CHECKBOX_FIELD_GROUP_TOTAL); checkboxFieldGroupTotal.Checked = fieldItem.GroupTotal; DropDownList dropdownlistFieldGroupGap = (DropDownList)container.FindControl(DROPDOWNLIST_FIELD_GROUP_GAP); dropdownlistFieldGroupGap.SelectedValue = fieldItem.GroupGap.ToString(); DropDownList dropdownlistCaptionStyle = (DropDownList)container.FindControl(DROPDOWNLIST_CAPTION_STYLE); dropdownlistCaptionStyle.SelectedValue = fieldItem.CaptionStyle.ToString(); }
public AspNetRender(WebEasilyReport _report) { report = _report; }