Re: rendering owc charts in asp.net page
- From: "Alvin Bruney - MVP ASP.NET" <www.lulu.com/owc>
- Date: Sun, 4 Sep 2005 19:34:44 -0400
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>
>
.
- Follow-Ups:
- Re: rendering owc charts in asp.net page
- From: Loane Sharp
- Re: rendering owc charts in asp.net page
- References:
- rendering owc charts in asp.net page
- From: Loane Sharp
- rendering owc charts in asp.net page
- Prev by Date: rendering owc charts in asp.net page
- Next by Date: Re: rendering owc charts in asp.net page
- Previous by thread: rendering owc charts in asp.net page
- Next by thread: Re: rendering owc charts in asp.net page
- Index(es):
Relevant Pages
|