CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Español

 Crystal Reports Parts

Print topic Send  topic

Author Message
Andres Rormoser
Posted: 11/24/2005, 10:51 PM

Si quieren agregar Crystal Reports Graficos, Gauges, etc a sus paginas sigan los pasos a
continuacion:

+Install Crystal Report Server
+Add a Label with property Content Type=HTML
+Add a BeforeShow Event to this label
+Add the following custom code:
form1.label1.Value = DisplayReport("hs/reportes/Dashboard.rpt","Cashflow")
+Add the following custom code to common.asp:
' Funcion que la usa la funcion DisplayReport
Function EnsureImageCleanerIsRunning()
' The ImageCleaner is already running.
If Session("imageCleanerRunning") Then
Exit Function
' Start the ImageCleaner
Else
Dim imageCleaner
Set imageCleaner = Server.CreateObject("CrystalReports.CrystalImageCleaner")
' Sets the ImageCleaner to scan once per minute and delete
' images once per two minutes.
imageCleaner.Start 60000, 120000

' Store a flag in session to check if the ImageCleaner is running.
Session("imageCleanerRunning") = True
Set EnsureImageCleanerIsRunning = imageCleaner
End If
End Function

' Funcion que la usa la funcion DisplayReport
Sub StopImageCleaner(imageCleaner)
' Stop the ImageCleaner and set the session flag to indicate it has stopped
If Session("imageCleanerRunning") = True Then
imageCleaner.Stop
Session("imageCleanerRunning") = False
End If
End Sub

' Funcion para mostrar un ReportPart Crystal Reports
Function DisplayReport(targetReport, objectName)
Dim iStore
Dim rasServer
Dim Username
Dim Password
Dim reportSource
Dim allowDrill
Dim viewerToLaunch
rasServer = "server"
Username = "sa"
Password = "balbbalbala"

' Get the viewer and report to use from the Session.
Session("viewerToLaunch") = "partViewer"
allowDrill = False
viewerToLaunch = Session("viewerToLaunch")

' Crea entorno de reporte
Dim objectFactory
Set objectFactory = CreateObject("CrystalReports11.ObjectFactory.1")
Dim reportAppSession
Set reportAppSession = objectFactory.CreateObject( "CrystalReports.ReportAppSession")
reportAppSession.ReportAppServer = rasServer
reportAppSession.Initialize

' Setea el server RAS y el reporte
Dim reportClientDocument
Set reportClientDocument = objectFactory.CreateObject(
"CrystalReports.ReportClientDocument")
reportClientDocument.ReportAppServer = rasServer
reportClientDocument.Open(targetReport)
Set reportSource = reportClientDocument.ReportSource

' Set up an ImageCleaner
Dim imageCleaner
Set imageCleaner = EnsureImageCleanerIsRunning

' Report part definitions.
Dim ReportParts
Set ReportParts = CreateObject("CrystalReports.CrystalReportPartsDefinition")

Dim Nodes
set Nodes = ReportParts.ReportPartNodes

' Initially, display Graph1 from the World Sales Report.
Dim node0
Set node0 = CreateObject("CrystalReports.CrystalReportPartNode")
node0.Name = objectName
Nodes.Add (node0)

Dim HTMLPartsViewer
Set HTMLPartsViewer = objectFactory.CreateObject(
"CrystalReports.CrystalReportPartsViewer" )

' Setea el logon a la base de datos
Dim ConInfo
Set ConInfo = objectFactory.CreateObject("CrystalReports.ConnectionInfo")
ConInfo.UserName = Username
ConInfo.Password = Password
Dim ConInfos
Set ConInfos = objectFactory.CreateObject("CrystalReports.ConnectionInfos")
ConInfos.Add ConInfo

Dim Fields
Fields = Session("Fields")

' Set the viewer options.
With HTMLPartsViewer
' Don't allow drill down in this example.
.EnableDrillDown = False
.DatabaseLogonInfos = ConInfos
if Fields <> null then
.ParameterFields = Fields
end if
.ReportSource = reportSource
.ReportParts = ReportParts
.PreserveLayout = False
.Name = "HTMLParts_NoDrillName"
.IsOwnForm = False
.IsOwnPage = False
End With

' Show the report.
DisplayReport = HTMLPartsViewer.GetHtmlContent(Request, Response, Session)

'Stop the ImageCleaner now that the viewing is complete.
StopImageCleaner(imageCleaner)
End Function


lvalverdeb

Posts: 299
Posted: 11/25/2005, 9:05 AM

Gracias por compartir estas ideas. Sabes si crystal reports corre tambien en Linux?

Luis
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4
View profile  Send private message
Andres Rormoser
Posted: 11/30/2005, 6:57 AM

De nada.

en unix creo que si. no se en linux.

"lvalverdeb" <lvalverdeb@forum.codecharge> wrote in message
news:3043874470ab706@news.codecharge.com...
Gracias por compartir estas ideas. Sabes si crystal reports corre tambien en
Linux?

Luis
---------------------------------------
Sent from YesSoftware forum
http://forums.codecharge.com/


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.