Home Server

RBServer problem

edited June 2013 in Server
Hello Nard,

Instead of trying to sort out my problem piecemeal, let me tell you the
whole problem and maybe you can help me get it resolved.

I maintain a multi-user client/server app built with Delphi 2005,
RBuilder 9.02, MS SQL Server and ASTA 3.1.

The report templates are stored in the database (rb_item table) and I
use the rbAsta DADE plugin which allows the end-user to design reports,
configure certain reports (report template names) to be stored in a
configuration file and programmatically printed by using this code:

class procedure TfrmReports.PrintReport(const bCalledInCode : boolean;
const TemplateName:string;
const FolderID:integer;
const PrinterName:string;
const Preview:string;
const iCopies : integer;
const bShowAutoSearch : boolean;
const bShowCancel : boolean;
const Params : array of string);
var
i : integer;
begin
frmReports := TfrmReports.Create(nil);
try
frmReports.bCalledInCode := bCalledInCode;
frmReports.pReport.PrinterSetup.Copies := 1;

SetLength(frmReports.Params, Length(Params));
// Params is an array of autosearch parameters for the report
for i := Low(Params) to High(Params) do
frmReports.Params[i] := Params[i];

frmReports.pReport.Template.DatabaseSettings.Name := TemplateName;
frmReports.ppReportExplorer1.LoadReport(TemplateName, FolderID);
frmReports.pReport.PrinterSetup.PrinterName := PrinterName;
frmReports.pReport.ShowAutoSearchDialog := bShowAutoSearch;
frmReports.pReport.ShowCancelDialog := bShowCancel;

//Check if preview first
if Preview = 'T' then
begin
frmReports.pReport.DeviceType := 'Screen';
frmReports.pReport.ShowPrintDialog := True;
end
else
begin
frmReports.pReport.DeviceType := 'Printer';
frmReports.pReport.ShowPrintDialog := False;
end;

if not gNoPrint then
frmReports.pReport.Print;
finally
frmReports.Free;
end;
end;

so that the client program can print a bar-coded label like this:

frmReports.PrintReport(true, sBarcodeLabel, iBarcodeLabelFolderID, 'Meto
4302', false, 1, false, false, ['201306000001']);

I want to move to Delphi XE4, drop ASTA but keep ReportBuilder because
it works REALLY WELL.

I have developed an ASTA replacement using INDY but don't have a DADE
plugin for it so I am looking at RB Server instead.

While I understand that I have to use RBuilder to design reports, is
there an RBServer server demo that I can use which will allow the client
program to print/preview a report similar to:

frmReports.PrintReport(true, sBarcodeLabel, iBarcodeLabelFolderID, 'Meto
4302', false, 1, false, false, ['201306000001']) ?

Can you point me to examples/demos to enable this?

Many thanks,
Arthur

Comments

  • edited June 2013

    1. Conversion of existing reports.

    You current reports use an ASTA Dade plug-in, you need to write code to
    convert them to use a different plug-in, perhaps ADO.

    Here is an rbWiki article with details for converting templates. The article
    discusses BDE to ADO conversion, but the concepts apply to any conversion.

    http://www.digital-metaphors.com/rbWiki/DADE/Fundamentals/Convert_Template_BDE_to_ADO


    2. DADE plug-in options

    i. ADO

    For an RBServer solution you still need a DADE plug-in, for SQL Server ADO
    is common.

    The RBServer Demos\Servers\Explorer Database\MS SQL Server folder contains
    an example for a report server with SQL Server and ADO.

    The Demos\Clients contain examples of using the ClientReport.

    ii. DataSnap

    Another option for replacing ASTA is to use Delphi's DataSnap.

    Here is an rbWiki 'How To' code example for using DataSnap with DADE and the
    ReportExplorer. The example includes a Dade plug-in for DataSnap.

    http://www.digital-metaphors.com/rbWiki/End-User/Report_Explorer/How_To...DataSnap


    3. ClientReport

    ClientReport code is similar to using Report, but you need to specify the
    VolumeName and ReportName. The Demos\Clients contains some examples of this
    and there a few more on rbWiki in the Server | Client section.



    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.