Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Chaining reports

Status
Not open for further replies.

Stefan5627

Programmer
Jul 23, 2002
71
NL
Hi all,

I would like to chain 2 reports
I use code like
Code:
  loListener = newobject('_ReportListener', ;
   home() + 'ffc\_ReportListener.vcx')
   loListener.ListenerType = 1
   loListener.AddReport('MyReport1.frx', ;
     'nopageeject')
   loListener.AddReport('MyReport2.frx')
   loListener.RunReports()
The second report starts on a new page
(How) can i let it start directly below the summary band of report 1 (on the same page)?
 
Look out, if the report2 is configured to start new groups on a new page, because then "nopageeject" has no influence on the first page of report2 starting on a new page.

Bye, Olaf.
 
Thanks for the reply Olaf,

report 1 uses no grouping
report 2 does use grouping, but each group starts on a new line

I tried doing the same with 2 simple reports (neither uses grouping) and also there report 2 starts on a new page.

Is it theoreticly possible to start report 2 on a new line after report 1?


Stefan
 
Yes, the NOPAGEEJECT clause you pass in should do that. But have you SET REPORTBEHAVIOR 90?

Bye, Olaf.
 
Just to rule out any problem in your reports:

Report form Report1 NoPageEject to printer
Report form Report2 to printer

(Note that you don't need a ReportListener for this!)

Also remember, NoPageEject is ignored in the command window. You have to be running a program.
 
@danfreeman:
Report form Report1 NoPageEject to printer
Report form Report2 to printer

If this should work then there must be a problem in my reports because it doesn't work, the second report still starts on page 2 instead of page 1
I would however like to print from the preview.

like i said report 1 doesn't use grouping, report 2 does.
In report 2 each new group starts on a new line.
I tried changing the 'reprint group header on each page' setting but no luck there

What else can i change in my report?



@OlafDosche:
reportbehavior was set to 80, but changing it to 90 didn't make a difference
 
I would however like to print from the preview."

Well, this does not work in the preview, can it?

Doing
Report form Report1 NoPageEject preview to printer
Report form Report2 preview to printer

Would create two previews and NoPageEject has no effect then.

Bye, Olaf.
 
Because i want to preview i use the reportlistener.
I tried using danfreeman's method just to see if it would work.
Might using a pageheader be a problem?
Shall i encapsulate the report in another group and use that groupheader to replace the pageheader?
My boss has got me working on another project right now so i don't know when i get around to trying that...
 
Well, a page header is a page header.

The help says: Displays information or data that displays once per page at the beginning of the page.

At the beginning of the page is at the beginning of the page.

There are optional bands, eg title and summary bands. The title band might work better for you.

I, like you, cannot try at the moment.

Bye, Olaf.


 
Might using a pageheader be a problem?

Yes, as Olaf explains. The page header is the first thing printed on a page. How could it possibly *ever* be printed anywhere but at the top of a new page?

You could add another grouping, and control printing the group header through a report variable so that it only prints once.
 
I removed the pageheader and pagefooter. I only use detailband and summary band and still the second report starts on the next page
I can't get it to work

I attached a simple testcase
I make 2 cursors that I use in 2 reports
The reports only have a detailband and still the 2nd report starts on page 2
What am I doing wrong?
If it is possible to start the 2nd report on the next line after the 1st report, I must be overlooking something...
 
 http://www.mediafire.com/?q2g5ano0f2hfw7o
I found something that's discouraging, but at least should end all efforts to get this working. This disclaimers says the help is wrong and no windows version of vfp can print reports on the same page. you only can chain reports in a print job, but each one will start on a new page:

(read the symptoms section).

Bye, Olaf.
 
Hi Olaf,

Not the news I was hoping for but I'm glad I got an answer to my question.
Thank you for finding this information.
 
Now that you say that, Olaf, I realize that of course, I knew that. What NOPAGEEJECT gives you is the ability to start the next report on the back of the same page.

Tamar
 
Yes, Tamar, actually I also found you saying so in the MS Fox General Forum, too. I thought I'd link the official MS disclaimer, though.

To give alittle hope, you might be able to use Generic/Text printer to print what you want, although I doubt it will differ in respect of the Form Feed sent to it. At least you can get control with ??? with the Generic Text printer, but that is really low level, eg you need to send printer commands, escape sequences and such.

A much easier solution might be to turn all your reporting over to automating Word or Excel and then have full control over paging etc.

Bye, Olaf.
 
You know, we don't know enough about the actual requirements here to rule out multiple detail bands.

Is it possible the two reports could be combined into one? That would solve the pagination issue. <g>
 
That's indeed true, dan.

Even with the object assisted extension of FRXes I have already done much more in Word or excel automation. It's much easier to pass on a word object reference so each single reporting class adds it's pages or continues to "print" at the current end of the document, than to combine FRXes. If it's mainly detail bands you can easier combine that, but as Stfan said he also has a pageheader in report2, so I assume it's more complex.

From the technical perspecitve you can of course quite simpy append the frx data of two reports minus some header records you don't want repeated. Still I assume it's not in general doable to chain reports by chaining their records or copying their bands into one.

Bye, Olaf.
 
multiple detailbands won't work because the second report uses grouping, the first one doesn't.

word automation is to slow. I am thinking about exploring the possibilities of generating a word xml document (no automation, just text) but I don't have the time right now.
Does anyone have any experience with generating wordfiles this way (I know this is a new topic in itself).

The first report shouldn't have more than 15 lines or so, so I will put those lines in the titleband of the second report and use the remove line if blank checkbox.

Thanks for all the suggestions so far,

Stefan
 
If report1 is the simply report, being merely an optional titleband, then yes, that's what I would also do.

Feel free to ask a new question about Office XML. In the back of my mind I think I know a little demo of doing so using XSLT transformations.

I don't think of Word automation as being too slow, especially if you keep it hidden as long as you do your output, but that may depend, especially for shorter reports an frx is much faster, just taking into account the time needed to create a word instance, if it's not running.

At least in comparsion to REPORTBEHAVIOR 90 Word automation wins for me, not because of speed. Reportbehavior 90 got a little slower than the old engine was. It uses gdiplus, while that has been superseeded by DirectX 2D nowadays.

XML generation is quite fast, sure. But that would depend on Office 2003 with add ons to be able to load Office XML or newer Office versions.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top