p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: ASP, XML, and Crystal Reports


Message #1 by michael_byers@a... on Fri, 8 Jun 2001 19:36:10
I am having a hard time getting the Crystal Reports application object to 

work correctly using XML as the source in an ASP page. I want to parse an 

XML document and assign the node values to the Crystal Report control and 

then build the report with a graph. I am using the following code to 

create my object:



Server.CreateObject("CrystalRuntime.Application")



I cannot find documentation on what the methods and properties (with 

descriptions) are for this object. All the exmples that I have seen use a 

database as the source but I am using XML.  I have looked at the 

documentation in the book and searched the Crystal Reports website with no 

luck.  Can anyone help me?



<> Mike
Message #2 by "Raghavendra Prasad (IE10)" <RaghavendraPrasad@h...> on Mon, 11 Jun 2001 10:33:25 +0530
Hi mike,



Well there's no support for using XML DOM directly.



What you can do is to use either ADO persisted XML or

XML files directly. You should have SCR8.5 for that.



Basically SCR8.5 installs a XML Driver (Some Merant stuff..).

You will have to set up an XML Datasource and use it(That's

in the book).



If No schema is specified all nodes are treated as strings.



The following code opens an rpt file designed out of an

xml DSN "xmltest" and then at runtime changes the location

of the xmlfile to "NewBooks"



reportname = "xmlreport1.rpt"

If Not IsObject (session("oApp")) Then                              

  Set session("oApp") = Server.CreateObject("CrystalRuntime.Application")

End If                                                               

Path = Request.ServerVariables("PATH_TRANSLATED")                     

While (Right(Path, 1) <> "\" And Len(Path) <> 0)                      

iLen = Len(Path) - 1                                                  

Path = Left(Path, iLen)                                               

Wend                                                                  

If IsObject(session("oRpt")) then

	Set session("oRpt") = nothing

End if

Set session("oRpt") = session("oApp").OpenReport(path & reportname, 1)

session("oRpt").Database.Tables(1).SetLogOnInfo "xmltest", "", "", ""

'Log on to xml datasource

session("oRpt").Database.Tables(1).Location = "XML.NewBooks"

'Change location to NewBooks xml file

........



Ask if you still have any doubts.

Prasad



-----Original Message-----

From: michael_byers@a... [mailto:michael_byers@a...]

Sent: Saturday, June 09, 2001 1:06 AM

To: crystal_reports

Subject: [crystal_reports] ASP, XML, and Crystal Reports





I am having a hard time getting the Crystal Reports application object to 

work correctly using XML as the source in an ASP page. I want to parse an 

XML document and assign the node values to the Crystal Report control and 

then build the report with a graph. I am using the following code to 

create my object:



Server.CreateObject("CrystalRuntime.Application")



I cannot find documentation on what the methods and properties (with 

descriptions) are for this object. All the exmples that I have seen use a 

database as the source but I am using XML.  I have looked at the 

documentation in the book and searched the Crystal Reports website with no 

luck.  Can anyone help me?



<> Mike



raghavendraprasad@h...


$subst('Email.Unsub')

Message #3 by michael_byers@a... on Mon, 11 Jun 2001 20:49:12
I have everything sort-of working now but I keep getting errors when I try 

to create the "GraphObject" or try to execute the "AddGraphObject" in 

ASP.  Can you provide an example of how to create a graph using ASP? (I am 

using the ActiveX component in the browser) I found a VB example but it 

doesn't seem to work in ASP.



<> Mike
Message #4 by "Raghavendra Prasad (IE10)" <RaghavendraPrasad@h...> on Tue, 12 Jun 2001 00:00:23 -0500
Hi mike,



Even I am stumped by that one.

Have tried exactly what you have said and failed.



You cannot "Create" the graph object as it is 

non creatable. But must be added using the

"AddGraphObject" method.



Also, all that works in VB will not work in ASP.



Sorry .. Doubt if that was of any help.



Prasad



-----Original Message-----

From: michael_byers@a... [mailto:michael_byers@a...]

Sent: Tuesday, June 12, 2001 2:19 AM

To: crystal_reports

Subject: [crystal_reports] Re: ASP, XML, and Crystal Reports





I have everything sort-of working now but I keep getting errors when I try 

to create the "GraphObject" or try to execute the "AddGraphObject" in 

ASP.  Can you provide an example of how to create a graph using ASP? (I am 

using the ActiveX component in the browser) I found a VB example but it 

doesn't seem to work in ASP.



<> Mike



Message #5 by michael_byers@a... on Wed, 20 Jun 2001 00:33:59
I believe that I figured it out.  Crystal Reports Professional Edition 

does not fully support ASP (it would have been nice to know this earlier) 

but 8.5 Developer Edition does.  I talked with a Crystal Reports 

representative and he told me that the Professional Edition only supports 

about 80% of the objects.



<> Mike

  Return to Index