|
Re: How to print only current record through a button on form which calls t: msg#00074openoffice.dba.user
Hi Ariel, > If I understood well, they are talking about a REPORT, not a FORM. Oop. Being able to read is certainly an advantage. Fortunately no from an evolutionary point of view, else I would be extinct ... My apologies for giving false hope ... > I think they have a form, and they want to print a REPORT for the > current record they see in the form. Well .... my idea here would be to have a report bound to a certain query of the form SELECT ... FROM ... WHERE ..., and to modify this query's WHERE clause to filter for the form's current record (e.g. to SELECT ... FROM ... WHERE ( ... ) AND ID = <current_form_id>). ' get the SQL statement which uniquely identifies the current ' record composer = createUnoService( _ "com.sun.star.sdb.SingleSelectQueryComposer" ) composer.setQuery( form.ActiveCommand ) composer.appendFilterByColumn( _ form.getColumns().getByIndex/Name( ... ) ) ' not this should be a column which uniquely identifies ' the current record of the form, ideally a primary key ' If you have multiple records which *together* identify ' the current record, then do repeated appendFilterByColumn ' calls sqlStatement = composer.getQuery() ' modify our query so it is now based on this statement query = form.ActiveConnection.getQueries().getByName( <query_name> ) query.Command = sqlStatement ' execute the report ... This is our of my head, so there might be errors in there, but I'd say it should work along those lines. Ciao Frank -- - Frank Schönheit, Software Engineer frank.schoenheit@xxxxxxx - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Base http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Unable to set ID column to autonumber in 2.3: 00074, Frank Schönheit - Sun Microsystems Germany |
|---|---|
| Next by Date: | Re: How to print only current record through a button on form which calls the report.: 00074, Drew Jensen |
| Previous by Thread: | Re: How to print only current record through a button on form which calls the report.i: 00074, Ariel Constenla-Haile |
| Next by Thread: | Re: How to print only current record through a button on form which calls the report.: 00074, Drew Jensen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |