Load report
Hi,
Is it possible to open a report (print, preview) in an end user application
by code.
Example of my code :
if Preview then
myEndUserSolution.ppReportExplorer1.PrintPreview(ReportName,FolderId)
else
myEndUserSolution.ppReportExplorer1.Print(ReportName,FolderId);
but the report isn't print.
Thank's
Is it possible to open a report (print, preview) in an end user application
by code.
Example of my code :
if Preview then
myEndUserSolution.ppReportExplorer1.PrintPreview(ReportName,FolderId)
else
myEndUserSolution.ppReportExplorer1.Print(ReportName,FolderId);
but the report isn't print.
Thank's
This discussion has been closed.
Comments
found no problem. I used the (RBuilder\Demos\3. EndUser\2. Custom Data
Views\) demo and created a radio button group with one option to print and
the other option to print preview. The code in the btnLaunchClick
event was changed to the following:
procedure TmyEndUserSolution.btnLaunchClick(Sender: TObject);
begin
{The 'Print Preview' radio button is checked}
if (rbPreview.Checked) then
myEndUserSolution.ppReportExplorer1.PrintPreview('Customer List', 1)
{The 'Print' radio button is checked}
else
myEndUserSolution.ppReportExplorer1.Print('Customer List', 1);
end;
This seemed to function correctly. If you still have problems, please
provide a more detailed way to reproduce this problem.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The xxx.exe send a command line to my program with the report name and the
folder id and preview or print.
And in my program i execute this code when i receive this commande line :
myEndUserSolution.ppReportExplorer1.PrintPreview(ReportName,FolderId)
but the report not print.
what's the problem please?
thank's
"Nico Cizik (Digital Metaphors)" a ?crit dans
did in my example.
2. The standard way to control one application from another is via COM.
There are some books on using COM with Delphi that can help you with this.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I don't execute the ppReportExplorer.Execute and the ppReportExplorer.form
is nil.
How do I assigned the ppReportExplorer.Form?
thank's
"Nico Cizik (Digital Metaphors)" a ?crit dans
Report Explorer form. You can then use Report.Print.
---------------------------------------------------------------
Tech Tip: How to Programmatically Load Reports that were Saved
using the Report Explorer
---------------------------------------------------------------
1. The ReportExplorer has a run-time interface you can use to load reports
using the ReportExplorer.LoadReport method. You can use this method without
actually 'showing' the report explorer form. (See the online help topic for
TppReportExplorer.)
2. If you want use Report.Template.LoadFromDatabase, RB will locate the
report stored in the database table based upon the NameField value only.
However, for the rb_item table you need Folder_Id, Name to locate a record
uniquely.
To override this default behavior, assign an event-handler to the
Report.Template.OnLocateRecord event.
example:
TmyForm = class(TForm)
private
function ReportLocateRecordEvent(Sender: TObject; const aReportName:
String): Boolean;
end;
procedure TmyForm.FormCreate(Sender, TObject);
begin
{assign the event handler}
FReport.Template.OnLocateRecord := ReportLocateRecordEvent;
end;
function TmyForm.ReportLocateRecordEvent(Sender: TObject; const aReportName:
String): Boolean;
begin
{add logic here to locate the record and return True if it is found}
Result := myLocateReportFunction(FFolderid, aReportname);
end;
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com