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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stringvar only displaying on last page

Status
Not open for further replies.

mflahive

MIS
Nov 29, 2004
25
US
Hello,
I am having a problem using a stringvar on a report I am working on. Here's what I have for formulas:

@reset located in page header on main report
WhilePrintingRecords;
shared stringvar X := " ";

@declare located in group header (borrower) on subreport
WhilePrintingRecords;
Shared stringVar X;
X := X + {table.field} + chr(10) + chr(13) + chr(10) + chr(13);

@display located in page footer on main report
WhilePrintingRecords;
Shared stringVar X := X;

The subreport is located in a group header which and I am using underlay to fill out a template in the page header. The report is set to have 3 borrowers per page.

The problem I have is when there are > 3 borrowers and then @display shows only on the last page. I would like it to show for whatever borrower is on the page you happen to be looking at (basically 3 per page).

Thank you.
 
The subreport is linked on all three groups. Pool ID and Rela ID are parameters set up in the Main Report and the subreport is linked to those parameters as well as the Borrower ID field is linked to the Group #3 Borrower name.

{@sharedvar}
whileprintingrecords;
shared stringvar X := X + {table.Memo Field} + chr(13)+chr(13);

The {@display} and the {@sharedvar} are both formatted to "can grow"

I noticed that if I create a parameter for Borrower ID in the Main Report and link that parameter to the Group #3 Borrower then I do get 3 Borrowers on the 1st page and the 4th borrower on the 2nd. The problem is I get 8 pages total with no comments showing on the 1st page and all 4 comments are on everypage thereafter.

My thought is that I am linking the subreport incorrectly although everything I've tried has been unsuccessful.
Thanks.
M
 
First, the shared variable formula will only pick up a comment that occurs in the first detail of the borrower group, because you have it located in the group header. If you want to pick up all comments from that borrower, place {@sharedvar} in the group footer for borrower.

Next, instead of linking on the parameters from the main report, try linking on the fields themselves: {table.poolID},{table.relaID}, and {table.borrowerID}.

-LB
 
I am able to link the {table.borrowerID} and {table.RelaID} to the subreport, however, because the {table.PoolID} field is a Number I am not able to link it to the Group #1 name.

When I create a formula to change the field to a string and link that to the Group #1 name I get the same issue as before with the report showing 1 Borrower per page.

M
 
Also, when I preview the subreport everything shows up correctly. It's only previewing the entire report that shows one borrower per page.
 
You MUST link on that field. Stepping back for a moment, it is unclear why you need a subreport if you are only using the main report for page headers and the background template.

If you don't have any page breaks formatted, then I'm not sure what's going on. It might have something to do with the multiple columns.

-LB
 
It probably is the format to multiple columns in the subreport that is the problem.

I tried not using a subreport and I used the multiple columns on the main report but because the template in the Page Header contains text boxes on the left side to label the borrower's fields, the report then shows all 4 borrowers on one page with Borrower #1's fields covering the text boxes.

I don't if there is a way to move the borrower fields over to start in the next column.

I hope that made sense.
M
 
Okay, I think I have it figured out. If you don't link on the borrower ID field, you will get the borrowerID repeated for each occurence of group #2, but if you do link on it, you lose the multiple columns--because there is only one group per subreport instance. So this is what you should do:

First, you should move {@sharedvar} to the detail section in the subreport. {@Shared var} should look like:

whileprintingrecords;
shared stringvar x := x + {table.comment} + chr(13)+ chr(13);

Then add another formula {@shvardispl} to the Group #3 footer in the subreport:

whileprintingrecords;
shared stringvar x;

Also move any other fields you have in the subreport group header that you want displayed in the group footer. You would still only display GF#3, and suppress the details. If you don't use this approach, you will only get the first comment for that group or nothing--if the comment in the first record is null.

Second, undo the "format with multiple columns" in the subreport, and instead, format the main report with "format with multiple columns". I think you should put the settings at something like 2" wide and .5 gap, "across then down", and check "format groups with multiple columns". Resize the subreport as necessary to fit into one of the columns.

Make sure that the subreport is linked to the main report on all three fields (not the main report parameters). Now the only problem I see is that the comments in the page footer are separated by multiple returns, so that it might be hard to fit them all on the page. I would remove the returns in {@accum} so that there is only one line space between comments in the page footer.

This is now working I think as you like with multiple columns in my sample report.

-LB
 
The problem with using the multiple columns on the main report is with the text boxes in the page header which takes up 1.5" so I need the subreport set 1.5" from the left margin so the borrower information won't cover the text boxes. Setting 2" wide only allows me to see .5 inches of each borrower's info due to the distance from the left margin.

Are you also using the text box labels in your sample report?

 
If there was a way to start the multiple columns 1.5" from the left margin so I could keep my text boxes and then use 1.75" wide with a 1" gap, the report would work but I'm not sure if it's possible.
 
What is the purpose and content of the text boxes? Maybe this could be handled differently.

-LB
 
I have to use the template given to me by Management which is such:

TEXT BOXES BOXES

Borrower name [ ] [ ] [ ]
Borrower Address [ ] [ ] [ ]
SSN [ ] [ ] [ ]
FICO/Date [ ] [ ] [ ]

etc...

After the text boxes (i.e. Borrower Name) there are 3 boxes per row to hold the 3 borrowers information.

The template is set in the Page Header because if for example there are 4 borrowers, they still want to see the text boxes and the 2 other empty boxes (after the 4th borrower) on the second page.

Someone in Management created this template in Excel and all the information was put in manually because at one point everything was done in Excel. Now they have a database and VB application which they're using to store the info and they want a report that looks and acts just like the excel doc.




 
I wonder if you'd want to try something entirely different. What you have is a crosstab display here, and you could avoid using the template by using a crosstab. First you would create a formula in the main report {@grp}:

numbervar col;
stringvar x;

if instr(x,{table.borrowerID}) = 0 then
(x := x + {table.borrowerID};
col := col + 1);
if col in 1 to 3 then 1 else
if col in 4 to 6 then 2 else
if col in 7 to 9 then 3 //etc., up to the number of groups of three (the number of pages)

Place the formula in the detail section and then insert a group on it, and format the group footer for "new page after".

Then insert a subreport, and in the subreport, create the same formula {@grp} and place it in the detail section. Insert a crosstab in the subreport report footer, which uses {table.borrowerID} as the column, has no row field, and uses the fields you want to display as summary fields, e.g., {table.borrowername},{table.address},{table.SSN},{table.FICOdate}, using maximum as the summary (since there is only one per borrower). Next, in preview, edit the total row label by right clicking on it->edit text object, and erase "Total" and enter "Borrower Name <enter a return>Borrower Address <enter a return> SSN <enter a return>FICO/Date. Resize the label.

Suppress all sections of the subreport except the subreport footer and place it in the group (grp) footer in the main report. Link the subreport to the main report on the {@grp} formulas in each.

To get the comments in the page footer for each page, save the subreport under another name and then import it as a subreport in the main report page footer, again linking it to the main report on {@grp}. Next insert a crosstab in report footer_b of the subreport, which uses {table.comment} as the row AND as the summary field (choose maximum again). Then suppress the row and column labels and eliminate the grid by going to the customize style tab->format grid lines->uncheck "Show grid". Resize the labels to make them as narrow as possible so they don't use too much white space.

I know this is a long shot, but you might want to experiment with it. You would still use the parameters, but only to limit records in the selection formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top