Reports and subreports

  • Thread starter Thread starter Dim
  • Start date Start date
D

Dim

Ok i realize that this must be such question that everybody knows the answer
for... everybody but me ;-)

I have a report (yippiiii) that i fill with some data programmatically (this
is important) cause there's some variables
in code behind that decide which data should be picked. Therefore it's not
possible to fill report with a predefined query.

Report is built as follows:

Heads (don't care about them)
XXXX XXXX XXXX XXXX XXXX XXXX

and here comes data
xxxxx1 xxxxx2 xxxxx3 0000 00000 00000
00000 0000 00000
0000 0000 00000


The last three columns (0000) are picked from another table
and can be more than one. I guessed that a subreport
might be a proper solution, but here is where i run into major problems.
Subreport's recourd source is also set programmatically because
it depends on the first main column (xxxx1) (id column) and
sql i built directly in code
Now i discovered that i cannot change RecordSource of my subreport
during previewing so every item is displayed with the same subreport :-(
And i can't change any fields in subreport as soon as it began previewing.
It seemss that subreport loads only once first time, and after that the same
copy
is used through all posts.... :-(

I tried to link subreport fields with master fields (in properties dialog),
but it didn't work because
master fields are not defined at design time... cause i just have bunch of
"Unbound" text
boxes.

i hope i explained myself clear enough....
What is possible to do in this situation.....

Thanks
 
Dim said:
Ok i realize that this must be such question that everybody knows the answer
for... everybody but me ;-)

I have a report (yippiiii) that i fill with some data programmatically (this
is important) cause there's some variables
in code behind that decide which data should be picked. Therefore it's not
possible to fill report with a predefined query.

Report is built as follows:

Heads (don't care about them)
XXXX XXXX XXXX XXXX XXXX XXXX

and here comes data
xxxxx1 xxxxx2 xxxxx3 0000 00000 00000
00000 0000 00000
0000 0000 00000


The last three columns (0000) are picked from another table
and can be more than one. I guessed that a subreport
might be a proper solution, but here is where i run into major problems.
Subreport's recourd source is also set programmatically because
it depends on the first main column (xxxx1) (id column) and
sql i built directly in code
Now i discovered that i cannot change RecordSource of my subreport
during previewing so every item is displayed with the same subreport :-(
And i can't change any fields in subreport as soon as it began previewing.
It seemss that subreport loads only once first time, and after that the same
copy
is used through all posts.... :-(

I tried to link subreport fields with master fields (in properties dialog),
but it didn't work because
master fields are not defined at design time... cause i just have bunch of
"Unbound" text
boxes.

i hope i explained myself clear enough....
What is possible to do in this situation.....

I'm afraid this is not explained "clear enough" for me, but
I did want to point out that the LinkMaster property can
refer to a text box (either bound or unbound).

I think it might be possible for you to add an invisible
text box and when your code determines the linking value
assign it to the text box. The subreport should then be
able to so something like what I think you might be asking
about.
 
Back
Top