CRYSTAL REPORTS 13 E VB 2010

MALA 28/07/2015 19:53:43
#449336
OLA A TODOS

TEM COMO USAR O CRYSTAL 13 NO VB 2010 COMO NO VB6 RDC, OU UMA OUTRA MANEIRA SEM DATASET COM RECORDSET.

DESDE JA AGRADEÇO A ATENÇÃO DE TODOS.
TUNUSAT 29/07/2015 07:46:23
#449347
Resposta escolhida
MALA,

Por favor, veja:

==========================================
VB.NET 2008 - Imprimindo com PrintDocument
http://www.macoratti.net/08/04/vbn8_imp.htm
Dim cmd As OleDbCommand
Private paginaAtual As Integer = 1
Private MyConnection As OleDbConnection
Private Leitor As OleDbDataReader
Private RelatorioTitulo As String

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
[ô]obtem a string de conexao
MyConnection = New OleDbConnection([Ô]Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:    este\Teste.mdb[Ô])

[ô]define o titulo do relatorio
RelatorioTitulo = [Ô]Lista de Clientes - [Ô]

[ô]define os objetos printdocument e os eventos associados
Dim pd As Printing.PrintDocument = New Printing.PrintDocument()

[ô]IMPORTANTE - definimos 3 eventos para tratar a impressão : PringPage, BeginPrint e EndPrint.
AddHandler pd.PrintPage, New Printing.PrintPageEventHandler(AddressOf Me.pdRelatorios_PrintPage)
AddHandler pd.BeginPrint, New Printing.PrintEventHandler(AddressOf Me.Begin_Print)
AddHandler pd.EndPrint, New Printing.PrintEventHandler(AddressOf Me.End_Print)

[ô]define o objeto para visualizar a impressao
Dim objPrintPreview As New PrintPreviewDialog

Try
[ô]define o formulário como maximizado e com Zoom

With objPrintPreview
.Document = pd
.WindowState = FormWindowState.Maximized
.PrintPreviewControl.Zoom = 1
.Text = [Ô]Relacao de Clientes[Ô]
.ShowDialog()
End With

Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End Sub


==========================================
got reportviewer?
http://gotreportviewer.com/
==========================================
Relatórios em VB 2010
http://forum.zwame.pt/threads/relatorios-em-vb-2010.720532/
==========================================
[Resolvido] Criar Relatorios com Report Viewer no VB.Net
http://forum.imasters.com.br/topic/405269-resolvidocriar-relatorios-com-report-viewer-no-vbnet/
Dim StrPastaRelatorio As String
StrPastaRelatorio = String.Concat(Application.StartupPath.ToString(), [Ô]\Clientes.rdlc[Ô])
StrPastaRelatorio = StrPastaRelatorio.Replace([Ô]bin\Debug\[Ô], [Ô][Ô])
ReportViewer1.LocalReport.ReportPath = StrPastaRelatorio

Dados da Conexao
StrConexao = [Ô]Data Source=SERVIDOR[Ô] & _
[Ô];Persist Security Info=True[Ô] & _
[Ô];Initial Catalog=MEU BANCO[Ô] & _
[Ô];User ID=sa[Ô] & _
[Ô];Password=123[Ô]
StrConn.ConnectionString = StrConexao
StrConn.Open()

String de Consulta
StrSQL = [Ô]Select CodCliente, Nome From Clientes[Ô]

Dim Cmd As New SqlCommand(StrSQL, StrConn)
Dim DReader As SqlDataReader

Converter o DataReader para DataTable
Dim DTable As New DataTable([Ô]Clientes[Ô])
DReader = Cmd.ExecuteReader()
DTable.Load(DReader)
DReader.Close()

Definindo o DataSource do Relatorio
Dim NewReporDataSource As ReportDataSource = New ReportDataSource([Ô]Clientes[Ô], DTable)
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.RefreshReport()

==========================================
Visual basic .net crystal report with database and dataset ...
http://www.youtube.com/watch?v=KWUYnQrfKKo
==========================================

[][ô]s,
Tunusat.
Tópico encerrado , respostas não são mais permitidas