الأربعاء، 5 يونيو 2013
How to Export Gridview to Excel.
Wrtie the following Code in Export button:
protected void btnexport_Click(object sender, EventArgs e)
{
try
{
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=gridviewdata.xls");
Response.Charset = "";
Response.ContentType = "application/vnd.ms-excel";
StringWriter sWriter = new StringWriter();
HtmlTextWriter hWriter = new HtmlTextWriter(sWriter);
GridView1.RenderControl(hWriter);
Response.Output.Write(sWriter.ToString());
Response.Flush();
Response.End();
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
//***********
public override void VerifyRenderingInServerForm(Control control)
{
}
//***********
public override void VerifyRenderingInServerForm(Control control)
{
}
الأحد، 26 مايو 2013
السبت، 25 مايو 2013
الثلاثاء، 14 مايو 2013
CRM 2011: Javascript Xrm.Page Basics
//***** Get the value from a CRM field
var varMyValue = Xrm.Page.getAttribute(“CRMFieldSchemaName”).getValue() ;
//****** Set the value of a CRM field
Xrm.Page.getAttribute(“po_CRMFieldSchemaName”).setValue(‘My New Value’);
//***** Hide/Show a tab/section
Xrm.Page.ui.tabs.get("Tab Name").setVisible(false);
Xrm.Page.ui.tabs.get("Tab Name").sections.get("Section Name").setVisible(true);
//*****Call the onchange event of a field
Xrm.Page.getAttribute(“CRMFieldSchemaName”).fireOnChange();
//****Get the selected value of picklist
Xrm.Page.getAttribute(“CRMFieldSchemaName”).getSelectedOption().text;
//******Set the requirement level
Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(“none”);
Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(“required”);
Xrm.Page.getAttribute(“CRMFieldSchemaName”).setRequiredLevel(“recommended”);
//********Set the focus to a field
Xrm.Page.getControl(“CRMFieldSchemaName”).setFocus(true);
//***********Stop an on save event
event.returnValue = false;
//**** Return array of strings of users security role GUIDs:
Xrm.Page.context.getUserRoles()
Method returns a Boolean value that indicates if any fields in the form have been modified.
Xrm.Page.data.entity.getIsDirty()
CRM 2011 : Value cannot be null. Parameter name: localContext
This error appear when was a problem in custom plugins so that unregister this plugin.
السبت، 11 مايو 2013
CRM 2011:An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.
To Solve this error do the following:
1- Stop and start CRMAppPool
2- stop and restart Microsoft Dynamics CRM Site
OR change the user that running the CRmAppPool
الاشتراك في:
الرسائل (Atom)
