Janaina R. de Jesus (ja*****@prontomail.com) wrote in message news:<#L**************@TK2MSFTNGP11.phx.gbl>...
Hi,
I am new to crystal reports and I have to build some reports and
call them from an ASP page and display them. I am using Crystal
Reports Developer 9.0 and the client has Professional 9.0. I have
been doing research on it and I can't figure it out. I am used to
using com objects and active reports to display reports like this. I
just need a basic explanation of what it takes to get this done. I
want the reports to show as HTML, and all the user should have to do
is click the button on the asp page and the report should generate and
pop up. I understand that crystal can export to html but I only know
how to do it by using File->Export.....and it needs to do this
automatically.
Thanks everyone,
Jana.
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
did you try using one of the many examples that business objects
(formerly crystal enterprise, formerly seagate software) provides on
their web site?
this is a very simple example for you (watch the line wrapping):
==================
front_screen.asp
==================
<%
Make_FrontEnd_Page "doit.asp", "some meaningful header for this
report"
' yes, this was meant to be reusable code and much has been stripped
from it
Sub Make_FrontEnd_Page(action, header)
wr "<HTML>" & vbcrlf
wr "<HEAD>" & vbcrlf
wr "<title>Report Front Screen for Parameters</title>" & vbcrlf
wr "</HEAD>" & vbcrlf
wr "<BODY bgcolor=#ADD8E6>" & vbcrlf
wr "<FORM name=f method=post runat=""server"" action=""" & action &
""" target='__new__'>" & vbcrlf
wr "<center>" & vbcrlf
wr "<h2>" & header & "</h2>" & vbcrlf
wr "<TABLE width=700 align=center border=0 cellpadding=0
cellspacing=0 bgcolor=#008800>" & vbcrlf
wr " <tr>" & vbcrlf
wr " <td align=center>" & vbcrlf
wr " <INPUT type=submit value="" Run Report "" id=submit
name=Button> " & vbcrlf
wr " <INPUT type=reset value="" Reset "" id=cancel
name=Button2>" & vbcrlf
wr " </td>" & vbcrlf
wr " </tr>" & vbcrlf
wr "</table>" & vbcrlf
wr "</FORM>" & vbcrlf
wr "</BODY>" & vbcrlf
wr "</center>" & vbcrlf
wr "</HTML>" & vbcrlf
end sub
%>
==================
doit.asp
==================
<%
DIM crDescendingOrder, crAscendingOrder
DIM xdsn, xdb, ruser, rpass
crDescendingOrder = 1
crAscendingOrder = 0
xdsn = "SYSTEM_DSN_NAME_GOES_HERE"
xdb = "database name used by system dsn goes here"
ruser = "username" ' ignored if using windows authentication only
rpass = "password" ' ignored if using windows authentication only
DIM reportname
reportname = "whatever.rpt"
' this assumes the rpt file lives in the
' same directory as the other asp pages
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->
<%
set crtable = session("oRpt").Database.Tables.Item(1)
crtable.SetLogonInfo cstr(xdsn), cstr(xdb), cstr(ruser), cstr(rpass)
%>
<!-- #include file="MoreRequiredSteps.asp" -->
<!-- #include file="SmartViewerActiveX.asp" -->
<%
' the above 3 include files are available
' for free from crystal decisions
' just search on the file names on their
' support page to get them
%>
This is from a working system I have in production, minus some user
interface stuff. That system is using CR8.5, but it should work the
same with CR9.0 for you.
hth,
swp