Solved

QReport and reusable bands

Posted on 1998-10-14
12
274 Views
Last Modified: 2010-04-06
I need a report with a title band and a "body" (the rest of the report).  The title band is the same for all reports in one project (inherited from a form in the object repository).  This title band is different for each project.

But the body remains the same throughout all my projects.  So how can I share part of my report in all my projects ??

If I use the object repository then a new form would have to inherit something from two forms (inherit the title and the body).  Is this possible ??  And is there another way to achieve this result ??
0
Comment
Question by:lecossois
  • 6
  • 6
12 Comments
 

Author Comment

by:lecossois
ID: 1342803
Your answer contains some good ideas, but it's not exactly what I'm looking for :

Copying the files for each project would mean that modifications to the original report have to be done for each project.  But that could be solved by keeping the original report in one directory, and adding the files from that directory.  That way there is never more than one copy of the report.

As I explained in the question, the title is defined in a form that resides in the object repository.  Normally, I create a new form that inherits the title band, and then I add the rest of the report.

Your answer suggests to do it the other way round.  First create the report, and then "apply" the title.  But is it possible to inherit properties of a form (through the object repository) *after* the new form has been created ?

0
 
LVL 4

Accepted Solution

by:
dwwang earned 100 total points
ID: 1342804
Hi, this is dwwang again and the answer is also yes.

You must do that in the "reverse" order:

create your form with the shared QR body, then right click the for and select add to repository.There you can select the name and where to add to the repos. By doing this, the body can be shared by all projects.

After that, open one specific project and then new a form by inherit from the shared-body form, then add your shared (in this project) title band to the form and save it.

Next step will be what you are already doing now-- create forms by inheriting the per-project-shared form.
0
 

Author Comment

by:lecossois
ID: 1342805
When you say "then add your shared (in this project) title band to the form", does that mean that the title band gets inherited, or do you means just copy and paste ?  If not inherited, any changes to the report needs to be done in every report (of a project).

Otherwise, how can I inherit the title band after the body (I don't know how to do it with the object repository).

0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 4

Expert Comment

by:dwwang
ID: 1342806
Hi, sorry for not revisiting this tpic for long time.

Yes, when I say "then add your shared (in this project) title band to the form", I mean just copy and paste, but maybe you miss the third step, which is "Do what you are already doing now-- create forms by inheriting the per-project-shared form."

I mean that after you copy and paste the title band on the form (which  has the detail band on it), you should again put this form (with now has two bands) to the object repository, then in your project, create new forms by inheriting from this two-bands-form, that will do the trick.
0
 

Author Comment

by:lecossois
ID: 1342807
When I have the final report (with the two bands), I don't need to put that in the object repository, because it is the final result that I am looking for.  There is no need to inherit from that form.  Your solution would require me to do any modification in the title band in all reports for a project, which is exactly what I would like to avoid.

I think you misunderstood my question, but that is due to my bad explanation of the problem.  I'm sorry for that, but let me try to explain it again.

So I need a report with two bands : one inherited from a "title" report, one inherited from a "detail" report.  The title band is used within one project (a different title for each project).  The detail band is used once in each project, but is used in several projects.  The report with the two bands is the final result, and any modifications to the title or detail band should be visible in that report.

I hope this makes it clear.  If not, I will have to try to explain it in another way.
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342808
Well, I think you explained your ideas clearly, but the problem is how many report are there in each project?

You said :"I don't need to put that in the object repository, because it is the final result that I am looking for."

So what's the difference between reports in your single project?(since their title and detail band are all the same)

If their are any (differences between several reports in one project), you can just put the form (which you think to be the final one) to object repository, and let those different forms inherit from it, so you can do necessory modifications to those new forms, while keep all the forms with the same title band.

Still remember last question, now it's all the same ideas, the only different is take one more step.

0
 

Author Comment

by:lecossois
ID: 1342809
Let me give you an idea of the number of projects.  There are about 20 different reports, that are used in each project.

For each project, these 20 reports come back, but the title band is different for each project.  That title band is the same WITHIN the project.  A detail band will come back ONCE in each project.

So when you look at one project, the detail band is different for each report, but the title band is the same.

When you look at all the projects, you see the 20 reports coming back in each project, but with a different title band in each project.

So there are never two reports with the same title/detail combination.  Putting such a report in the object repository wouldn't make sense, because there is never going to be a form that inherits from it.



0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342810
OK, finally I get it, actually I had thought of that kind of situation, but didn't expect it to come true -- a two dimensional structure.

Due to the limitation of visual inheritance, you must solve that problem in a combined way, that is, to use both inheritance and instances. Below is my method:

1. Still create form with the title band and the quick report, (for use by inheritance)

2. Create a form with all you 20 detail bands, all properly designed on look.

3. In each of your project, inherit from the title-band form as well as USE the form with detail bands.(don't forget to set the form creation order, to create the detail-band first, then the final report)

The final report form should look like this:

uses detailform,...
.


private
    mydetailband:TQRBand;
.....

in the form.oncreate event, write
  mydetailband:=DetailForm.neededDetailBand;
  mydetailBand.Parent:=Myquickrep;
  //set other properties if necessary;

Above are only some points of making all these work, you can try it, and give some comments if meet problem.(I already havd a simple test and it works well)
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342811
Do this help?
0
 

Author Comment

by:lecossois
ID: 1342812
I'm sorry Dwwang, but I have a busy week.  I will look at it this weekend.  I will let you know Monday if it works.
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1342813
Hi, never mind, I don't mean a hurry, the last sentecnce "do this help" is just for the purpose of turning on the mail notification function here.

By the way, the method I suggested may not be easy to use, good luck.
0
 

Author Comment

by:lecossois
ID: 1342814
Thank you Dwwang !!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question