Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Fr Jul 18, 2025 07:58

Foren-Übersicht » Programmierung » Allgemein
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Mo Jun 18, 2007 15:25 
Offline
DGL Member

Registriert: Mi Okt 16, 2002 15:06
Beiträge: 1012
Serv,

ich kämpf hier grad mit .NET 2.0 und Crystal Reports rum.
Die letzte will einfach nicht funktionieren, egal was ich dran verändere.

Es kommt immer ein fehler, sobald ich das Datasource auf das Dataset setze :(

Meine Datenquelle ist eine CSV Datei, spalten sind mit "," getrennt !

Code:
  1.  
  2.         ' Create a dataset for the report from the CSV file
  3.         Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & System.IO.Path.GetDirectoryName(tempcsv) & ";Extended Properties=Text;"
  4.         Dim objConn As New System.Data.OleDb.OleDbConnection(sConnectionString)
  5.         objConn.Open()
  6.  
  7.         ' New adapter
  8.         Dim objAdapter1 As New System.Data.OleDb.OleDbDataAdapter("SELECT * FROM " & System.IO.Path.GetFileName(tempcsv), objConn)
  9.  
  10.         ' New dataset
  11.         Dim objDataset1 As New DataSet
  12.         objAdapter1.Fill(objDataset1, "Report1")
  13.  
  14.         ' Init report
  15.         Dim myReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
  16.  
  17.         If myReport Is Nothing Then
  18.             objConn.Close()
  19.             Logfile.AddEntry("ERROR: Unable to create crystal report object")
  20.             Exit Function
  21.         End If
  22.  
  23.         ' Load template
  24.         Try
  25.             myReport.Load(myCfg.TemplateDir & "\" & ticket.Template)
  26.         Catch ex As Exception
  27.             objConn.Close()
  28.             Logfile.AddEntry("ERROR: Unable to open template '" & myCfg.TemplateDir & "\" & ticket.Template & "'")
  29.             Exit Function
  30.         End Try
  31.  
  32.         ' Load data into report
  33.         myReport.SetDataSource(objDataset1) ' Hier kracht es !!! mit dem fehler: "The report has no tables."
  34.  
  35.  


Kennt sich wer damit aus, weil ich hab davon 0 plan :(


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Jun 18, 2007 18:09 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I know a bit about crystal report, but not about importing csv.

1. Is the date structure known in the report e.g. does it know the fields?
2. If you put a breakpoint the line where you set the datasource for crystal report and take a look in your datasource how does it look there? Does it have an table there? Is it having the same name as in your report.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jun 19, 2007 09:21 
Offline
DGL Member

Registriert: Mi Okt 16, 2002 15:06
Beiträge: 1012
Zitat:
1. Is the date structure known in the report e.g. does it know the fields?

Dunno, a got the report template from an ex-employee from our company.

Hmm i tried to open the report template, but the extension is not known.
I see an icon, but Win cant open it :(

And i dont see a menuentry in Visual Studio for it :(

How i can open the report and edit it ?

Zitat:
2. If you put a breakpoint the line where you set the datasource for crystal report and take a look in your datasource how does it look there? Does it have an table there? Is it having the same name as in your report.


The data are correct, i exported it via Dataset.WriteXML and it seems fine.
There are also tables, one exactly.

Thanks for your reply =)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Jun 19, 2007 20:40 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Is the extension rtp? If yes then you should be able to edit it from within visual studio.
Also the name of the table and fields used within the report should match the dataset you provided.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Jul 11, 2007 09:23 
Offline
DGL Member

Registriert: Mi Okt 16, 2002 15:06
Beiträge: 1012
I got it working, it was like you explained.
I modifier the report template file and it worked.

Thanks


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Foren-Übersicht » Programmierung » Allgemein


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 16 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.008s | 15 Queries | GZIP : On ]