TD 1.5.1 and Saving Reports

Discussion forum about all things Report Builder (all versions).
dcomer

TD 1.5.1 and Saving Reports

Post by dcomer » 03 Jan 2008, 22:49

Does anyone out there know how to add a save button to a report created in Report Builder 1.5.1 and generated from TD 1.5.1? We want to bring up a new window when the user clicks save that will allow them to save the generated report in TXT and RTF formats.

Jeff Luther

Re: TD 1.5.1 and Saving Reports

Post by Jeff Luther » 08 Jan 2008, 20:15

dcomer wrote:Does anyone out there know how to add a save button to a report created in Report Builder 1.5.1 and generated from TD 1.5.1? We want to bring up a new window when the user clicks save that will allow them to save the generated report in TXT and RTF formats.
Couple steps, if I understand you:
-- use SalReportPrintToFile() to specify TXT/RTF, if you don't know already
-- create and use your own report preview window (that's the 2nd parm handle in SalReportView(). See help for more info.) That way you can add toolbar and/or menu options using the SalReportCmd() functions, *plus* add your own File/Save As... menu option, call your own dlg. box, have SAL code in there to let the user select which format to save as, specify a file name, etc.

To clarify: "generated report" is only that when you have the equation Data + QRP template. That happens in view/preview or printing. Thus, either in your appl. you'd need a File/Print... menu to allow redirection to text/rtf, or choose the steps I mention above (i.e., allow a menu/pb in the preview window where the user can specify txt, rtf, or a 'real' printout to whatever printer(s) is/are installed on the user's PC).

dcomer

Re: TD 1.5.1 and Saving Reports

Post by dcomer » 08 Jan 2008, 23:20

None of us here have ever used anything aside from hWndNULL for the second parameter to SalReportView. I can't find anything in the manulas we have or the help file... would you mind giving us a quick overview on how to create a template to open a report in so that we can add our own tool bar buttons.

Jeff Luther

Re: TD 1.5.1 and Saving Reports

Post by Jeff Luther » 08 Jan 2008, 23:34

"anything"?? Help says parm 2 is a "An optional window handle (or name) to a custom report template."
That means, you can have your own frm window you've designed, create an instance, get its return w/h and pass that handle as parm 2, like:

Set hWndRpt = SalCreateWindow( frmMyReportPreviewWindow, ... )
If hWndRpt = hWndNULL
...problem
Else
... SalReportView( ..., hWndRpt, ... )
or
... SalReportView( ..., frmMyReportPreviewWindow, ... )

And RB will use your form to display the view in its contents.

ALSO - read TD's dev.pdf - It has a section on SalReportView(), using SalReportCmd() calls to dup. the first, last, etc. as the default preview window has. JPG attached to show part of what it says.
You do not have the required permissions to view the files attached to this post.

dcomer

Re: TD 1.5.1 and Saving Reports

Post by dcomer » 08 Jan 2008, 23:43

I wasn't clear when I said I wasn't able to find anything, sorry about that. What I ment was I couldn't find anything on how to create a custom report template, I wasn't sure if this was just a standard form window that you can open the report into or it had to be a specific object type. I thing I have it under control now, thank you.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests