High level question about RB7
Hello,
With my current environment of Delphi6, RB6 and SqlServer2000 I store all
of my reports in a table. When a report is needed at runtime i will pull the
report out of the table bind custom functions to the report events (mostly
beforePrint events) and do a lot of configuration of the report through code
before it is sent to the printer. Most of the configuration involves
changing band heights, setting text in labels, and moving labels around ( I
have very high maintenance users, like most of us). Code pieces are included
below.
Basically my question is will i have to change this method much when and if
I move to RB 7 Server to publish our reports to a web page? I know in theory
RB 7 makes publishing to the web very easy but im curious if my setup makes
it a little more interesting.
Thanks
Matt
Here are some example code snips:
//getting the report from the database
flightReport := TflightReport.Create(Self);
reportBuilderDataModule.reportTemplateTable.close;
reportBuilderDataModule.reportTemplateTable.open;
flightReport.Template.New;
flightReport.Template.DatabaseSettings.DataPipeline :=
reportTemplatesPipeline;
flightReport.template.DatabaseSettings.NameField := 'report_name';
flightReport.template.DatabaseSettings.TemplateField := 'report_template';
flightReport.template.DatabaseSettings.Name := 'customerItinerary';
flightReport.template.LoadFromDatabase;
//setting events
flightReport.BeforePrint := flightReportBeforePrint;
//setting text
flightReport.ObjectByName(bandIndex, sigIndex, 'lblSignature');
flightreport.bands[bandindex].objects[sigIndex].settext('blah');
With my current environment of Delphi6, RB6 and SqlServer2000 I store all
of my reports in a table. When a report is needed at runtime i will pull the
report out of the table bind custom functions to the report events (mostly
beforePrint events) and do a lot of configuration of the report through code
before it is sent to the printer. Most of the configuration involves
changing band heights, setting text in labels, and moving labels around ( I
have very high maintenance users, like most of us). Code pieces are included
below.
Basically my question is will i have to change this method much when and if
I move to RB 7 Server to publish our reports to a web page? I know in theory
RB 7 makes publishing to the web very easy but im curious if my setup makes
it a little more interesting.
Thanks
Matt
Here are some example code snips:
//getting the report from the database
flightReport := TflightReport.Create(Self);
reportBuilderDataModule.reportTemplateTable.close;
reportBuilderDataModule.reportTemplateTable.open;
flightReport.Template.New;
flightReport.Template.DatabaseSettings.DataPipeline :=
reportTemplatesPipeline;
flightReport.template.DatabaseSettings.NameField := 'report_name';
flightReport.template.DatabaseSettings.TemplateField := 'report_template';
flightReport.template.DatabaseSettings.Name := 'customerItinerary';
flightReport.template.LoadFromDatabase;
//setting events
flightReport.BeforePrint := flightReportBeforePrint;
//setting text
flightReport.ObjectByName(bandIndex, sigIndex, 'lblSignature');
flightreport.bands[bandindex].objects[sigIndex].settext('blah');
This discussion has been closed.
Comments
1. Place a TrsReportTemplateVolume in the data module containing the report
and event handlers.
2. Use the Object Inspector to configure the
rsReportTemplateVolume1.DatabaseSettings property so that the volume can
load the reports:
DatabaseSettings.DataPipeline := reportTemplatesPipeline;
DatabaseSettings.NameField := 'report_name';
DatabaseSettings.TemplateField := 'report_template';
3. Make sure the data module is set for AutoCreate in the project (this
ensures that report volume component can register the reports in the
server's report catalog.)
4. Code the following event handler for the ReportTemplateVolume:
procedure TDataModule1.rsReportTemplateVolume1LoadReportEnd(Sender:
TObject);
var
lReport: TppReport;
sigIndex, bandIndex: Integer;
begin
if (Sender is TppReport) then
raise Exception.Create('Unexpected Sender.');
lReport := TppReport(Sender);
lReport .BeforePrint := flightReportBeforePrint;
lReport .ObjectByName(bandIndex, sigIndex, 'lblSignature');
lReport .Bands[bandindex].objects[sigIndex].settext('blah');
end;
5. Access the main form of the project and add a TrsServer component.
6. rsServerActiveX to the uses clause (this makes the report server an
application that can be hosted from ReportBuilder Services - a Windows
service.)
7. Compile the application.
8. Double-click the RBServices system tray icon and designate your exe as
the new server.
9. Run the thin-client example (...RBServer\Demos\Clients\01. Client
Explorer.) You will be able to see/preview all of the reports in your
database table.
See the Developer's Guide for a step-by-step on 'Building a Report Server
Application for Reports in a Database'
--
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com