Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Datenbanken (https://www.delphipraxis.net/15-datenbanken/)
-   -   Wie drucken Sie Name und Note in FASTREPORT? (https://www.delphipraxis.net/205460-wie-drucken-sie-name-und-note-fastreport.html)

Alg2009 12. Sep 2020 02:25

Datenbank: FireBird • Version: 3 • Zugriff über: FireDac

Wie drucken Sie Name und Note in FASTREPORT?
 
Hallo,
Wie wird der Name und die Lektion sowie die Note gedruckt, da immer die erste Note für alle Schüler in FASTREPORT gedruckt wird?

BaseDonee.rar

haentschman 12. Sep 2020 06:50

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hi...:P
Your translator for german is not good...:zwinker:

I cant understand what you want. :? Paint a picture of your problem and sending this as attachment. We must know, witch data schould printed where...:thumb:

:dp: welcome here...

Alg2009 12. Sep 2020 09:53

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 1)
:oops:
Hello haentschman
Entschuldigung für mein schlechtes Deutsch. :oops:

What i want to do is how display in FastReport the students(Nom, lesson(NomLecon) name and Grades(Not
My Problem is why when execute the program appear only the first Grade for all students
And I want to show every pupil with his own mark.
The relation between Tables(Etudiant,Lecon) is N,N

blawen 12. Sep 2020 10:00

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von haentschman (Beitrag 1473458)
Hi...:P
Your translator for german is not good...:zwinker:

I cant understand what you want. :? Paint a picture of your problem and sending this as attachment. We must know, witch data schould printed where...:thumb:

:dp: welcome here...

Isn't the question simply about how all records are printed?
Gehts in der Frage nicht einfach darum, wie sämtliche Datensätze gedruckt werden?

Wenn ich es richtig interpretiere, werden in der Procedure TForm4.Button4Click die Daten aufbereitet.
Im Report werden aber die Daten von drei verschiedenen Querrys abgerufen, was so nicht funktionieren kann.

Alg2009 12. Sep 2020 13:22

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 1)
[QUOTE=blawen;1473460]
Zitat:

Zitat von haentschman (Beitrag 1473458)

Wenn ich es richtig interpretiere, werden in der Procedure TForm4.Button4Click die Daten aufbereitet.
Im Report werden aber die Daten von drei verschiedenen Querrys abgerufen, was so nicht funktionieren kann.

Wie funktioniert es?
Schauen Sie sich das Bild an, Sie werden sehen, dass die Schüler die gleiche Note wie der erste Schüler erhalten. Jeder Schüler sollte die Note bekommen, die er bekommt

Look at the picture, you will see that the students get the same Grade as the first student. Every student should get the grade they get.

haentschman 13. Sep 2020 06:13

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Hi...:P
Delphi-Quellcode:
 SQL.Add('JOIN ETUDIANT E on EL.ID=EL.ID');
...i think this line is wrong. :gruebel: 'on EL.ID=EL.ID'...the same field in the join.
Delphi-Quellcode:
 SQL.Add('JOIN ETUDIANT E on EL.ID=E.ID');
...how about this? :wink:

notes:
* Dont use WITH. Then you have less debugging problems with missing variable values. :wink:
* why Close/Clear? If you use SQL.Text, the SQL.Clear automaticly executed. With FireDAC the Close is automaticly executed.
* U use FIREDAC with MACROS. The problem is...that, if you changing the database components, the new one not knows MACROS. And one line less...:zwinker:

imho better:
Delphi-Quellcode:
procedure TForm4.Button4Click(Sender: TObject);
begin
  dmdata.AFDQuery.SQL.Text := 'SELECT E.NOM,L.NOMLECON FROM ETUDLECON EL';
  dmdata.AFDQuery.SQL.Add('JOIN LECON L ON EL.ID=L.LECONID');
  dmdata.AFDQuery.SQL.Add('JOIN ETUDIANT E on EL.ID=EL.ID');
  dmdata.AFDQuery.SQL.Add('ORDER BY EL.ID,EL.LECONID');

  dmdata.AFDQuery.Open;

  DmData.frxReport1.ShowReport;
end;

Alg2009 13. Sep 2020 20:30

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 1)
Thank you very much haentschman

But how can i put the result of the query in the FastReoprt when i Click on the Button ?

haentschman 14. Sep 2020 10:02

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Hi...:P

Questions:
1. why you use 3 frxDatasets? One is enough.
2. where you load this datasets?
3. where you assign the query to this datasets?

:wink:

Alg2009 14. Sep 2020 18:14

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
hello,

Zitat:

Zitat von haentschman (Beitrag 1473538)
Hi...:P
1. why you use 3 frxDatasets? One is enough.

because i have two tables and query, and maybe add a calculated fields


Zitat:

2. where you load this datasets?
I load it in the FastReport

Zitat:

3. where you assign the query to this datasets?
Do you mean something like this
FrxDbdataset3.daset:= query1

generic 14. Sep 2020 20:01

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
there is also an english version of Delphi-Praxis:
https://en.delphipraxis.net/

Alg2009 14. Sep 2020 23:20

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von generic (Beitrag 1473560)
there is also an english version of Delphi-Praxis:
https://en.delphipraxis.net/


I meant only help generic i didn't see the english version of Delphi-Praxis before i post this topic here
I ask to move the topic to its rightful place .

TurboMagic 15. Sep 2020 08:33

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
By the way: FastReports themselves provide forums as well!

Alg2009 16. Sep 2020 19:36

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
I need your help :cry:

Alg2009 18. Sep 2020 10:28

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Hello,
I still need your help haentschman :cry:

haentschman 18. Sep 2020 11:25

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
I am at Work...at Weekend. :wink:

TurboMagic 18. Sep 2020 15:44

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Which of your issues does still exist?

Alg2009 18. Sep 2020 19:56

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von TurboMagic (Beitrag 1473826)
Which of your issues does still exist?


my Program

The problem is my program it shows the first mark for all students and i want to show to every student its mark in the FastReport
when i click on the button Impression(print) it show the result of the query in the FastReoprt

TurboMagic 18. Sep 2020 22:07

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Have you already looked into the manual for FastReport?
The one for version 5 can be found here: https://www.fast-report.com/public_d...ntent_dyn.html

A more complete one for 4.6 can be found in PDF format here:
https://origin2.cdn.componentsource....rmanual-en.pdf

haentschman 19. Sep 2020 08:57

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 2)
Hi...:P

