Forms Data Controls :: Deserialing Binary Stream And Loading To Chart?
Nov 1, 2010
I have a MS Chart Control and I'm trying to serialize the chart to view state. When teh page postbacks, I wnat to de-serialize the chart from ViewState, then load it back to the Chart's serializer. When the Chart1.Serializer.Load is called, I get an error message stating Data at the root level is invalid, line 1 position 1.
So here's what I have:
Chart1.Serializer.Format = System.Web.UI.DataVisualization.Charting.SerializationFormat.Binary;
Chart1.Serializer.Content = System.Web.UI.DataVisualization.Charting.SerializationContents.All;
Chart1.Serializer.Save(myStream);
ViewState["myStream"] = myStream.ToArray();
On postback, when the routine is called:
System.Byte [] byters;
System.IO.MemoryStream myStream = new System.IO.MemoryStream();
if (ViewState["myStream"] != null)
{
byters = (System.Byte[])ViewState["myStream"];
myStream.Write(byters,0,byters.Length);
myStream.Position = 0;
Chart1.Serializer.Load(myStream); // this line throws a XmlException - data at the root level is invalid. line 1 , position 1.
}
The length of the stream was 15,518 and capacity was 16,384 when it made the save. On postback, both capacity and length became 15,518.
View 1 Replies
Similar Messages:
Feb 3, 2011
I have a problem with deserializing in C#/ASP.NET, which gives the exact error:
The input stream is not a valid binary format. The starting contents (in bytes) are: 41-41-45-41-41-41-44-2F-2F-2F-2F-2F-41-51-41-41-41 ...
What I am trying to do
I have a structure with 3 classes. I have a class A which is a base class, and then class B and C which are derived from A.
I am trying to store random types of B and C in the database using LINQ to SQL, in a column with the type VARCHAR(MAX).
I cannot use BINARY as the length is around 15.000.
My code...
[code]...
So the error happends when the first Deserialize method is run, with the above error.
View 2 Replies
Dec 16, 2010
I can't figure out how to get the legend to populate all the "strReason" and get the correct percents to show for each column. This is where I'm at right now.
[Code]....
View 1 Replies
Aug 11, 2010
Here's a nice one for a Pro to bite into I have a web form that generates a set of reports including asp chart controls. Clicking on the black title loads the report section into the ajax enabled panel below it. Beautiful! Two Problems though: Sometimes, when the ajax is loading the next report section, all the other charts on the page flicker and sometimes even show a red x (the image disappears). They can then reappear again when another chart loads! 2nd Problem: If I use the html-to-pdf converter, I tell all the panels to bind to the data source (they are repeaters) on page load and show content. I Then convert the resulting datastream to PDF. All the other images on the page load, but the ones for the charts don't. I have
looked at the generated code, and they are all linked fine to the correct address of the site and the chart generator url. A sample image of the working page is below:
Example Page
Example PDF
Page PDF is generated from
View 3 Replies
May 10, 2010
I have a .net Chart Control working beautifully in IE, but when I test it in Firefox, the chart initially does not show up. I do a shift+reload and it then does show up (?)
1) I have the .net Chart Control set to run in memory in the web.config:
<add key="ChartImageHandler" value=storage=memory; deleteAfterServicing=true;"/>
2) I also have the pages set to HttpCacheability.NoCache.
View 4 Replies
Aug 1, 2010
I was wondering if there is any difference in performance (or any other important factor) between a file sent to the browser from our server by this method :
For i = 1 To fileSize chunk
If Not Response.IsClientConnected Then Exit For
Response.BinaryWrite stream.Read(chunk)
Response.Flush
Next
VS
the old plain file access method that the IIS comes with.
We are working on a file manager handler for security reasons and would like to know what is the performance hit.
View 3 Replies
Nov 1, 2011
Any code snippet or third party utilities to do this? Anything built into .NET libraries?
View 3 Replies
Mar 15, 2011
I have an ASP.NET page with a text status and a button to export an Excel file. When the user clicks the button, I want to generate the file on the fly and return it to the client as binary stream. Then I want to change the text status to show success/failure.
So far I can generate and send the file no problem, but obviously the statuses don't get displayed, since the server response was used to send the file and not a new updated page with the new status.
I'm not sure what's the cleanest way to approach this. I can think of something but is it the best way:
User clicks on button. File is generated and saved as a stream in the session. Statuses are updated and the page with the new statuses is returned to the client. A piece of Javascript on the page opens a 3rd party page which retrieves the saved stream from the session.
View 1 Replies
May 7, 2015
When I am featching binary images from database and displaying in datalist on asp .net image cotrol. The image display getting too much time. When I click on next button also I take too much time for display next image.
View 1 Replies
Jul 9, 2010
I have an issue in using dot net chart control. In chart last column is not completely shown which give bad appearance and on right side of chart it looks like TickMark are enabled. I set MajorTickMark of AxisY2 disabled but still tick marks on right side.
View 2 Replies
Feb 24, 2010
how to freeze the x axis of the chart control in ms chart? need to use because data displayed at large amount that is scrollable.
View 1 Replies
Jan 28, 2011
I have a drop downlist,and next to it there is an MS bar chart.i want to change the datate of the MS chart ,once the user selects another year from the dropdownlist.
When the page loads ,the chart displays the default year(2011) and it works.The problem is that is does not change the data when you select another year from the dropdownlist.
View 1 Replies
Apr 28, 2010
Am I going mad/blind? Probably a combination of the two.
How does one go about removing the data labels from a pie chart with the new chart control in .net 4?
I can get these to display as tooltips absolutely fine, but ultiamtely I'd like the labels not to be present as it looks rather busy.
I've searched previous answers and seen code behind resolutions but surely there must be some sort of code infront option to turn these labels off?
View 2 Replies
Aug 12, 2010
I am using MS Chart control (3.5), and have a requirement where I need to display 2 pie charts. The datapoints for the pie charts is set programatically. My doubts are as follows:
1. Can I display both the pie charts in a single chart control and area, or do I have to use two controls? (Currently I am using two controls)
2. How can I maintain the same size for both the pie charts? This is my main concern, since the pie sizes keep changing, depending on the number of datapoints. I tried using custom properties like "MinimumRelativePieSize", but it's not working.
View 1 Replies
Nov 17, 2010
i'm trying to create a stacked bar chart on a vb web form using vs2010.My data source returns:
Error in Functionality Awaiting on Supplier
1IMT IssuesmActive6
IMT Issues,Awaiting on Supplier
2,IMT Issues,Awaiting on User 4
IMT Issues Closed 120
Login / Password Active
But I can't get this into a stacked chart. I know I must have to do quite a bit of work declaring what the series are and soforth, or having a different dataset but can't find any documentation on it.A link to some documentation or an example of a stacked chart from an sql datasource would be much appreciated.
View 1 Replies
May 21, 2010
I started using the awesome chart controls with my asp.net apps recently and so far they've been nothing short of breath taking. Right now I have a weird problem, on the first load of my page, the chart control appears correctly and the tooltip is correct, however, when I update it with new data, the chart displays correctly, but the tooltips are for the previous set of data.
I hope this makes sense. The first time I load the chart, the pie chart segments and tooltips are correct, after a partial postback (to get the new data), the pie chart segments are correct but the tooltips are for the previous data set.
Basically once the tooltips are set the first time, they can't be updated after that without a full page postback.
Here's how I set the tooltip:
[Code]....
Anyone else noticed this behaviour and have a work around?
Currently my only workaround is to check for a partial postback and not render the tooltip, which I'd rather not do as the tooltip display actual statistical data as opposed to the pie itself (which uses percentages).
View 2 Replies
Sep 20, 2010
Is it possible to convert a datatable into binary data and save it into on a binary field on database?
View 2 Replies
Aug 12, 2010
I'm getting an xml stream from one website.and i need to bind my grid with that xml value.
View 5 Replies
Dec 13, 2010
I have to code a chart which get his data of a PLC-control. The problem is that the PLC send every second a measurement to my program, so I have to refresh the chart every second. Via a timer-element of AJAX I can load the chart every second with new data, but I donīt know how I can make this asynchronous.
I want to have this:
The chart-Website should refresh the chart every second via the ajax-timer. The measurements which were used should stand in an array which is updated with the PLC-control-Function.
BUT I DONīT KNOW HOW I CAN DO THIS!!!
View 1 Replies
Feb 23, 2011
I have been googling this and have not come along a working solution for an entire day. I don't know anything about binary data types (as I've never knowingly used them) and I'm trying to write a binary value that I see in the registry, to the registry. Now, all I see is the following [shown below]... and if I try to pass that as a string to the RegSetValueEx in the WinAPI and of course it errors out... I do not know what 'numbers' I need to pass into the lpData As Any, argument of RegSetValueEx (i tried a bit array) in order for it to come out as the following [shown below] in the regedit. I really have no idea, and my tests to place random numbers in the bit array just produce corresponding random "figures" as visible in regedit that I do not understand how to 'tie' them together logically.
here is the culprit!
[Code]...
If I had the following in a string or a bit array, what must I populate the bitarray with so that the registry outputs this [above] when written? or, how can I figure out how to do it? I was hoping there'd be a function that reads my string of binary data and transforms it into the real binary format to submit to the RegSetValueEx function in VB6 or other function in VB.Net or C# (this really is a language agnostic question, and the problem exists in all languages; ie: same process).
View 2 Replies
Apr 21, 2010
Does anyone know how to explode a certain section of the piechart, which is part of microsoft chart controls?
View 5 Replies
Feb 22, 2011
I have an excel file in my Response Output stream. I can Open the stream as a file after a prompt, but it doesn't seem I can save it directly to a specified folder on my client.
View 1 Replies
Sep 20, 2010
I'm using the following code to upload images, pdf files, word files and excel to a sql table as binary data. However, I can only figure out how to display the images but am clueless about the other type of files. What adjustments do I need to make so that with a button click I can access the other files? 't By the way, I'm using an image control to display the binary data and I'm aware that that will only work to display images, I just don't how to access all the other types of files once uploaded.
[Code]....
View 2 Replies
Jan 29, 2011
I have one table "EmpDetails". Fields of the table are empid, empname and empimg. I have stored employee details in these three fields. Now i want to retrive empname and empimg field in my web form. To do this i have taken one data list control. I have wriiten all code to get desired data but i am only getting empname from data base, not getting his/her image from databse. let me tell you i have stored images in database as a binary data. so how to retrive this binary data in datalist as an image.Below is my datalist control.
<asp:DataList id="ItemsList"
BorderColor="black"
CellPadding="5"
CellSpacing="5"
[Code]....
View 2 Replies
Feb 25, 2010
i have a table with a bindary data field in it (excel, pdf, word files etc).
In gridview i want to have a colum that the user can click on to open or download that file. The file is stored in the database and not on the directory.
I have searched some things but only came up with complex stuff.. I am trying to stay away from complex because i am a total noob.
View 9 Replies