Re: rendering owc charts in asp.net page

Tech-Archive recommends: Fix windows errors by optimizing your registry



unless you are doing something really funky, the GACUTIl is not needed. If
you are using visual studio, it automatically finds and uses the Office PIA
when it detects a reference to an unmanaged assembly. You do not have to
reference the PIA. Instead, reference the unmanaged assembly and let visual
studio do the work. This may be one issue why you application is
misbehaving.

--
Regards,
Alvin Bruney

Shameless Author Plug
[The Microsoft Office Web Components Black Book with .NET]
www.lulu.com/owc, Amazon, Barnes & Noble etc
Forth-coming VSTO.NET
--------------------------------------------------------------------------------------------------------




"Loane Sharp" <look_sharp_not@xxxxxxxxxxx> wrote in message
news:%23jhYbmZsFHA.3640@xxxxxxxxxxxxxxxxxxxxxxx
> hi there
>
> am I correct in saying that there are basically 3 different ways of
> rendering an owc chart at runtime in an asp.net page, viz. ExportPicture
> (physically stored to disk), GetPicture (image streamed to client), and
> within <OBJECT CLASSID=...\> tags.
>
> I'm facing the bizarre situation that all three methods work perfectly in
> VBScript in my asp.net pages, but since switching all my code to VB.NET
> (because I couldn't easily get variables to recognize or talk to one
> another between VBScript and VB.NET) they work erratically. For instance,
> I can't have a chart drawn using the GetPicture method in a HTML table:
> the table doesn't show up but the chart does.
>
> all things equal I prefer the GetPicture method (ExportPicture involes too
> much cleaning-up, <OBJECT> tags are too finicky with GACUTIL, registering
> PIAs, etc.), but I can't find a way to control the position, etc. of the
> image in an HTML table served by my asp.net application.
>
> Do you have any ideas? Please help!
> Best regards
> Loane
>
>
> Sub Page_Load()
> Dim n As Integer
> Dim c As Object, axScale As Object, axValAxis As Object
> Dim catData As Object = New Object() {1, 2, 3, 4, 5}
> Dim valData As Object = New Object() {1, 2, 3, 4, 5}
> With objChart
> .Type = ChartChartTypeEnum.chChartTypeBarClustered
> .Border.Color = "White"
> .HasTitle = True
> .Title.Caption = "TOP 10 CANDIDATES"
> .Title.Font.Name = "Verdana"
> .Title.Font.Bold = True
> .Title.Font.Size = "8"
> .PlotArea.Interior.Color = "White"
> .PlotArea.Border.Color = "White"
> .SeriesCollection.Add
> .SeriesCollection(0).Caption = "Values"
> .SeriesCollection(0).GapWidth = 20
> .SeriesCollection(0).Interior.SetSolid(RGB(255, 204, 0))
>
> .SeriesCollection(0).Interior.SetPatterned(ChartPatternTypeEnum.chPattern50Percent,
> RGB(255, 204, 0), "White")
> .SeriesCollection(0).SetData(ChartDimensionsEnum.chDimCategories,
> ChartSpecialDataSourcesEnum.chDataLiteral, catData)
> .SeriesCollection(0).SetData(ChartDimensionsEnum.chDimValues,
> ChartSpecialDataSourcesEnum.chDataLiteral, valData)
> .SeriesCollection(0).DataLabelsCollection.Add
> .SeriesCollection(0).DataLabelsCollection(0).HasValue = True
> .SeriesCollection(0).DataLabelsCollection(0).NumberFormat = "##0"
> .SeriesCollection(0).DataLabelsCollection(0).Font.Name = "Verdana"
> .SeriesCollection(0).DataLabelsCollection(0).Font.Size = "8"
> .SeriesCollection(0).DataLabelsCollection(0).Position =
> ChartDataLabelPositionEnum.chLabelPositionInsideEnd
> .Axes(ChartAxisPositionEnum.chAxisPositionBottom).NumberFormat = "##0"
> .Axes(0).Font.Name = "Verdana"
> .Axes(0).Font.Size = "8"
> .Axes(1).HasTitle = True
> .Axes(1).Title.Caption = "Evaluation (percent)"
> .Axes(1).Title.Font.Name = "Verdana"
> .Axes(1).Title.Font.Size = "8"
> .Axes(1).Font.Name = "Verdana"
> .Axes(1).Font.Size = "8"
> End With
> axScale =
> objCSpace.Charts(0).Axes(ChartAxisPositionEnum.chAxisPositionValue).Scaling
> axScale.Maximum = 100
> axScale.Minimum = 0
> axValAxis =
> objCSpace.Charts(0).Axes(ChartAxisPositionEnum.chAxisPositionValue)
> axValAxis.HasMajorGridlines = False
> axValAxis.HasMinorGridlines = False
> End Sub
> </SCRIPT>
> </HEAD>
> <BODY>
> <FORM >
> <TABLE HEIGHT='100%' WIDTH='100%' CELLSPACING='0' CELLPADDING='0'
> BORDER='1' STYLE='VISIBILITY:VISIBLE;POSITION:ABSOLUTE;Z-INDEX:0;'>
> <TR HEIGHT='100%'>
> <TD WIDTH='100%'>
> <%
> Response.Clear()
> Response.ContentType = "Image/PNG"
> Response.BinaryWrite(objCSpace.GetPicture("PNG", 200, 200))
> %>
> </TD>
> </TR>
> </TABLE>
> </FORM>
> </BODY>
> </HTML>
>


.



Relevant Pages

  • Re: PIAs and Visio 2002
    ... > To make sure I ran the following commands from the visual studio command ... >> it sounds like the visio pia has not been installed in assembly GAC ... >> indicates that the Visio PIA is being used instead of forcing Visual ...
    (microsoft.public.visio.developer)
  • Re: COMException (0x800A1066): Befehl misslungen
    ... Visual Studio erstellt dann eine IA. ... Diese IA muss auf dem Kundenrechner registriert und z.B. direkt im Ausführungsverzeichnis oder z.B. im GAC installiert sein. ... die PIA höchstwahrscheinlich aus dem GAC geholt. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: OLE Automation Question
    ... You can just add a reference to the application and Visual Studio will ... handle creating a Primary Interop Assembly (PIA) for you, ... > What is the technology that replaces OLE Automation in .NET? ...
    (microsoft.public.dotnet.languages.csharp)