you want this?

Question:
How long you programming Delphi?

You should read this information:
StyleGuide: https://wiki.delphi-jedi.org/wiki/Pr...ge_Style_Guide
* naming of units, variables
* indentation
* readable names
CamelCase:
https://en.wikipedia.org/wiki/Camel_...er_programming

Your Project:

Do you want to learn something? :zwinker: ...ok.

Plus:
+ SQL with parameters :thumb:

Minus:
- naming of the components/units -> Do yourself a favor with it. It is better readable. :zwinker:
- Never write hardcoded folders/files, access data into the connection. This belongs, partly encrypted, into an INI file or into the registry. :warn:
Code:
object Conn: TFDConnection
    Params.Strings = (
      'Database=D:\Database Desktop\BaseDonee\SCOLAIRE.FDB'
      'User_Name=SYSDBA'
      'Password=masterkey'
      'DriverID=FB')
    Connected = True
    LoginPrompt = False
    Left = 79
    Top = 22
  end
- Never use DB tables. Better use Querys. :warn:
- DateTime Edit without check. Better use a DateTimePicker...:wink:
- Creation of the Datamodule before creating Main form. (in DPR)
- use Anchors for the components http://docwiki.embarcadero.com/Libra...ontrol.Anchors :wink:
- Firebird has a function for reading the new ID https://firebirdsql.org/refdocs/lang...21-insert.html :thumb:
- write the code or/and names better in english. :zwinker:

what i do:
* formatting
* naming
* SQL was wrong
* assignment of the query to the report
* delete unused report datasets
* editing report

Alg2009 19. Sep 2020 10:28

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von haentschman (Beitrag 1473854)
Hi...:P

you want this?

Question:
How long you programming Delphi?

About Year

https://www.delphipraxis.net/attachm...rt-preview.png

Yes this is What i want like the picture how did you do that?

haentschman 19. Sep 2020 10:35

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
...see previous post. :zwinker:

Three Questions:
1. you programming for yourself?
2. you use a version control system?
3. which delphi version do you use -> add this to your profile. :wink:

Alg2009 19. Sep 2020 13:16

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von haentschman (Beitrag 1473860)
...see previous post. :zwinker:

Three Questions:
1. you programming for yourself? yes
2. you use a version control system? no
3. which delphi version do you use -> add this to your profile. ok :wink:

Do you want to help me?

haentschman 19. Sep 2020 15:58

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Do you want to help me?
whereby? :gruebel: The project you have...
Zitat:

you use a version control system? no
GIT video tutorial with TortoiseGIT (GUI): https://www.youtube.com/channel/UCO2...8iSssbN66eECLA
GIT TortoiseGIT install: https://www.youtube.com/watch?v=fNPLuJTTto0

...if you want "command line", you found more videos/tutorials.

Alg2009 19. Sep 2020 18:53

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
What do I do with the TortoiseGIT!?
I no longer understand what you mean?:gruebel:

i have a simple question and you have the answer why don't you give me the answer instead of asking me to install program that I don't want

haentschman 20. Sep 2020 07:15

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Hi...
Zitat:

i have a simple question and you have the answer why don't you give me the answer
The answer you have! You just have to deal with it and see what has changed in the source code. :roll: https://www.delphipraxis.net/1473854-post19.html
Zitat:

instead of asking me to install program that I don't want
Then I can not help you anymore. You have not understood what a version control system is needed for and why it is needed. The links was only for information...:roll:

...i am out. :?

Alg2009 20. Sep 2020 14:34

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von haentschman (Beitrag 1473860)
...see previous post. :zwinker:

Forgive me :oops: and thank you very match
i didn't see The attached file in the previous reply

