Sitemap

Amicuk Programming Answers

Viewer shows data multiple times

-0001-11-30   Views:0

Advertisement

Hello everybody, after the answer i got from the thread  , i edited my code. But i got the problem, that i received the data multiple times. The information are still the same like written in the other thread. I work on three tables: Adressen, Auftra

Hello everybody,
after the answer i got from the thread  , i edited my code.
But i got the problem, that i received the data multiple times.
The information are still the same like written in the other thread.
I work on three tables: Adressen, Auftragseingang and Arbeitspläne.
In the detail section of the Report i want to show the data of the table Arbeitspläne and in the header section i want to show data of the tables Adressen and Auftragseingang.
This is the code i wrote:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.Shared;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Windows.Forms;
namespace CrystalReportsApplication1
    public partial class Form1 : Form
        public Form1()
            InitializeComponent();
        private void button1_Click(object sender, EventArgs e)
            SqlConnection connection = new SqlConnection("Data Source=SRVVMSQL001.de.eurodok.org;Initial Catalog=PROPLANOrg;Integrated Security=True");
            SqlCommand command;
            DataSet ds;
            try
                command = new SqlCommand();
                command.Connection = connection;
                command.CommandType = CommandType.Text;
                command.CommandText = "SELECT * FROM Auftragseingang, Arbeitspläne, Adressen WHERE Auftragseingang.[Auftrag-Nr] = 113 AND Auftragseingang.Kundennummer = Adressen.Kundennummer AND Auftragseingang.[Zeichnung-Nr] = Arbeitspläne.[Zeichnung-Nr]";
                connection.Open();
                SqlDataAdapter dataAdapter = new SqlDataAdapter(command);
                ds = new DataSet("ABC");
                dataAdapter.Fill(ds, "Auftragseingang");
                dataAdapter.Fill(ds, "Adressen");
                dataAdapter.Fill(ds, "Arbeitspläne");
                CrystalReport1 cryRpt = new CrystalReport1();
                cryRpt.SetDataSource(ds);
                crystalReportViewer1.ReportSource = cryRpt;
                crystalReportViewer1.Refresh();
                SqlDataReader dataReader;
                int i = 0;
                dataReader = command.ExecuteReader();
                while (dataReader.Read())
                    i++;//hier werden die ausgelesenen Datensätze gezählt
                MessageBox.Show("Message: Anzahl Datensätze: " + i);//hier kommt der richtige wert raus, was die Anzahl der Datensätze angeht||jedoch wird im Report ein vielfaches angezeigt
            catch (Exception ex)
                MessageBox.Show("Message:
" + ex.Message + "
" +
                                 "Data:
" + ex.Data + "
" +
                                 "InnerException:
" + ex.InnerException + "
" +
                                 "StackTrace:
" + ex.StackTrace + "
" +
                                 "TargetSites:
" + ex.TargetSite,
                                 "[" + ex.Source + "] FEHLER - Programm wird beendet.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            finally
                connection.Close();

The replay answer
Advertisement
More than likely that is a table linking or report design issue. In either case, the best thing to do will be to post the query to the [SAP Crystal Reports Design|SAP Crystal Reports, version for Visual Studio; forum. When you post to that forum, a link to a screenshot will also be helpful.
Umm, also you mention that the answer on the other tread (Report shows no data in the Viewer )  was correct and helped you to resolve the issue of displaying the report in the viewer. Yet all you appear to have done is closed the thread without awarding any points(?).
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Go to See the other 4 answers

Viewer shows data multiple times

Category:DefaultRelease time:-0001-11-30Views:130

Hello everybody, after the answer i got from the thread  , i edited my code. But i got the problem, that i received the data multiple times. The information are still the same like written in the other thread. I work on three tables: Adressen, Auftra[More]

Want to update data in a view based on multiple tables

Category:DefaultRelease time:2015-10-11Views:130

Hi I am facing a problem i want to update data in tables using a view. As that view is based on multiple tables so i am unable to update data. i came to know we can update table from view only if view is based on single table. so if anyone knows any[More]

Getting an error while viewing a data in owb

Category:DefaultRelease time:2015-10-11Views:130

Hi, I created an External table based on a flat file. But I am not able to view the data in the external table while the flat file has the data. I am using this external table as a source in my mapping but no data is getting loaded even after the suc[More]

Can't view my data on my table in EM

Category:DefaultRelease time:2015-10-11Views:130

Can anyone tell me why I am getting the error below after executing my control file and also why I can't view that data which was loaded. SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 12 16:28:57 2007 Copyright (c) 1982, 2005, Oracle. All ri[More]

Can't view changed data in journal data

Category:DefaultRelease time:2015-10-11Views:130

Hi, I have implemented JKM Oracle 10g Consistent Logminer on Oracle 10g with the following option. - Asynchronous_mode : yes - Auto_configuration : yes 1. Change Data Capture -> Add to CDC, 2.Subscriber->subscribe (sunopsis), 3. Start Journal The jo[More]

I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

Category:DefaultRelease time:2015-10-11Views:130

I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.You don't need an application, just plug a compaitble monitor into the[More]

When attempting to view the date track history for one employee, errors out

Category:DefaultRelease time:2015-10-11Views:130

Hi All When I attempt to view the date track history for one employee, it gives errors. To get the details, the navigation is : 1. Search for employee xxxxxx 2. click on Assignment button 3. click on Date Track History. 4. Receive error APP-DT-52554.[More]

Not able to view XML data

Category:DefaultRelease time:2015-10-11Views:130

Hello All, I want to generate xml data file from sql query.So i created a new report and new data model whose type is SQL query and following is the query select p.name as name,s.size_desc as sizes,sum(f.quantity) as quantity from s_article_poc14073[More]

Unable to  view the data in infoobject

Category:DefaultRelease time:2015-10-11Views:130

Hi all, I am loading the data to info-obj this is the first time i am working on BI 7. everything is successfull. i had created the transformation and dtp successfully n in monitor screen its showing that the data has been loaded sucessfully. the thi[More]

I can view the data in front end form, but data is not avilable in backend

Category:DefaultRelease time:2015-10-11Views:130

Hi, i created a form with three blocks.In first block i entered the data.Based on the data it will fetch recodrs from A & B tables and insert into C table.This logic i have written in backend and put commit in front end and back end. In the 2nd block[More]

How to add an index to a materialized view in Data Modeler 3.3

Category:DefaultRelease time:2015-10-11Views:130

Hello everyone, I'm looking for a how-to to add an index to a materialized view in Data Modeler 3.3.0.747, as I coudn't find a way to do it so far. I looked here: Relational Model Physical Model Oracle 11g Materialized Views "my_mv_name" "I[More]

Hot
So I got a new iPhone 4...when I synced it and set it up etc, my iTunes was totally wiped. Now when I access the store it says I have no albums/playlists etc. I have a horrible feeling it may be due to the fact I randomly set up a new apple id for th [More]
how can i memorize the finder cover flow zone size respect the file list one? if i have 1 finder window open and i open another one il will keep the same proportion, but if i close all it will start with the initial cover flow sizeI am having a simil [More]
I am on 3.6.19 Foxfire. I CAN get downloads of financial statements.When I switched to 5, then 6 beta, I could no longer get downloads from them. I went back to 3.6.19 and I can can them. I keep getting notices to go to 5. so I tried it and adobe wou [More]
Hi everyone, Here is my situation. I have a G5 currently running 10.3.9 which is my main computer for all my work. I purchased a Mac Mini not too long ago as a back up/special task computer that runs 10.4.2. I just purchased Techtool Pro 4, and it re [More]
Hello I saw SAML claims-based authentication process flow diagram  on http://msdn.microsoft.com/en-us/library/office/hh394901(v=office.14).aspx . Please let me know where I will get the visio of this file.   Regards AvianWhat makes you think that suc [More]
I am using a HP Laser Jet 1536dnfMFP in our office but not wireless. I just use it to make copies. This morning it wasn't working so I turned it off and unplugged it. When I turned it back on the toner light and exclamation point light was on. I chan [More]
Where I work, we have a group/team conversation for people to ask questions, make comments, share information, etc. In the past few weeks I have noticed that I have been being removed from this group conversation.  Find the message "You have been rem [More]
Just installed iLife 08 from a family pack w/4 unused licenses. iMovie didn't update because my G4 is incompatible but everything else did. I ran Software Update and it now says everything's up to date. Also repaired permissions. When I start iPhoto, [More]
Hi, I have tried to change the contents of my XML report generated in TS3.1 by changing the PropFlags_IncludeInReport. This works for some simple data types like numericteststep where I have removed the limits and step result from the report if the s [More]
Within our company we have a discussion if we shall use the out-of-the-box Oracle ERP adapter to integrate to Oracle e-Business Suite or if we shall develop our own web service & WMQ to get it loosely coupled between SIM and EBS. The main reason we c [More]