Hi to all,
I am using infra volume 2007.3 for my project.. my query is after button clicking am exporting Ultragrid to Excel and PDF... Locally Exporting to Excel and PDF both are working fine.. once i host my application into server PDF function is not working..
I am giving the code details below....
private void ExportToPDF(object p, FileFormat format)
{
// Report
Infragistics.Documents.Report.
();
// Section
Infragistics.Documents.Report.Section.
section = report.AddSection();
section.PageSize = Infragistics.Documents.Report.
.Letter;
section.PageMargins.All = 20;
section.PageOrientation =
.Landscape;
section.PageAlignment.Horizontal =
.Left;
section.PageAlignment.Vertical =
.Top;
section.PageAlignment =
.Top);
// Table
Infragistics.Documents.Report.Table.
table = section.AddTable();
table.Height =
(5000);
table.Width =
(800);
table.Margins.Top = 5;
table.Margins.Bottom = 5;
// Header
header = table.Header;
header.Height =
(25);
header.Repeat =
;
>();
//iterate through the column headers and create the table header
.uwGrid.Columns)
//Create the header Cells
cell = header.AddCell();
cell.Background =
.OliveDrab));
cell.Alignment.Vertical = Infragistics.Documents.Report.
.Middle;
cell.Width =
(75);
Infragistics.Documents.Report.Text.
text = cell.AddText();
text.Style =
.White);
text.Alignment = Infragistics.Documents.Report.
.Center;
text.AddContent(c.Key);
}
//Iterate through the selected rows and then check each of its cells to see if they are selected:
.uwGrid.Rows)
row = table.AddRow();
i = 0; i < gr.Cells.Count; i++)
cell = row.AddCell();
cell.Paddings.All = 5;
.Black);
text.Alignment.Horizontal = Infragistics.Documents.Report.
Am getting below error after hosting my application in the server:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] TEBI080_Item_MIn_Base_Qtys_Definer.ExportToPDF(Object p, FileFormat format) +1155 TEBI080_Item_MIn_Base_Qtys_Definer.btnSaveToDoc_Click(Object sender, EventArgs e) +265 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
please anybody suggest the answer......its urgent
Thanks & Regards
Naag C
What is TEBI080_Item_MIn_Base_Qtys_Definer?
Just a quick guess that maybe you don't have anough access rights in the hosted environment?