.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Export error in asp.net Badly need Help!!

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Hello.. I can display the report ok but when I export to pdf etc i was getting the login failed error.. after speaking with crystal reports they said I should build my report etc in page init and also again on the export button on click event. NOW I am getting the following error. Exception has been thrown by the target of an invocation. Now!!: am I closer to a solution or am I further away?????? can anybody help as this is driving me mad. below is a copy of the code Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports System.Data.SqlClient Imports System.IO Public Class PPCReport Inherits System.Web.UI.Page Protected WithEvents exportTypesList As System.Web.UI.WebControls.DropDownList Protected WithEvents exportByType As System.Web.UI.WebControls.Button Private exportPath As String Private myDiskFileDestinationOptions As DiskFileDestinationOptions Protected WithEvents myCrystalReportViewer As CrystalDecisions.Web.CrystalReportViewer Protected WithEvents cR_PPCReport1 As webDevVB.CR_PPCReport Protected WithEvents Menu1 As skmMenu.Menu Protected WithEvents lblMessage As System.Web.UI.WebControls.Label Protected WithEvents crppC11 As webDevVB.CRPPC1 Protected WithEvents FirstPage_button As System.Web.UI.WebControls.Button Protected WithEvents Back_button As System.

View Complete Post

More Related Resource Links

SSIS Import/Export Wizard: "Unexpected Unrecoverable Error"

For whatever reason, whenever the SSIS Import/Export Wizard needs to display an error message, it throws up "Unexpected Unrecoverable Error" instead. The three buttons - Abort, Retry, and Ignore - all cause the wizard to close. I see some activity in Process Monitor that looks like DTSWizard.exe is probing around for some System.Web assemblies, and not finding them. I'm running 2008 SP1 on Win 7 x86, and I've reinstalled the client tools and Integration Services. Anybody else seen this issue? Should I file a report on Connect?

export to ecxel error..

HI,     I have one querry which is to be run on sql server 2008 r2.... But while providing the query in export wizard ,It gives me the error at execution time as:- Executing (Warning) Messages Warning: Preparation SQL Task 1: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. (SQL Server Import and Export Wizard)   Warning: Preparation SQL Task 1: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. (SQL Server Import and Export Wizard) Please let me know wat may be the reason for this error..........

Crystal Report Export - Database Logon Failed Error -

 Below is my code in VB.Net.  I am using PUSH method to populate the DataSet.  I use Crystal Report and VS 2003.   I am trying to export a crystal report to a PDF and I am getting a database log on error.   Why would it give me this error since the report is getting its data from the DataSet.  Please help!!!  ---------------------------------------------- Try Dim oStream As New MemoryStream Me.crpt_numIssues.ExportToStream(ExportFormatType.PortableDocFormat) Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Response.BinaryWrite(oStream.ToArray()) Response.End() Catch ex As Exception Dim mgsText As String mgsText = "ERROR: An error occured. <br>" + ex.ToString Me.ShowErrorPanel(mgsText) End Try ------------------------------ The error is: CrystalDecisions.CrystalReports.Engine.LogOnException: Database logon failed. ---> System.Runtime.InteropServices.COMException (0x8004100F): Database logon failed. at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqCo

Error while export to pdf-Object reference not set to an instance of an object

Hello, I am getting error while rendering the report to pdf in SSRS 2008. This is happening randomly and sometimes I get this error. I have SQL Server 2008 SP1 installed in my system . I installed the cumulative update 1 for SP1 also but no luck. Every time when export to pdf fails, SSRS is creating the dump file in the logs. I have captured the log of this specific error. Please let me know if you have any idea about this.   reportrendering!ReportServer_0-297!1ec4!03/30/2010-10:32:57:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report., ; Info: Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: Object reference not set to an instance of an object.   at Microsoft.ReportingServices.Rendering.HPBProcessing.Paragraph.get_SpaceBefore()   at Microsoft.ReportingServices.Rendering.RichText.LineBreaker.FlowParagraph(Paragraph paragraph, Directions direction, IntPtr hdc, Single dpiX, FontCache fontCache, FlowContext flowContext, Boolean keepLines, SizeF flowContextSize, Int32& contentOffset)   at Mi

Export-SPWeb "cannot find spweb object with id or url" error

How do we just export and import a library or a list using Export-SPWeb and Import-SPWeb? I tried exporting just a library with Export-SPWeb, but it throws an error : Could not find an SpWeb Object with Id or URL “http://<server:port>/Shared Documents”. The same thing goes for a simple list like Tasks: "http://<server:port>/Lists/Tasks". Any help would be much appreciated

Error Server Unavailable when try to export it to Excel



I am using SSRS 2005 Version 9.00.4035.00

When i run a query and the query results in 105122 row and when i try to export to it excel I get an

Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

