Jump to content
Software FX Community

.Net client question


User (Legacy)

Recommended Posts

I have added the ability to let the user save his local chart settings in my

Webform Application.

Now my question:

Is there any way to get these User settings back to the server? I need the

chart settings for pdf generation.

I have found only the way to use client side Export method and pass the

image data back to the server.

But I have the data to generate the chart on the server I only need the

Chart User settings.

And I think the user data is much smaller than sending a whole Image back to

the server.

Thanxs for your hekp.

Regards

Bj

Link to comment
Share on other sites

On your webform, attach code to the chart's Personalized event. When you do

this the ChartFX client component will send a stream with the chart settings

(no data, just visual settings) to the server. The PersonalizedEventArgs

will give you information about the action (saving/loading) and a stream.

Note that auto save is not supported when you are using this approach.

--

Regards,

JC

Software FX Support

"Berger" <prodevelop@gmx.net> wrote in message

news:l6yv1cLHEHA.2848@webserver3.softwarefx.com...

> I have added the ability to let the user save his local chart settings in

my

> Webform Application.

>

> Now my question:

> Is there any way to get these User settings back to the server? I need the

> chart settings for pdf generation.

> I have found only the way to use client side Export method and pass the

> image data back to the server.

> But I have the data to generate the chart on the server I only need the

> Chart User settings.

> And I think the user data is much smaller than sending a whole Image back

to

> the server.

>

> Thanxs for your hekp.

>

> Regards

>

> Bj

Link to comment
Share on other sites

sample code was wrong

Here is my correct sample code

----------------------sample code----------------------------------

private void Page_Load(object sender, System.EventArgs e)

{

this.Chart1.Personalized += new

PersonalizedEventHandler(Chart1_Personalized);

}

private void Chart1_Personalized(object sender, PersonalizedEventArgs e)

{

SoftwareFX.ChartFX.Internet.Server.Chart tempData = new Chart();

chartData.Import(e.Stream);

//chartData.Import(SoftwareFX.ChartFX.Internet.Server.FileFormat.Binary,e.St

ream);

string test = chartData.ToolBar.ToString();

}

Bj

Link to comment
Share on other sites

The Personalized event is  fired for BOTH Save and Load.

You must check the Action property to determine which action to take

(PersonalizedAction.Load, PersonalizedAction.Save,

PersonalizedAction.Reset).

The error you are getting is cause by trying to read from a Stream intended

to be used to SAVE.

--

FP

Software FX

Link to comment
Share on other sites

I thought I could fill a NEW chart Object with the stream data

when I hit the SAVE Button in the -Net chart control.

What else can I do with the stream?

Is there another Object where I can import the stream?

There must be a way to get the changes

made by the user in the .Net Control?

What I want is to save the changes made by the user in .Net Control in my

Database as Parameters.

Let

Link to comment
Share on other sites

If you do this only when the action is SAVE, it should work fine. I tried

the following myself:

private void Chart1_Personalized(object sender,

SoftwareFX.ChartFX.Internet.Server.PersonalizedEventArgs e) {

if (e.Action == PersonalizedAction.Save) {

Chart chart = new Chart();

chart.Import(e.Stream);

if (chart.Chart3D) {

TextBox1.Text = "3D";

}

}

}

And works fine, maybe there is some kind of a bug that your particular Chart

is causing. Please export the chart to a binary file (using the Export

method) and attach it to your posting, you can also obtain this file from

your Temp folder, to locate it, do a view-=source in your page and look for

the DataPath property value. Then look for this file in your server.

--

FP

Software FX

Link to comment
Share on other sites

Ok. I found the problem. It happens only when you have an external

background or border object attached to your chart.

We will fix this in the next SP, as a workaround, please remove both the

background (BackObject and InsideBackObject properties) and border object

(BorderObject property) from your chart.

--

FP

Software FX

Link to comment
Share on other sites

Ok, thanks. Now it works fine :)

Now I have another question. We are developing a solution where the user

should be able to save his chart settings in a DataBase. First I wanted to

save only some Parameters in my Database (3DMode, Some Axis Values and so

on).

Now I thought why not save the whole stream in my database which I got if

the user pressed the save button in .Net Control?

Is there anything what speaks against that? And will the stream from Chart

FX 6.2 be the same in following versions? Not that an user gets at any time

a System Exception while he is loading an old stream out of the database.

regards

Bj

Link to comment
Share on other sites

> Now I thought why not save the whole stream in my database which I got if

> the user pressed the save button in .Net Control?

> Is there anything what speaks against that?

That's actually the way in which we designed this event to work. You can

take the Stream and put it in a database or any other media.

> And will the stream from Chart FX 6.2 be the same in following versions?

We keep file compatibility between versions. Only major platform changes

have in the past caused incompatible chart types. For example when we moved

from COM to .NET. However, moving from COM version to COM version (in a

period of over 5 years) we kept compatibility, same goes for the .NET

versions.

So, although I can not guarantee that these streams will be compatible with

ALL future versions of the product, they will have a very long shelf life.

Only in the event that you re-do your application using a different

programming paradigm (e.g. Longhorn) you may loose binary-file

compatibility. In this situations we usually provide a tool/library to make

the conversion.

--

FP

Software FX

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...