Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: VB.NET 2008 CrystalReports Post Reply Post New Topic
Author Message
Manda
Newbie
Newbie


Joined: 24 Oct 2011
Online Status: Offline
Posts: 1
Quote Manda Replybullet Topic: VB.NET 2008 CrystalReports
    Posted: 24 Oct 2011 at 10:35pm
Hello,

excuse my english its not that good, but I try my best.
I want to make a CrystalReport without using the CrystalReportViewer or any Databases/DataSets.

I have an ObjectList (just like a ListView) which I filled with 10 elements (ID,Name,Description). Now I am trying to export this list to .pdf

Here I am trying to fill the list:


Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click

    Dim itemList As List(Of DataHelper) = New List(Of DataHelper)

    For i As Integer = 1 To 10 Step 1
        itemList.Add(New DataHelper(String.Format("Name {0:00000}", i), String.Format("Desc {0:00000}", i)))
    Next

    m_ObjectListView.AddObjects(itemList)
End Sub


Here I am calling the function:

Private Sub btnPdf_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPdf.Click Dim report As DataFormatter = New DataFormatter report.WriteReportToPDF(m_ObjectListView) End Sub


Here I am trying to export it: And I am stuck here!! Please Help!!

Public Sub WriteReportToPDF(ByVal _list As BrightIdeasSoftware.ObjectListView) Implements IDataFormatter.WriteReportToPDF Dim cr As ReportDocument = New ReportDocument Try cr.SetDataSource(_list) cr.ExportToDisk(ExportFormatType.PortableDocFormat, "Report") Catch ex As Exception ex.Message.ToString(ex) End Try End Sub


I am just a beginner with CrystalReports, so that means I dont have
much experience. The problem ist the "WriteReportToPDF".
Thanks in advance!!!

Greetings
Manda
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.