![]() |
Problema Con Vb.net Y Cr Hola a todos PROBLEMA CON CRYSTAL REPORT EN VB.NET Tengo una aplicación web generada con vb.net 2002 en windows xp y le he insertado un CrystalReportViewer vinculado a un informe CrystalReport ubicado en el mismo equipo. En tiempo de diseño la conexión la realiza sin problemas, sin embargo al ejecutarla genera el siguiente error : CrystalDecisions.CrystalReports.Engine.LogOnExcept ion : No es posible conectar. Algunos detalles técnicos : El reporte esta vinculado a una base de datos SQL server 2000 personal edition El vínculo del CrystalReportViewer al reporte fue realizado con la propiedad reportsource a través de una expresión de enlace personalizada en la que se indica la ruta de acceso al mismo OJALA ME PUEDAN AYUDAR ... SALUDOS Patricio |
Hola, estoy seguro que este ejemplo te servira, se pasa la informacion de conexion al reporte. En si, es un reporte basico que crea una instancia de un reporte llamado TenMostExpensiveProducts.rpt, el cual usa un procedimiento almacenado, solo basta con que pongas tu nombre de reporte. y definas los datos de conexion. Private Sub btnPreviewBasicReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreviewBasicReport.Click ' In this event the Ten Most Expensive Products Report is loaded ' and displayed in the crystal reports viewer. ' Objects used to set the proper database connection information Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo ' Create a report document instance to hold the report Dim rptExpensiveProducts As New ReportDocument() Try ' Load the report rptExpensiveProducts.Load("..\TenMostExpensiveProd ucts.rpt") ' Set the connection information for all the tables used in the report ' Leave UserID and Password blank for trusted connection For Each tbCurrent In rptExpensiveProducts.Database.Tables tliCurrent = tbCurrent.LogOnInfo With tliCurrent.ConnectionInfo .ServerName = "tu servidor" .UserID = "tu usuario del servidor" .Password = "su contraseña" .DatabaseName = "la basededatos usada" End With tbCurrent.ApplyLogOnInfo(tliCurrent) Next tbCurrent ' Set the report source for the crystal reports ' viewer to the report instance. crvBasic.ReportSource = rptExpensiveProducts ' Zoom viewer to fit to the whole page so the user can see the report crvBasic.Zoom(2) Catch Exp As LoadSaveReportException MsgBox("Incorrect path for loading report.", _ MsgBoxStyle.Critical, "Load Report Error") Catch Exp As Exception MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error") End Try End Sub |
Hola, Gracias por tu respuesta, pero tengo un problema para ejecutarla y es que el código no me reconoce los elementos ReportDocument() y LoadSaveReportException Que puedo hacer ??? Gracias y Saludos Patricio |
RESULTÓ Gracias, Gracias, Gracias ... Después de algunos pequeños ajustes funcionó ... Saludos Patricio |
| La zona horaria es GMT -6. Ahora son las 17:55. |
Desarrollado por vBulletin® Versión 3.8.7
Derechos de Autor ©2000 - 2026, Jelsoft Enterprises Ltd.