Print Page | Close Window

migrate crystal reports from asp to asp.net

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Writing Code
Forum Discription: .NET 2003 programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4317
Printed Date: 27 May 2024 at 3:40pm


Topic: migrate crystal reports from asp to asp.net
Posted By: yasinirshad
Subject: migrate crystal reports from asp to asp.net
Date Posted: 21 Sep 2008 at 1:31am

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" -->              

 



-------------
Thanks,
Yasin.



Replies:
Posted By: hilfy
Date Posted: 22 Sep 2008 at 1:54pm
Take a look at the CrystalReportViewer object.  That's what you'll use to view the report.  You can then go to the Developer Library site ( http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm - http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm ) and click on the Crystal Reports .NET SDK link to get sample code for how to use it.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window