Log Parser chart output using ASP.Net

M

Mike Lowery

I'm trying to write an ASP.Net app that uses Log Parser 2.2's COM interface to
read some Windows Media Server (W3C) log files and generate a chart (GIF file)
on the web server. I'm getting an error when attempting to generate the chart
using the ExecuteBatch method:

Error executing query: Unexpected internal error calling chart object method
ExportPicture: Exception occurred. [Exception occurred.]

Office 2003 Web Components is installed and other output types (XML) work just
fine. So I'm guessing this is a permissions or registration error w/OWC, but not
sure. Hoping someone can point me in the right direction.

Here's the ASP.Net code:

Dim sPath As String = Request.PhysicalApplicationPath
Dim inputContext As New MSUtil.COMW3CInputContextClass
Dim outputContext As New MSUtil.COMChartOutputContextClass

outputContext.chartType = "BarClustered"

Dim query As String
query = "SELECT [c-ip], COUNT(*) AS [Sessions] INTO '" & sPath & "delme.gif'
FROM '" & sPath & "WMS_ISAPI_20040826.log' GROUP BY [c-ip]"

Dim lg1 As New MSUtil.LogQueryClass
lg1.ExecuteBatch(query, inputContext, outputContext) '<-- Error occurs here
 
M

Mike Lowery

Did a little more playing around. Turns out if I specify the destination as
something like c:\temp\delme.gif it works, but if there are any spaces in the
file path it fails (c:\temp temp\delme.gif). Strange thing is that spaces in
the path doesn't affect the reading of the log file!

So now the question is how to get this to work with spaces in the path...
already tried enclosing it in quotations (same result.)
 
A

Alvin Bruney [MVP]

gabriel gussipini can provide the exact syntax. he authored the logparser
utility. Unfortunately he is no longer at MS. But you can track him down via
email be replying to the log parser book support email. Hope that helps.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley


Mike Lowery said:
Did a little more playing around. Turns out if I specify the destination
as something like c:\temp\delme.gif it works, but if there are any spaces
in the file path it fails (c:\temp temp\delme.gif). Strange thing is that
spaces in the path doesn't affect the reading of the log file!

So now the question is how to get this to work with spaces in the path...
already tried enclosing it in quotations (same result.)

Mike Lowery said:
I'm trying to write an ASP.Net app that uses Log Parser 2.2's COM
interface to read some Windows Media Server (W3C) log files and generate
a chart (GIF file) on the web server. I'm getting an error when
attempting to generate the chart using the ExecuteBatch method:

Error executing query: Unexpected internal error calling chart object
method ExportPicture: Exception occurred. [Exception occurred.]

Office 2003 Web Components is installed and other output types (XML) work
just fine. So I'm guessing this is a permissions or registration error
w/OWC, but not sure. Hoping someone can point me in the right direction.

Here's the ASP.Net code:

Dim sPath As String = Request.PhysicalApplicationPath
Dim inputContext As New MSUtil.COMW3CInputContextClass
Dim outputContext As New MSUtil.COMChartOutputContextClass

outputContext.chartType = "BarClustered"

Dim query As String
query = "SELECT [c-ip], COUNT(*) AS [Sessions] INTO '" & sPath &
"delme.gif' FROM '" & sPath & "WMS_ISAPI_20040826.log' GROUP BY [c-ip]"

Dim lg1 As New MSUtil.LogQueryClass
lg1.ExecuteBatch(query, inputContext, outputContext) '<-- Error occurs
here
 

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