QReport and reusable bands

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 ??
Who is Participating?
dwwangConnect With a Mentor Commented:
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.
lecossoisAuthor Commented:
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 ?

lecossoisAuthor Commented:
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).

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
lecossoisAuthor Commented:
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.
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.

lecossoisAuthor Commented:
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.

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,...


in the form.oncreate event, write
  //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)
Do this help?
lecossoisAuthor Commented:
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.
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.
lecossoisAuthor Commented:
Thank you Dwwang !!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.