Skip to main content

Posts

Showing posts from 2011

Visual Studio 2010 Error HRESULT E_FAIL has been returned from a call to a COM component.

I was using Visual Studio 2010.  I was debugging a web application and an exception happened and VS 2010 froze.  I ended the VS 2010 in the task manager and when I went back to developing, I found on every form for every ASP.net control I get:  Error Creating Control - Error HRESULT E_FAIL has been returned from a call to a COM component.  Also I am unable to edit  the form or add anything from the toolbox. Solution: This error comes because of Caching of Visual Studio Delete the Cache. You can delete the project cache at "Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache", then run "devenv /setup" to build the cache again to see if it helps.

Dynamic Image Url Code Behind Code To Export Multiple Images to Word File

[vb.code] * Write This Code in Button Click Event. *  img1,2,3,4 variable is used to get and store the image name which is stored in the session. * My Scenario was export all four chart control images into one ms-word file. * Here all image name are unique and stored into the session variable. Protected Sub btnExportAllChart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportAllChart.Click             Dim serverurl As String =   Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath + "/TempImageFiles/"         Dim img1 As String = serverurl + Session("ImageName1")         Dim img2 As String = serverurl + Session("ImageName2")         Dim img3 As String = serverurl + Session("ImageName3")         Dim img4 As String = serverurl + Session("ImageName4")         HttpContext.Current.Response.Clear()         HttpContext.Current.Response.Charset = ""         HttpContext.Curren

Show Download Image Popup On Button Click...

How to show the download Popup when we click on the button? Add this code in Button Click Event  Protected Sub btnExportToImage_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExportToImage.Click {  Response.ContentType = "png"  Response.AppendHeader("Content-Disposition", "attachment; filename=TopIndustry.png")  Response.TransmitFile(Server.MapPath("~/TempImageFiles/" + Session("ImageName").ToString()))  Response.End() } - Image is stored on the server. - so in this example image name is set on runtime and stored in to the session. - On button click  End Sub It will show the Output:

Chart image is not showing up when using ASP.NET charting control on Live Server

Step :1 Change in web.config file: add Url=~/TempImages/; in below line.. < add key = "ChartImageHandler" value = "Storage=file;Timeout=20; Url=~/TempImages/; " /> Here, TempImages is folder name which is already created to store the chart image. Step :2 Change ImageStorageMode of chartcontrol to " UseImageLocation"

Microsoft Charting [ Show All Skipped Labels on the X-Axis ]

Just about everyone who has worked with category names on the Microsoft Reporting Services or .NET chart has encountered this problem: you databind categorical values from a database, but when it is displayed on the chart, it skips labels on the x-axis, like below: How Do I Show All Labels on the X-Axis? Method 1: Set the Interval property on the x-axis to 1 in properties: Method 2: Set the Interval property on the x-axis to 1 in Load Event chartname.ChartAreas[0].AxisX.Interval = 1; Result: