Esempio n. 1
0
 public QueryConditionProvider(string q,List<String> exportFields)
 {
     _q = new QueryCondition();
     _q.Query = q;
     _q.ExportFields = exportFields;
 }
        void _ExportBtn_Click(object sender, EventArgs e)
        {
            try
            {
                this.buildCaml();

                Guid queryDataId = Guid.Empty;

                int[] selectedIds = SharePointUtil.GetSelectedItemIDs(this.List);

                QueryCondition qp = new QueryCondition();
                qp.ItemIDs = selectedIds;

                qp.Where = this.InternalQuery;

                qp.ExportFields = this.ExportFields;

                SPView view = base.CurrentView;

                if (view != null)
                {
                    qp.ViewId = view.ID;
                    qp.OrderBy = SharePointUtil.GetOrderBySection(view.SchemaXml);
                }

                qp.Query = qp.Where + qp.OrderBy;

                queryDataId = TransferDataManager.Instance.StoreData(qp);

                Page.ClientScript.RegisterStartupScript(this.GetType(), "WordExport",
                    "\nListQueryConditionWebPart_Export('" + this.CurrentWebUrl + "','" + this.ExportPage + "','" + List.ID + "','" + queryDataId + "','" + this.ExportTempalte + "');\n", true);
            }
            catch (Exception ex)
            {
                base.RegisterError(ex);
            }
        }