OWC11 ExportPicture messed up alignment, label positions, and more

S

Sascha Sertel

Hey there,

this time no ranting, just a plain problem I can't seem to figure out,
hopefully someone knows a solution here.

This is my situation: I have got a development server and a testing server.
Both servers are running Win2k Server with OWC11 and identical software
applications installed. I just rechecked the complete system configuration,
the only difference between the systems is that some Win2k Hotfixes are not
installed on one of the machines.

This is my problem: I have an ASP page which produces a Chart using OWC11
and then uses the BinaryFileStream DLL from the Microsoft example together
with the ExportPicture function to create a GIF from the chart and return it
from the ASP. This works great - on one machine.

On my development server all GIFs look fine and the way they should,
everything is the way I programmed it. But on the test server, the GIF
doesn't look right anymore. The title is suddenly right aligned instead of
centered and cut off at the right, the axis tick marks overlap with the axis
line, the legend is cut off, misaligned, and items in it overlap with each
other or are printed on top of each other.

Here are my thoughts:
1. First I thought it could be a file version issue or something like that,
but I compared the OWC files and they are exactly the same. I even
reinstalled the OWC component on the test server, but it doesn't make a
difference.
2. Could it be some memory thing? I checked memory usage on both systems,
and it looks fine and there is nothing unusual, but are there any known side
effects if OWC is installed on a server which doesn't get restarted very
often? The development server had to be rebooted a couple of times recently,
but the test server has been running much longer, and unfortunately I can't
just go ahead and reboot it to see if that's the reason, because too many
other things are relying on it right now.
3. Then I thought maybe IIS is doing something strange, and at least I could
restart IIS on the test server, but that didn't make a difference, either.

Any other ideas? Has anyone experienced this before? If necessary, I can
gladly provide two example images, one of the correct GIF from the
development server, and one of the incorrect GIF from the test server.

Thanks a lot,
Sascha
 
S

Sascha Sertel

Update: I finally rebootet the test server just to rule that out (or not),
and (unfortunately) this solved the problem. After the reboot the GIFs on
the test server came out fine and didn't look messed up as before anymore.

Therefore it seems to be a long time execution bug I'm running into? I guess
only the Microsoft developers themselves will be able to tell me if there is
any solution for this or not. Having to reboot the production server once in
a while is absolutely not an option, so could there be another solution to
this? As I said before, restarting IIS did NOT solve the problem.

Maybe there is also something I can do on the programming side to dispose,
close or delete the used OWC11 objects correctly? Also as said before,
memory usage was fine on the server, so it doesn't look like a memory leak
(at least not one visible in the TaskManager), but something got messed up,
and the cause seems to be that the server was running for a long time.

If there is no solution for this problem, I might end up having to replace
the OWC with something else, which would be a real bummer, since I invested
so much time in writing lots of code and functions to draw my charts etc.

Sascha
 
S

Sascha Sertel

Alvin,

the problem is that it is not the code which causes the problem, and it is
also not reproducible just by loading a piece of code and looking at it.
What we experienced was a long time failure of the OWC component after the
server had been running for some time. After the reboot everything looked
fine again, so it can be assumed that it is not the code, except if I am
causing some kind of memory leak myself. What is the propert way to
close/dispose objects used in the OWC with ASP?

Thanks,
Sascha
 
A

Alvin Bruney [MVP]

OWC is not managed code so the classes don't implement IDisposable.
If you set it to null, it should release all instances.
 
S

Sascha Sertel

Alvin,

I know the OWC is not managed code, I just wanted to know if there is
anything I can do to prevent memory leaks.

The problem which I had when I started this thread is appearing again, only
in a slightly different form now. Yesterday my charts looked fine, today
they didn't anymore, the code is unchanged and nothing happened other than
that the server kept running. I really believe that this is a long time bug
I am experiencing here, and it would be great if you could forward that to
any developers at Microsoft who might know more about that.

To better show you that it is not my code which is causing those problems, I
did the following: I wrote a very small OWC chart ASP which draws a pie
chart with a couple of values, title, datalabels, and a legend. The code
which I use is this:

<------- ASP Begin -------->
cht.Type = c.chChartTypePie
cht.hasTitle = True
cht.title.caption = "Incomplete / Overdue Updates"
cht.title.Font.bold = false

' Add DataSeries
set sc = cht.SeriesCollection.Add()
sc.Caption = "Test Caption"

' Add Data
dim Categories
Categories = array("<30", "30 - 90", "90 - 120", "120+", "Incomplete
Updates")
dim Values
Values = array(50, 39, 6, 9, 18)
sc.SetData c.chDimCategories, c.chDataLiteral, Categories
sc.SetData c.chDimValues, c.chDataLiteral, Values

' Add DataLabels
set dlc = sc.DataLabelsCollection.Add()
dlc.HasValue = True
dlc.Font.Bold = false
dlc.Font.Color = "Black"
dlc.Font.Size = 12

' Add Title and Legend
cht.HasLegend = True
cht.HasTitle = True
<------- ASP END ------->

Note: I'm using the ExportPicture function of OWC to get a GIF of that
graph.

Now this code draws the Pie as expected and everything looks fine. However,
when I change the two lines which say ..Font.Bold = false into ..Font.Bold =
true, then suddenly it doesn't show the datalabels and the title at all
anymore. And it's not like they are just invisible or White or whatever, the
Chart is also streched vertically because the title is really not even
drawn.

The same code works on my other server fine in both versions, and the second
version draws the bold labels and title just fine. I can with very high
certainty rule out that it is an issue with my code, or with file versions
of the OWC etc.

Everything seems to point towards a long time bug!! It worked fine yesterday
on both servers, but not today anymore. As described in my original posting
I had this behavior in a much more severe version, where everything was
messed up and not only bold titles missing, but I guess this is just the
beginning. Last time the only solution was to reboot the server, restarting
IIS alone did not change anything.

However, rebooting is not an option, since this is supposed to work on a
production server which might only very very rarely (if at all) be rebooted,
and since there is no application or asp error, actually no error at all,
and the GIF is still produced, it is very difficult to actually detect this
behavior automatically.

I really need help on this one,
since this might render the OWC completely unusable for the whole project if
it cannot be resolved!
Sascha

P.S.: I made screenshots this time which I can attach or send anywhere, but
I didn't want to include them here and make the posting bigger than
necessary right now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top