Usuário com melhor resposta
Publicar relatorio Crystal Reports no servidor (ASP.NET VB.NET)

Pergunta
-
Pessoal, fiz um relatorio em crystal 13 e chamo ele atraves de uma pagina asp.net, na maquina de desenvolvimento funciona perfeitamente, porem quando publico no servidor IIS7 ao executar o relatorio recebo a critica abaixo.
Algo que achei estranho, é que nas criticas aparece o path da maquina de desenv. sendo que já esta no servidor.
Server Error in '/' Application. Operação não permitida. Um documento processado pelo mecanismo JRC não pode ser aberto na pilha de C++. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: Operação não permitida. Um documento processado pelo mecanismo JRC não pode ser aberto na pilha de C++. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x80041811): Operação não permitida. Um documento processado pelo mecanismo JRC não pode ser aberto na pilha de C++.] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +147 CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +421 [CrystalReportsException: Falha ao carregar o relatório.] CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +549 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +1613 CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +189 sistemaWeb.report_vnd_proposta1.VisualizarProposta_FPS(Object sender, EventArgs e) in D:\empresa\Projetos\VS\Projetos Visual Studio\VS2010\WEB\sistemaWeb\sistemaWeb\reports\report_vnd_proposta1.aspx.vb:59 System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +304 CrystalDecisions.Web.CrystalReportViewerBase.DataBind() +26 sistemaWeb.report_vnd_proposta1.Button1_Click(Object sender, EventArgs e) in D:\empresa\Projetos\VS\Projetos Visual Studio\VS2010\WEB\sistemaWeb\sistemaWeb\reports\report_vnd_proposta1.aspx.vb:24 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691
Fabiano Pires
Respostas
-
Fabiano,
então o arquivo não estava no caminho final né ?
Agora se não exibe dados vale a pena verificar o código 'crRelatorio.DataBind()
Pois acredito que seja ele que faça o Bind dos seus dados não é ?
Ainda assim como você está apontando para um banco de Homologação, pode ser que não tenham dados ainda.
Att,
Lucio Rogerio
Espero ter ajudado, se ajudei, por favor "Votar como Útil", e se resolvi seu problema, clique em "Marcar/Propor como Resposta".- Marcado como Resposta Fabiano Pires sexta-feira, 5 de junho de 2015 19:38
sexta-feira, 5 de junho de 2015 18:58 -
Lucio, achei a solução no link
http://hasibulhaque.com/index.php/2012/crystal-report-shows-a-blank-page/
Era só eu copiar a pasta \aspnet_client da raiz do iis para a raiz do meu webprojetc
Cause of Problem
-
Using client tools (debug window of your browser) or server
tool (IIS log) you will find that some files (
crv.js
,style.css
) are not served; -
these files are placed by CR installer in
wwwroot\aspnet_client
folder but they cannot be reached; -
If you installed your application in a website different from
Default WebSite
…aspnet_client
folder is not placed inside that website
SolutionThe solution is to work on IIS this way:
-
Copy
aspnet_client
folder fromc:\inetpub\wwwroot
folder to the new website root folder.
or
-
Create a virtual directory called
aspnet_client
that points toc:\inetpub\wwwroot
inside the new website
Fabiano Pires
- Sugerido como Resposta Lucio Rogerio SPBanned sexta-feira, 5 de junho de 2015 19:34
- Editado Fabiano Pires sexta-feira, 5 de junho de 2015 19:38
- Marcado como Resposta Fabiano Pires sexta-feira, 5 de junho de 2015 19:39
-
Using client tools (debug window of your browser) or server
tool (IIS log) you will find that some files (
Todas as Respostas
-
Segue
Private Sub ConfiguraCrystalReports() Dim iPROP_CODIGO As Integer 'iPROP_CODIGO = txtPROP_CODIGO.Text Dim rpt As ReportDocument = New ReportDocument Dim reportPath As String = Server.MapPath("~\reports\RPT_VND_PROPOSTA_COMERCIAL.RPT") rpt.Load(reportPath) Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo myConnectionInfo.ServerName = DB_Server myConnectionInfo.DatabaseName = DB_Banco myConnectionInfo.UserID = DB_User myConnectionInfo.Password = DB_Senha SetDBLogonForReport(myConnectionInfo, rpt) rpt.SetParameterValue("@PROP_CODIGO", iPROP_CODIGO) crRelatorio.ReportSource = rpt 'crRelatorio.DataBind() End Sub Private Sub SetDBLogonForReport(ByVal connectionInfo As ConnectionInfo, ByVal ArquivoReport As ReportDocument) Dim tables As Tables = ArquivoReport.Database.Tables For Each table As CrystalDecisions.CrystalReports.Engine.Table In tables Dim tableLogonInfo As TableLogOnInfo = table.LogOnInfo tableLogonInfo.ConnectionInfo = connectionInfo table.ApplyLogOnInfo(tableLogonInfo) Next End Sub
Fabiano Pires
-
-
-
Achei uma besteira, quando clico em publicar no visual studio os .rpt's não estavam indo, copiei manualmente agora não aparece mais esse erro, porem a pagina que chama o rpt fica em branco e na maquina de desenv. funciona normalmente.
Fabiano Pires
-
Isso mesmo o arquivo não estava lá, agora já arrumei.
Criei outro rpt vazio sem acessar o banco e coloquei uma label chamada "Teste" e no load o codigo abaixo, porem tambem não carrega a pagina fica 100% em branco, não carrega nem o componente CrystalReportViewer vazio, deve ser alguma outra coisa.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim Rpt As New ReportDocument
Dim reportPath As String = Server.MapPath("~\reports\CrystalReport1.rpt")
Rpt.Load(reportPath)
CrystalReportViewer1.ReportSource = Rpt
CrystalReportViewer1.DataBind()
End Sub
Fabiano Pires
-
Lucio, achei a solução no link
http://hasibulhaque.com/index.php/2012/crystal-report-shows-a-blank-page/
Era só eu copiar a pasta \aspnet_client da raiz do iis para a raiz do meu webprojetc
Cause of Problem
-
Using client tools (debug window of your browser) or server
tool (IIS log) you will find that some files (
crv.js
,style.css
) are not served; -
these files are placed by CR installer in
wwwroot\aspnet_client
folder but they cannot be reached; -
If you installed your application in a website different from
Default WebSite
…aspnet_client
folder is not placed inside that website
SolutionThe solution is to work on IIS this way:
-
Copy
aspnet_client
folder fromc:\inetpub\wwwroot
folder to the new website root folder.
or
-
Create a virtual directory called
aspnet_client
that points toc:\inetpub\wwwroot
inside the new website
Fabiano Pires
- Sugerido como Resposta Lucio Rogerio SPBanned sexta-feira, 5 de junho de 2015 19:34
- Editado Fabiano Pires sexta-feira, 5 de junho de 2015 19:38
- Marcado como Resposta Fabiano Pires sexta-feira, 5 de junho de 2015 19:39
-
Using client tools (debug window of your browser) or server
tool (IIS log) you will find that some files (