 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rafal Haase Guest
|
Posted: Mon Apr 26, 2004 4:27 pm Post subject: Rave 5.0, Delphi 7 - Creating non-database reports |
|
|
Hi,
I have an array of strings for example - array [0..99] of string. How can I
create a simple raport with a list of those strings in rows using datatexe
field in virtual designer. It's fairly easy to do using just a code but I
want to do it through virtual designer.
Thanks.
|
|
| Back to top |
|
 |
Thomas Pf Guest
|
Posted: Mon Apr 26, 2004 5:15 pm Post subject: Re: Rave 5.0, Delphi 7 - Creating non-database reports |
|
|
Rafal,
look into the TRvCustomConnection. with this component you can create
"non-database reports" very easy.
:-) thomas
btw: there exist a special rave-newsgrouparea:
borland.public.delphi.thirdpartytools.ravereports
"Rafal Haase" <rafalhaase (AT) op (DOT) pl> schrieb im Newsbeitrag
news:408d3835 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi,
I have an array of strings for example - array [0..99] of string. How can
I
create a simple raport with a list of those strings in rows using datatexe
field in virtual designer. It's fairly easy to do using just a code but I
want to do it through virtual designer.
Thanks.
|
|
|
| Back to top |
|
 |
Rafal Haase Guest
|
Posted: Mon Apr 26, 2004 10:06 pm Post subject: Re: Rave 5.0, Delphi 7 - Creating non-database reports |
|
|
OK. So I created custom connection. I created Direct Data View in Rave. I
created DataText connected with my TRvCustomConnection through DataField and
DataView fields in Rave. The problem is I cannot handle that from Dephi
source code. I tried the Rave help file but with no effect. It says
something about 'tutorial on customizing data connections' but I cannot find
it. If someone can say anything about creating the connection and using it
to transfer data from application to report I'd appreciate.
Thanks in advance.
Rafal.
Użytkownik "Thomas Pf" <thomas (AT) spam-mail (DOT) de> napisał w wiadomości
news:408d4373 (AT) newsgroups (DOT) borland.com...
| Quote: | Rafal,
look into the TRvCustomConnection. with this component you can create
"non-database reports" very easy.
:-) thomas
btw: there exist a special rave-newsgrouparea:
borland.public.delphi.thirdpartytools.ravereports
"Rafal Haase" <rafalhaase (AT) op (DOT) pl> schrieb im Newsbeitrag
news:408d3835 (AT) newsgroups (DOT) borland.com...
Hi,
I have an array of strings for example - array [0..99] of string. How
can
I
create a simple raport with a list of those strings in rows using
datatexe
field in virtual designer. It's fairly easy to do using just a code but
I
want to do it through virtual designer.
Thanks.
|
|
|
| Back to top |
|
 |
S P Briggs Guest
|
Posted: Tue Apr 27, 2004 8:36 am Post subject: Re: Rave 5.0, Delphi 7 - Creating non-database reports |
|
|
Tutorial: Simple Data Connection
1. Run Delphi.
2. On the project form, add a TRvProject component, an TRvSystem
component, an TRvCustomConnection component and a TButton component.
3. Click on the RvProject1 component and select RvSystem1 in the
Engine property of the Object Inspector.
3. Save the project.
4. Select the RvCustomConnection1 component. Select the Events tab of the Object Inspector. Double-click the OnGetCols event. Double-click the OnGetRow event. Double-click the OnOpen event.
5. Add the following code to the three event handlers in Unit1.pas:
procedure TForm1.RvCustomConnection1GetCols(Connection: TRvCustomConnection);
begin
Connection.WriteField('MyData', dtString, 50, 'MyData', '');
end;
procedure TForm1.RvCustomConnection1GetRow(Connection: TRvCustomConnection);
begin
Connection.WriteStrData('This is Line Number ' + IntToStr(Connection.DataIndex+1), '');
end;
procedure TForm1.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
Connection.DataRows := 100;
end;
7. Double-click the RvProject1 component to launch Rave Report visual designer.
8. In the designer, select File | New to start a new report project.
9. On the toolbar, select the "Report" tab page.
10. Select the Region component and add it to the page. Resize it to fit the whole printable page (the area inside the red dashed lines).
11. Select the Databand component and add it to the Region. It will automatically move to the top and spread across the whole width of the page.
12. Select the DataText component and add it to the white area of the Databand. Stretch it so that it is most of the page width.
13. Go back to Delphi and run the project (F9).
14. Go back to the visual designer toolbar, select the "New Data
Object" button. A wizard window will appear. Select the "Direct Data View" option and click the Next button.
15. The next window will list the RvCustomConnection1 component.
Select it and click the Finish button.
16. Select the DataText1 component. In the Object Inspector to the left, select "DataView1" in the DataView property and "MyData" in the DataField property.
17. Select the Databand1 component. In the Object Inspector to the left, select "DataView1" in the DataView property.
18. Save the Rave Report.
19. Stop the Delphi project. Go to the form and select the RvProject1 component. In the Object Inspector, enter the path and file name of your Rave Report in the ProjectFile property (or browse to it).
20. On the form, double-click the TButton component and add the
following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
RVProject1.SelectReport('Report1', True);
RvProject1.Execute;
end;
21. Run the delphi project again (F9). Click the button on the form and then click OK on the preview window that appears. You should see a preview of a two page report consisting of 100 lines.
If you want to print data from an array of strings, replace the code from step 5 as follows:
procedure TForm1.RvCustomConnection1GetCols(Connection: TRvCustomConnection);
begin
Connection.WriteField('MyData', dtString, 50, 'MyData', '');
end;
procedure TForm1.RvCustomConnection1GetRow(Connection: TRvCustomConnection);
begin
Connection.WriteStrData(MyArray[Connection.DataIndex], '');
end;
procedure TForm1.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
Connection.DataRows := High(MyArray);
end;
Don't forget to replace "MyArray" with the name of your array and "50" with the length of your longest string. Hope this helps you get started...
"Rafal Haase" <rafalhaase (AT) op (DOT) pl> wrote:
| Quote: | OK. So I created custom connection. I created Direct Data View in Rave. I
created DataText connected with my TRvCustomConnection through DataField and
DataView fields in Rave. The problem is I cannot handle that from Dephi
source code. I tried the Rave help file but with no effect. It says
something about 'tutorial on customizing data connections' but I cannot find
it. If someone can say anything about creating the connection and using it
to transfer data from application to report I'd appreciate.
Thanks in advance.
Rafal.
|
|
|
| Back to top |
|
 |
Rafal Haase Guest
|
Posted: Tue Apr 27, 2004 1:06 pm Post subject: Re: Rave 5.0, Delphi 7 - Creating non-database reports |
|
|
Many thanks for your help. That is what I was asking about. Your effort is
much appreciateed.
Take care.
Użytkownik "S P Briggs" <s.briggs (AT) unknown (DOT) com> napisał w wiadomości
news:408e1b9b$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
Tutorial: Simple Data Connection
1. Run Delphi.
2. On the project form, add a TRvProject component, an TRvSystem
component, an TRvCustomConnection component and a TButton component.
3. Click on the RvProject1 component and select RvSystem1 in the
Engine property of the Object Inspector.
3. Save the project.
4. Select the RvCustomConnection1 component. Select the Events tab of the
Object Inspector. Double-click the OnGetCols event. Double-click the |
OnGetRow event. Double-click the OnOpen event.
| Quote: |
5. Add the following code to the three event handlers in Unit1.pas:
procedure TForm1.RvCustomConnection1GetCols(Connection:
TRvCustomConnection);
begin
Connection.WriteField('MyData', dtString, 50, 'MyData', '');
end;
procedure TForm1.RvCustomConnection1GetRow(Connection:
TRvCustomConnection);
begin
Connection.WriteStrData('This is Line Number ' +
IntToStr(Connection.DataIndex+1), '');
end;
procedure TForm1.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
Connection.DataRows := 100;
end;
7. Double-click the RvProject1 component to launch Rave Report visual
designer.
8. In the designer, select File | New to start a new report project.
9. On the toolbar, select the "Report" tab page.
10. Select the Region component and add it to the page. Resize it to fit
the whole printable page (the area inside the red dashed lines).
11. Select the Databand component and add it to the Region. It will
automatically move to the top and spread across the whole width of the page.
12. Select the DataText component and add it to the white area of the
Databand. Stretch it so that it is most of the page width.
13. Go back to Delphi and run the project (F9).
14. Go back to the visual designer toolbar, select the "New Data
Object" button. A wizard window will appear. Select the "Direct Data View"
option and click the Next button.
15. The next window will list the RvCustomConnection1 component.
Select it and click the Finish button.
16. Select the DataText1 component. In the Object Inspector to the left,
select "DataView1" in the DataView property and "MyData" in the DataField |
property.
| Quote: |
17. Select the Databand1 component. In the Object Inspector to the left,
select "DataView1" in the DataView property.
18. Save the Rave Report.
19. Stop the Delphi project. Go to the form and select the RvProject1
component. In the Object Inspector, enter the path and file name of your |
Rave Report in the ProjectFile property (or browse to it).
| Quote: |
20. On the form, double-click the TButton component and add the
following code:
procedure TForm1.Button1Click(Sender: TObject);
begin
RVProject1.SelectReport('Report1', True);
RvProject1.Execute;
end;
21. Run the delphi project again (F9). Click the button on the form and
then click OK on the preview window that appears. You should see a preview |
of a two page report consisting of 100 lines.
| Quote: |
If you want to print data from an array of strings, replace the code from
step 5 as follows:
procedure TForm1.RvCustomConnection1GetCols(Connection:
TRvCustomConnection);
begin
Connection.WriteField('MyData', dtString, 50, 'MyData', '');
end;
procedure TForm1.RvCustomConnection1GetRow(Connection:
TRvCustomConnection);
begin
Connection.WriteStrData(MyArray[Connection.DataIndex], '');
end;
procedure TForm1.RvCustomConnection1Open(Connection: TRvCustomConnection);
begin
Connection.DataRows := High(MyArray);
end;
Don't forget to replace "MyArray" with the name of your array and "50"
with the length of your longest string. Hope this helps you get started...
"Rafal Haase" <rafalhaase (AT) op (DOT) pl> wrote:
OK. So I created custom connection. I created Direct Data View in Rave. I
created DataText connected with my TRvCustomConnection through DataField
and
DataView fields in Rave. The problem is I cannot handle that from Dephi
source code. I tried the Rave help file but with no effect. It says
something about 'tutorial on customizing data connections' but I cannot
find
it. If someone can say anything about creating the connection and using
it
to transfer data from application to report I'd appreciate.
Thanks in advance.
Rafal.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|