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
Bom dia pessoal, Tudo bem? Estou com um problema, o seguinte, tenho um processo normal de vendas, crio a ordem, remessa, e documento de faturamento, por ultimo gero a nota fiscal e impressão, mas não esta gerando o numero da nota fiscal, o campo nume [More]
Hi to all, I try to create a new Oracle 11g R1 database using the following script: create database MDO01XXI MAXINSTANCES 1 MAXLOGHISTORY 1752 MAXLOGFILES 8 MAXLOGMEMBERS 2 MAXDATAFILES 666 CHARACTER SET UTF8 NATIONAL CHARACTER SET UTF8 set default S [More]
Hi Gurus, please help me in solving the following issue. 12 leave quota is generated for the employees after they  had completed  working for 240 days (weekly-off and Public holiday's are excluded) and after that every 12 days of working days he will [More]
Hai, My forms were developed using oracle 10g in Windows platform.I have to deploy it in the LINUX application server 10g.I compiled all the forms at AS.One of my form calls another form and it passes parameters to other form.During development I gav [More]
We just gave our son a new 13" MacBook Pro. He is an avid photographer and has transfered his photos as RAW files from his SD cards to a 4th generation iPod classic (via another Mac). Now, when he connects the iPod to the new computer, the iPod shows [More]
Hi, I have the Nokia N73, Whenever i make or receive call, pop-up occurs and ask to select the access point. i can't undrestand why it is asking the access points, If I select the access point, data connections gets activated, but for the next call i [More]
Audio and video is out of sync when I play videos recorded with N95 on my PC. If have used different PC applications to play the video, but all exhibit the same problem. In the beginning of at video it seems that the audio is about 400milliseconds ah [More]
Hi, If there are 50 records and 25th row data is having error. What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?Session method : the posting for the [More]
I have installed alsamixer and have my sound drivers and output working great. I am running Arch x86_64 and installed bin32-skype. It appears the internal microphone on the laptop is not working. I have already gone into alsamixer and enabled each ca [More]
I am getting a regular clicking aprox every 20 seconds from the back right of my satellite pro, any ideasI also guess the fan blades touch something inside your laptop. (I hope its not the loose bluetooth wire inside your laptop that got caught). Unl [More]