Topic: near syntax error on Sql report

I have attached the project files except the .exe and .dll files.

my 1st idea was to save the record, edit and delete on the same form (frmManager).
my 2nd idea was to print the particular ""Selected record"" after saving on to the database.

I have added the button ""print"" for reporting. i have added "SQL Report query" based
on some sampe projects given in the "FORUM".

i got the following error while running the application.

on clicking the "Print" button error message shown like the below "screenshot"


kindly look at the SQL for the button "Print" and also check the script for other buttons.

Post's attachments

Attachment icon clientmanager.rar 14.46 kb, 114 downloads since 2019-12-16 

Re: near syntax error on Sql report

Hi, you have to add "," in your query after each line. Except for the last line

;-)

Re: near syntax error on Sql report

Thanks for the reply. Have you seen the SQL query inside the project i have attached??

Anyhow, i will try your suggestion and will reply soon.

Thanks

Re: near syntax error on Sql report

Hi lupo1st,

Thanks for the reply. I tried your suggestion by adding "," after end of each line of query. But then the error shows like "near "," syntax error....". this is first time, i m trying SQL coding. Kindly check the project i attached and check both the Print button ""Report SQL"" and the Script page of the project.

thank you

Re: near syntax error on Sql report

Hi Dmitry,

I have sent an email with the project folder yesterday. please check it

Re: near syntax error on Sql report

vijaian77,
Welcome aboard. I think you are making things more complicated than they need to be. You can do the print without doing the ReportSql. You can do it with the Report Action and define what fields you want to include in the report (No SQL needed). You will need to format the report the way you want it in FastReport. Since you are using the grid and record form on one form. I added a couple of script lines to show the record fields when you click on a row in the GridClients.

Post's attachments

Attachment icon clientmanager_revised.zip 354.24 kb, 126 downloads since 2019-12-16 

Re: near syntax error on Sql report

ehwagner wrote:

vijaian77,
Welcome aboard. I think you are making things more complicated than they need to be. You can do the print without doing the ReportSql. You can do it with the Report Action and define what fields you want to include in the report (No SQL needed). You will need to format the report the way you want it in FastReport. Since you are using the grid and record form on one form. I added a couple of script lines to show the record fields when you click on a row in the GridClients.


Thanks ehwagner for the assistance,

I downoaded the revised project you have attached. I will go through the changes and will learn accordingly!

Thank you again.

Will reply soon

8 (edited by derek 2019-12-17 11:49:30)

Re: near syntax error on Sql report

Hi Vijaian, EHW,
Another thing  you might want to consider, for example, is using 'editable grids' for your dictionaries. 
It saves a lot of time by not having to create extra forms (17 fewer in your clientmanager example), makes your project more compact and will probably load that bit quicker (please see attached).
Regards,
Derek.

Post's attachments

Attachment icon clientmanager1.zip 347.89 kb, 155 downloads since 2019-12-17