Startbeitrag von kimor am 18.10.2013 10:06
Hi All!
I have a program with a table where you choose what you want to be in the report with a checkbox.
The report is linked to the table.
I can't use a query since the checkbox is not in the database table.
In the BODY section (code) of the report i have tabledelete to delete the rows that don't have the checkbox checked.
That deletes the non checked rows in the actual database table, which it should not. The Table control is not linked to the
database table.
Is there a better way to print out the rows that are checked in a report?
Regards
/Kim
I have a program with a table where you choose what you want to be in the report with a checkbox.
The report is linked to the table.
I can't use a query since the checkbox is not in the database table.
In the BODY section (code) of the report i have tabledelete to delete the rows that don't have the checkbox checked.
That deletes the non checked rows in the actual database table, which it should not. The Table control is not linked to the
database table.
Is there a better way to print out the rows that are checked in a report?
Regards
/Kim
Antworten:
Re: [WD18] Skipping/removing rows/lines in a report
I'm not sure what is happening in your code, but one thing is sure, if the table control is not linked to the file AND not linked to a query IN MODIFICATION MODE, than deleting rows in the control table will NOT delete anything in the file...
Another way of rpingint your report would be to base it on the control table itself, instead, then for each row check if the checkbox is checked or not and do aresult false if not
Best regards
von Fabrice Harari - am 18.10.2013 13:10
Re: [WD18] Skipping/removing rows/lines in a report
the tabledelete is deleting stuff in your file because it is liked. Problebly direct acces? If you fill the table bij programming than tabledelete will onley remove a row in the table Hdelete() will delete a row in your datatable.
I think you better make a query. And in the query make a condtion.( problably with contains and a parameter) It doesnot matter that the checkbox is in the file or not. The check box can be the parameter that runs the query. I hope this makes sence
regards
Allard
PS if you profide a little more info than my solution can be in more detail
von Allard - am 18.10.2013 15:42
Re: [WD18] Skipping/removing rows/lines in a report
The table is not linked and is Loaded in memory.
I'll look into doing it by programmimg...
The code:
nRowNum is int = 1
FOR EACH ROW OF TABLE_Behorigheter
IF FEN_main.TABLE_Behorigheter.COL_Vald True THEN TableDelete(TABLE_Behorigheter, nRowNum) ; GOTO Restart //nRowNum = nRowNum + 1
nRowNum = nRowNum + 1
END
If I make it by a Query where will I initialize the parameter? Still in the Body section of the report.
Is there a command to skip to the next row when it reads the table before printing to the report?
Regards,
Kim
von kimor - am 19.10.2013 14:30
Re: [WD18] Skipping/removing rows/lines in a report
WEll despite of your code I donnot really get what you want to achief?
Hexecutequery(queryname,querybydefault,parameter) is code to run a query with a parameter.
If you discribe what you want to achief in a bit more dedail I can see if I can make better comments.
Regards
Allard
von Allard - am 19.10.2013 20:26
Re: [WD18] Skipping/removing rows/lines in a report
Another solution (i always use it, in such situation.
Create a hidden table cloning/copying the original and set "Visible" to false in the new hidden table.
Then do a loop.
for j=1 to table_name..occurence.
if table_name.col_chk[j]=true then
//copy each value from the cells to same cells in the hidden table
end-if
end
then declare in the report the connection with the new table and print.
hth
Gianni
von Gianni Spano - am 19.10.2013 21:03
Re: [WD18] Skipping/removing rows/lines in a report
You can simply use the "Filter" process in the report code.
Place in it.
Regards,
Piet
von Piet van Zanten - am 20.10.2013 11:08
Re: [WD18] Skipping/removing rows/lines in a report
Thanks for all your answers/suggestions.
Piets suggestion RESULT MySource.col_Check seemed to be the way to go.
Just a line and the result that I wanted.
Regards,
Kim
von kimor - am 21.10.2013 18:10