Skip to Content
0
Former Member
Sep 21, 2008 at 08:34 AM

migrate crystal reports from asp to asp.net

47 Views

Hi,

I want to migrate crystal reports from asp to asp.net 2003...Below is the sample asp code...how to do this in asp.net

'*** ASP **************************************

<%

If IsObject(session("oApp")) then

set session("oApp") = nothing

end if

Set session ("oApp") = Server.CreateObject("Crystal.CRPE.Application")

If isObject(session("oRpt")) then

set session("oRpt") = nothing

End If

Blah....blah...blah......

'=======================================================================

' WORKING WITH THE REPORT DESIGNER COMPONENT AND ASP TO PREVIEW A REPORT

'=======================================================================

reportname = "ABC.rpt"

'==================================================================

' ALWAYS REQUIRED STEPS

%>

<!-- #include file="AlwaysRequiredSteps.asp" -->

<%

'==================================================================

' WORKING WITH THE REPORT PARAMETER COLLECTION

'The following section shows setting single valued parameters of various data types.

Session("oRpt").ParameterFields.GetItemByName("MONTH").AddCurrentValue(CDbl(strMonth))

Session("oRpt").ParameterFields.GetItemByName("RATE").AddCurrentValue(CStr(strRate))

'==================================================================

' MORE ALWAYS REQUIRED STEPS

%>

<!-- #include file="MoreRequiredSteps.asp" -->

<!-- #include file="SmartViewerActiveX.asp" -->