In my group i have added =Ceiling(RowNumber(Nothing)/65000) so that it goes to the next page but it doesnt work


any help will be appreciated




Error when trying to export gridview to Excel - RegisterForEventValidation can only be called during

I have a pretty basic vb.net page that has textbox control on it and a "generate" button that when clicked, fills a datagrid.  That all works great, but when the user clicks the "Export to Excel" button, I get this error.. RegisterForEventValidation can only be called during Render(); 

Here's my code behind, I thought I included everything I needed...

Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
End Sub

Private Sub ExportToExcel(ByVal strFileName As String, ByVal dg As GridView)
        Response.Buffer = True
        Response.ContentType = "application/vnd.ms-excel"
        Response.AddHeader("content-disposition", "attachment;filename=" & strFileName)
        Response.Charset = ""
        Me.EnableViewState = False
        Dim StringWriter As New System.IO.StringWriter()
        Dim HtmlTextWriter As New System.Web.UI.HtmlTextWriter(Str

Getting error in report when export to excel


Hi all,
I am using local reports(rdlc) files for reports generation in Asp.net
I am getting following error.
Excel Rendering Extension : "Number of rows in the excel sheet exceeded the limit of 65536 rows"
How can i solve this error.


Word Export error when orientation is Landscape in SSRS 2008


Hi there,

        I have created a report in SSRS 2008, In the report properties I have selected Orientation as Landscape but when i Export the report to Word it prints the report on middle of the page and cuts the rest of the report.

Urgent help is needed!!!

Export to Excel big size files (10000 pages) - HTTP Error 401.1



If you attempt to export a file to Excel, the browser hangs for a long time, then begins to request authorization, several times in succession .
Then displays an error message: "you are not authorized to view this page"

Export to Excel gives error before opening file


I have a web page with a gridview control and a button for Exporting to Excel

I get following error when exporting to Excel.

"The fiel you are trying to open, 'someFileName[1].xls, is in a different format than specified by the file extension. Verify that file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

Clicking Yes opens the file. I would like to avoid showing the above error to the users.

Following code is used from the click event. I've left the commented code here to show what I've tried based on results from internet search. I have Microsoft Office Excel 2007 on local PC.

public static void ToExcel(DataTable dt, string fileName)
			string attachment = "attachment; filename=" + fileName + ".xls";

			GridView gvExcel = new System.Web.UI.WebControls.GridView();
			gvExcel.AutoGenerateColumns = true;
			gvExcel.DataSource = dt;

			//HttpContext.Current.Response.AddHeader("content-disposition", attachment);
			//HttpContext.Current.Response.ContentType = "application/ms-excel";
			HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";

SQL Express R2 - Import / Export Data (32-bit) - Excel - Unexpected Unrecoverable Error


Preface - I'm BRAND NEW to SQL! Bought a book and working to learn :) I've have a lot of experience in Access and other msft titles.

I've installed SQL Express 64 bit on Win 7 (64) and I'm trying to setup my 1st table to start practicing running queries on and I’m having nothing but trouble!! I'm trying to use the import / export wizard to import Excel '07 spreadsheet that has a table of data and I CANNOT get through this without crashing! EVERY SINGLE TIME!

My Steps:

1.  Open Wizard

DTSWIZARD (import/export utility) - Error trying to use VFP OLEDB provider


A week ago I was using SQL Server 2008 Express and the DTSWIZARD was working fine when I selected the Microsoft OLE DB Provider for Visual FoxPro as the data source for the import data. The wizard only allows me to RUN the import and not SAVE it saying I needed to upgrade to Developer/Enterprise edition of the server to be able to save the attributes of the import (for reuse).

So, I downloaded SQL Server 2008 R2 Enterprise as an MSDNAA (faculty) person. I installed both R2 Enterprise and R2 Express. I don't really need Enterprise (which is good because I cannot get it to START no matter what I try...which is another issue not related to this one I am writing about here).

I now have the version/feature for DTSWIZARD that allows me to save my import attributes (yea!)...however, the problem now is when I select the Microsoft OLE DB Provider for Visual FoxPro as the data source for the import data I get the following error message when I click NEXT: Feature is not available (Microsoft OLE DB Provider for Visual FoxPro). If I click the Properties... button (to select the VFP database) I get this error message: Unexpected Unrecoverable Error  and the wizard quits when I click any of the 3 buttons on that pop up message.

The VFP OLE DB provider is ALIVE AND WELL (I think) on my Windows 7 Ultimate 32-bit laptop as I am

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Configuring Profile Image Export in SharePoint 2010

It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Database Export Wizard for ASP.net and SQL Server

A step wizard for ASP.net to export database objects to CSV, TXT, HTML, XML, or SQL. it guides users through a few simple steps to choose a database object (table, view, or query), select columns, and export the data in any of the standard formats CSV, HTML, XML, or SQL.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend