Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Thimape

Tipos de relatorios em asp

Recommended Posts

Ola,

 

Gostaria de saber se existe uma maneira de fazer relatorios em asp sem o crystal reports...

E se existe algum programa que leia os relatorios do crystal reports..

 

VLW

Compartilhar este post


Link para o post
Compartilhar em outros sites

dá sim, té com excel, vcocê consegue gerar relatórios, de um pesquisada no forum que eu coloquei um exemplo....

Compartilhar este post


Link para o post
Compartilhar em outros sites

vlw ,

mas nao tem nada parecido com o crystal nao?

algo que abra os arquivos do crystal?

 

e porque ja tenho tudo feito com o crystal ,so que apos uma migração para o server 2008 parou de funcionar...

Compartilhar este post


Link para o post
Compartilhar em outros sites

um exemplo de como utilizar o Crystal Reports

 

<%
Set RsAcao = Server.CreateObject("Adodb.recordset")
	RsAcao.Open "Select * from contatos where cod=" & request("Cod"),conntemp,2,2,1
	
Set RsEquipe = Server.CreateObject("adodb.recordset")
	RsEquipe.Open "Select * from equipes where equipe='" & RsAcao("CorFicha") & "'",Conntemp,2,2,1
	
	If RsEquipe.EOF then
  Response.Write "Equipe não encontrada, selecione uma equipe válida e retorne a solicitar o susbstalecimento"
  Response.End
	End if 
	
	if RsAcao("Ativo_Passivo") = "2 - Ativo" then
	reportname = "Substalecimento.rpt"
	else
	reportname = "Substalecimento_Passivo.rpt"
	end if
					 
If IsObject(session("oApp")) Then							  
  Set Session("Oapp") = Nothing
End if

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



Path = Request.ServerVariables("PATH_TRANSLATED")					 
While (Right(Path, 1) <> "\" And Len(Path) <> 0)					  
iLen = Len(Path) - 1												  
Path = Left(Path, iLen) 
Wend																  
'Response.Write "<BR>" & Path & ReportName & "?Cod=" & request("Cod")


If IsObject(session("oRpt")) then
	Set session("oRpt") = nothing
End if

On error resume next

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

If Err.Number <> 0 Then
  Response.Write "Error Occurred creating Report Object: " & Err.Description
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing
  Response.End
End If

session("oRpt").MorePrintEngineErrorMessages = False
session("oRpt").EnableParameterPrompting = False

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

==========
'Defining the Selection Formula
'============================================================================

==========
session("oRpt").DiscardSavedData

	
If RsAcao("Ativo_Passivo") = "2 - Ativo" then
	sAutor = RsAcao("Autor")
	sReu = RsAcao("Reu")
	Adv = rsAcao("Advogado")
	Tamanho = Len(Adv)
	sCod_Adv = Mid(Adv,Tamanho - 3)
	sComarca = RsAcao("Comarca")
	sRito = RsAcao("Rito")
	If uCASE(sRito) = "SUMÁRIA" oR uCASE(sRito) = "SUMARIA" then
  sRito = "REGRESSIVA DE RESSARCIMENTO"
	END IF
	sAdvogado = RsEquipe("Equipe")
	sOAB = RsEquipe("OAB")

	Set session("ParamCollection") = Session("oRpt").Parameterfields			  
										  
				   
Set Param3 =  session("ParamCollection").Item(3)
Call Param3.SetCurrentValue (CStr(sAdvogado), 12) 

Set Param4 =  session("ParamCollection").Item(1)
Call Param4.SetCurrentValue (CStr(sRito), 12)

Set Param5 =  session("ParamCollection").Item(2)
Call Param5.SetCurrentValue (CStr(sReu), 12)

Set Param7 =  session("ParamCollection").Item(4)
Call Param7.SetCurrentValue (CStr(sOAB), 12)  

Set Param12 =  session("ParamCollection").Item(5)
Call Param12.SetCurrentValue (CStr(sAutor), 12)  
else


	sReu = RsAcao("Autor")
	SNprocesso = rsAcao("Nprocesso")
	sVara = rsAcao("Vara")
	Adv = rsAcao("Advogado")
	Tamanho = Len(Adv)
	sCod_Adv = Mid(Adv,Tamanho - 3)
	sComarca = RsAcao("Comarca")
	sEstado = RsAcao("Estado")
	sRito = RsAcao("Rito")
	sAdvogado = RsEquipe("Equipe")
	sOAB = RsEquipe("OAB")
	

Set session("ParamCollection") = Session("oRpt").Parameterfields			  
										  
				   
Set Param1 =  session("ParamCollection").Item(1)
Call Param1.SetCurrentValue (Trim(sCod_Adv))

Set Param3 =  session("ParamCollection").Item(3)
Call Param3.SetCurrentValue (Trim(sAdvogado)) 

Set Param4 =  session("ParamCollection").Item(4)
Call Param4.SetCurrentValue (Trim(sRito))

Set Param5 =  session("ParamCollection").Item(5)
Call Param5.SetCurrentValue (Trim(sReu))

Set Param7 =  session("ParamCollection").Item(7)
Call Param7.SetCurrentValue (Trim(sOAB))

Set Param8 =  session("ParamCollection").Item(8)
Call Param8.SetCurrentValue (Trim(sNprocesso))

Set Param9 =  session("ParamCollection").Item(9)
Call Param9.SetCurrentValue (Trim(sVara))		

Set Param10 =  session("ParamCollection").Item(10)
Call Param10.SetCurrentValue (Trim(sComarca))	

Set Param11 =  session("ParamCollection").Item(11)
Call Param11.SetCurrentValue (Trim(sEstado)) 



End if
	
	
	
	If Not IsNumeric(Cod_Adv)then
	Response.Write "Atualize o advogado...........O Sistema não pode gerar o Substalecimento"
	RsAcao.Close
	Set RsAcao = Nothing
	Response.End
	End if
	
	RsAcao.Close
	Set RsAcao = Nothing
Session("oRpt").RecordSelectionFormula = "{Lista.Cod}=" & sCod_Adv

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

========
' Retrieve the Records and Create the "Page on Demand" Engine Object
'============================================================================

========

On Error Resume Next
session("oRpt").ReadRecords

If Err.Number <> 0 Then											   
  Response.Write "Error Occurred Reading Records: " & Err.Description & "2"
  Set Session("oRpt") = nothing
  Set Session("oApp") = nothing
' Session.Abandon
  Response.End
Else
  If IsObject(session("oPageEngine")) Then							  
 	 set session("oPageEngine") = nothing
  End If
  set session("oPageEngine") = session("oRpt").PageEngine
End If

' INSTANTIATE THE CRYSTAL REPORTS SMART VIEWER
'
'When using the Crystal Reports automation server in an ASP environment, we use
'the same page on demand "Smart Viewers" used with the Crystal Web Report Server.
'The are four Crystal Reports Smart Viewers:
'
'1.  ActiveX Smart Viewer
'2.  Java Smart Viewer
'3.  HTML Frame Smart Viewer
'4.  HTML Page Smart Viewer
'
'The Smart Viewer that you use will based on the browser's display capablities.
'For Example, you would not want to instantiate the Java viewer if the browser
'Line 200
'did not support Java applets.  For purposes on this demo, we have chosen to
'define a viewer.  You can through code determine the support capabilities of
'the requesting browser.  However that functionality is inherent in the Crystal
'Reports automation server and is beyond the scope of this demonstration app.
'
'We have chosen to leverage the server side include functionality of ASP
'for simplicity sake.  So you can use the SmartViewer*.asp files to instantiate
'the smart viewer that you wish to send to the browser.  Simply replace the line
'below with the Smart Viewer asp file you wish to use.
'
'The choices are SmartViewerActiveX.asp, SmartViewerJave.asp,
'SmartViewerHTMLFrame.asp, and SmartViewerHTMLPAge.asp.
'Note that to use this include you must have the appropriate .asp file in the 
'same virtual directory as the main ASP page.
'
'*NOTE* For SmartViewerHTMLFrame and SmartViewerHTMLPage, you must also have
'the files framepage.asp and toolbar.asp in your virtual directory.

Tree = "0"
viewer = "ActiveX"
'viewer = "Java using Browser JVM"
Pre = 0

'This line collects the value passed for the viewer to be used, and stores
'it in the "viewer" variable.

If cstr(viewer) = "ActiveX" then
%>
<!-- #include file="Teste_Crystal.asp" -->
<%
ElseIf cstr(viewer) = "Java using Browser JVM" then
%>
<!-- #include file="SmartViewerJava.asp" -->
<%
ElseIf cstr(viewer) = "HTML" then
Response.Redirect "rptserver.asp"

End if
'The above If/Then/Else structure is designed to test the value of the "viewer" varaible
'and based on that value, send down the appropriate Crystal Smart Viewer.
%>

E a página que processa o rptserver abaixo "teste_crystal.asp"

 

'This file contains the HTML code to instantiate the Smart Viewer ActiveX.	  
'																	 
'You will notice that the Report Name parameter references the rptserver.asp file.
'This is because the report pages are actually created by rptserver.asp.
'Rptserver.asp accesses session("oApp"), session("oRpt") and session("oPageEngine")
'to create the report pages that will be rendered by the ActiveX Smart Viewer.
'
%>
<HTML>
<HEAD>
<TITLE>Seagate ActiveX Viewer</TITLE>
</HEAD>
<BODY BackGround="\preregistro/images/fundo.jpg" ONUNLOAD="CallDestroy();">

<OBJECT ID="CRViewer" CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A" WIDTH="100%" HEIGHT="100%"
CODEBASE="_Fpclass/activexviewer.cab#Version=8,0,0,224">
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE="<%=Tree%>">
<PARAM NAME="DisplayGroupTree" VALUE="<%=Tree%>">
<PARAM NAME="EnablePrintButton" VALUE="1">
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnablePopupMenu" VALUE=1>
<PARAM NAME="EnableToolbar" VALUE=1>
<PARAM NAME="DisplayTabs" VALUE=1>
</OBJECT>

<script LANGUAGE="VBScript">
<!--
Sub Window_Onload
	On Error Resume Next
	Dim webBroker
	Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
	if ScriptEngineMajorVersion < 2 then
  window.alert "IE 3.02 users on NT4 need to get the latest version of VBScript or install IE 4.01 SP1. IE 3.02 users on Win95 need DCOM95 and latest version of VBScript, or install IE 4.01 SP1. These files are available at Microsoft's web site."
  CRViewer.ReportName = Location.Protocol + "//" + Location.Host + "/scrsamples/Web Component Server/rptserver.asp"
	else
  Dim webSource
  Set webSource = CreateObject("WebReportSource.WebReportSource")
  webSource.ReportSource = webBroker
  webSource.URL = "Crystal/Rptserver.asp"
  'Msgbox webSource.URL
  webSource.PromptOnRefresh = True
  CRViewer.ReportSource = webSource
	end if
	CRViewer.ViewReport
End Sub
-->
</SCRIPT>

<script language="javascript">
function CallDestroy()
{
	window.open("Cleanup.asp");
}
</script>

</BODY>
</HTML>
<%

Compartilhar este post


Link para o post
Compartilhar em outros sites

tente reinstalar o crystal reports

Compartilhar este post


Link para o post
Compartilhar em outros sites

teste em outra maquina e tambem no localhost

Compartilhar este post


Link para o post
Compartilhar em outros sites

para teste tente o code que coloque acima, para ver o relyado.su

Compartilhar este post


Link para o post
Compartilhar em outros sites

verifique a instação e configração

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara creio que nao seja esse o problema nao,pois nao a quase nada para configurar no crystal ,

e o que tinha pra configurar no iis ja foi feito

 

Alguem sabe se o crystal R 8 funciona no windows server 2008 R2?

 

Nao sei mais o que fazer...

alguem por favor da uma ajuda ai...

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.