Nadya,
I don't know about the form, but for reporting you could use the QuickReport() function (see Message #
597306). I use this all the time. If formats and sends the content of the currently selected table/cursor to Excel using automation. The real added value of this function is that it correctly adjusts the column widths according the data and it takes advantage of Excel's "Fit to Page" feature. It's also very easy to customize the format if you don't like it.
HTH
>Hi everybody,
>
>I have an application, called TableMaintenance. In this application I allow users to make changes in any table in our system (this menu option is enabled for only "administrative" users). For few tables I designed special forms, but for most of the tables I just use a simple generic form with a grid for editting. The form has a Print button with the following code:
>
>********************************************************************
>* Description.......: TableMaint.PrintM
>* Calling Samples...:
>* Parameter List....:
>* Created by........:
>* Modified by.......: Nadya Nosonovsky 06/06/2000 12:51:08 PM
>********************************************************************
>local lcReportName, lcSafety, lnRecno, lcOrder
>lcReportName='Reports\TableMaint'
>lcSafety=set('safety')
>set safety off
>select TableMstr
>lnRecno=recno()
>*lcOrder=order()
>create report (m.lcReportName) from alias() column
>if UseTble(forceext(m.lcReportName,'FRX'),"WorkReport",'exclusive')
> wait window nowait "Preparing a report..."
> select WorkReport
> replace tag with '', tag2 with ''
> delete for objtype=26
> pack
> use in WorkReport
>endif
>*modi report (m.lcReportName)
>select TableMstr
>dodefault()
>goto m.lnRecno
>if m.lcSafety='ON'
> set safety on
>endif
>
>This works fine for simple tables with 3-4 fields, but I have some tables with bigger number of columns, and generated report doesn't look very good. For instance, Town field is not wide enough, etc. So, the user asked me, can I provide more control to design the report. I haven't yet worked in this direction, so I'd like to hear your opinions here. BTW, may be CREATE REPORT option could be enhanced too?
>
>I proposed to the user two solutions: 1) identify all tables, which are not good enough for simple form approach and I design a special form for each of such table with a specific report - a little bit time consuming
>2) Give an option to modify reports by the user
>
>What would be your suggestions?
>
>Thanks a lot in advance.
Daniel