Sunteți pe pagina 1din 2

For new information on Builds and demos, please join the webchart discussion ali

as by visiting http://autogroup/JoinGroup.asp?GroupAlias=webchart
To use the control you just need to:
1) Add a reference to Microsoft.McsMx.Web.Chart.dll in VS.NET and optionally you
can add it to your toolbox.
2) Add the correct register tag in the page:
<%@ Register TagPrefix="mcsmx" Namespace="Microsoft.McsMx.Web.Chart" Assembly="M
icrosoft.McsMx.Web.Chart" %>
3) Add the simplest chart possible:
<mcsmx:Chart id="chart" runat="server">
</mcsmx>
4) From this point you can use the VS.NET designer to format your chart.
5) BTW. Remember to call RedrawChart() whenever you want the chart to be redrawn
(usually in Page_Load or after changing the data, etc) if not you will only rec
eive an empty image, this is by design to avoid redrawing unnecesary charts for
performance.

FOR USERS OF VS.NET


The steps above are only needed if you like doing things manually, with VS.NET t
hings can be easier:
1) Open or Create a New Web Project in the language of your choice
2) Just open your toolbox (if it does not appears click Ctrl+Alt+X)
3) Right click on it and Select the option Customize Toolbox
4) select the Tab .NET Framework Components , then click Browse and just search for th
e extracted Mic....Chart.dll file.
5) Doing this, will add a small chart icon in your toolbox, and now, you can jus
t drag/drop it in the VS.NET Designer, and it will actually add the reference au
tomatically for you in any web project.
6) From this point, you can add/remove charts from the designer, use the AutoFor
mat task (right click on the chart) to customize look & feel. etc

SETUP KNOWN ISSUES:


The way the chart works is rendering the charts into a folder called TempCharts,
so, if the folder does not exist, it tries to create it, so it can store the ch
arts there.
One known issue is with Windows XP, and probably Win 2K3, that they do not grant
write permission to the folders to the ASPNET account (or Network Service accou
nt).
So just to be sure, if the chart is working on the vs.net designer, but it is no
t working when seeing the actual page:
1) Under your application virtual directory create a folder named TempCharts
2) grant NTFS write permissions to the ASPNET account (be sure not to grant writ
e permissions in the IIS MMC since that could be a security hole).
Try again.

So for example if your virtual directory is named MyApplication and lives in the
default dirs.
You would need to create
C:\inetpub\wwwroot\MyApplication\TempCharts\
And assign read and write permissions to ASPNET account.
If this doesn t work, tell me and we will find out a solution quickly.
And please check the Application Event log to see if there are any (Application)
errors to give us a clue.
Thanks for using the WebChart control.
Carlos

More details on troubleshooting:


If you find this exception, it means it is trying to write an error to the event
viewer, and it couldnt gain access to it. This is normally because of Write Per
missions on the registry.
So the problem usually is because it couldn't create the TempCharts folder menti
oned above, so follow the steps mentioned above.
Security Exception
Description: The application attempted to perform an operation not allowed by th
e security policy. To grant this application the required permission please cont
act your system administrator or change the application's trust level in the con
figuration file.
Exception Details: System.Security.SecurityException: Requested registry access
is not allowed.
If you find this:
A generic error occurred in GDI+.
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderPar
ameters encoderParams) +581
System.Drawing.Image.Save(String filename, ImageFormat format) +61
Microsoft.MCSMX.Web.Chart.Chart.RedrawChart() +1013
Then it means the folder is there, but the user (ASPNET or whatever user you are
using) do not have write permissions to write on the folder.

S-ar putea să vă placă și