I benefited a lot from you and learned new things like "TfoSettings" Which I did not understand and why you added a new Unit? I will try to understand it

thank you very very match haentschman for your help

Alg2009 20. Sep 2020 15:31

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 1)
Believe me, you gave me a code that I've never seen before so understanding it sounds difficult.
You have added things that I did not know like(New unit)

Now i understand you why you asked about 'Version control System'

I'll be in hiding for two or three days to understand what you explained to me earlier and I'm back
By the way the code did not work

Klaus01 20. Sep 2020 16:45

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
you can remove these 5 Units from the uses that are underlined.

Grüße
Klaus

haentschman 21. Sep 2020 05:17

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Sorry. :oops: These units mad* was automatic add to the project. This is a tool to finding errors... I should have to delete them for you.
Zitat:

By the way the code did not work
...i know. :wink: It's an easy mistake that I have left as it is...from me. You have to find it out yourself. Write the error message here.
Zitat:

what i do:
* formatting
* naming
* SQL was wrong
* assignment of the query to the report
* delete unused report datasets
* editing report
formatting:
http://docwiki.embarcadero.com/RADSt...ng_Source_Code

naming:
* All components should have a prefix. 2 to 4 signs. example: fo = Form, edt = Edit, mem = Memo and so on... You can choose it yourself.
previos Unit6 -> Settings only the name has changed!
previos TForm6 -> TfoSettings only the name has changed!
https://wiki.delphi-jedi.org/wiki/Pr...ge_Style_Guide

SQL was wrong:
...you can see (btnParamètresClick)

assignment of the query to the report:
Delphi-Quellcode:
dmData.frxDatasetReportMaster.DataSet := dmData.qryReport;
dmData.frxEtudiant.ShowReport;
delete unused report datasets:
...from the DatamoduleEtudiant.

editing report:
New names assigned to the report.

Alg2009 22. Sep 2020 20:14

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Hello,

Zitat:

It's an easy mistake that I have left as it is...from me. You have to find it out yourself. Write the error message here.
The error was in the connection settings

I almost visit GitHub website and i didn't know it is a repository :oops: thank you for all the information that will help me in the future


There is only one last question
You said
Zitat:

Zitat von haentschman (Beitrag 1473854)
- Never use DB tables. Better use Querys. :warn:

That's means i link all the tables together with JOIN(inner,Left or Right) the question is If, for example, we add another table to the database let it be 'Group' -->the relation between Student and Group is one to many(Each student has one group, and each group has more than one student)

We write two queries the first to show the students and their grades And the other to show the students and their group or only one query ?

because if we write one query the result it will be wrong
Code:
SELECT E.ID, E.NOM, E.PRENOM, GroupName,LE.NOMLECON, LE.NOTE FROM ETUDIANT E
JOIN ETUDLECON LO ON E.ID = LO.ID
JOIN LECON LE ON LO.LECONID = LE.LECONID
JOIN Group G ON G.GroupID = E.GroupID

haentschman 23. Sep 2020 06:10

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hi...:P
Zitat:

The error was in the connection settings
:thumb: This is what i mean with the INI File. If is the connection hardcoded...what happens when you give your friend the EXE? Exactly that... :zwinker: That's why the settings should be written to an INI.
http://docwiki.embarcadero.com/Libra...Files.TIniFile
Zitat:

There is only one last question
The difference is:
With a table all records are always read...even those from 10 years ago. :zwinker:
With a qery you can get only the records of the last year...if you want. :thumb:
Otherwise the "operation" is the same...
Zitat:

We write two queries the first to show the students and their grades And the other to show the students and their group or only one query ?
If you want so...:wink: The SQL, with a query, creates the data.
Zitat:

because if we write one query the result it will be wrong
This not a TQuery problem...it a SQL problem. Also the database structure must fulfill rules. (ForeignKey) I dont know what you want to see...:?
SQL information (you know):
https://www.w3schools.com/sql/
Database information:
https://en.wikipedia.org/wiki/Database_normalization
Zitat:

I almost visit GitHub website and i didn't know it is a repository
Once again to Git:
You don't have to use it. But you can use it to view the changes since the last save in the repositoriy. See picture1. More important is that you can reset the changes. :thumb:
GIT is decentralized. You have one repository locally and one "copy" externally (GitHub, BitBucket)
You start only locally with GIT. (Setup: GIT + GUI Tool TortoiseGIT). Only if you cooperate with others, it is necessary to store the source code externally.
What is GIT:
https://fr.wikipedia.org/wiki/Git

Difference Tool:
BeyondCompare ...shipped with Delphi. :thumb:

...to much? :zwinker:

Who says programming is easy? You have to learn every day. 8-)

Alg2009 25. Sep 2020 10:36

AW: Wie drucken Sie Name und Note in FASTREPORT?
 
Zitat:

Zitat von haentschman (Beitrag 1474067)
This not a TQuery problem...it a SQL problem. Also the database structure must fulfill rules. (ForeignKey) I dont know what you want to see...:?
SQL information (you know):

the problem was in the foreign key
thank you very very much haentschman


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:55 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz