Page number problem when creating reports from VB6
I have a very annoying problem. I use Crystal Reports 8 and I have several reports that are "created" from a VB 6 gui, well they're instansiated and loaded with params from VB. While doing this the reports seem to loose there page numbers. The reports use SP's in a MSSQL 2000 db. This problem does not seem to occur whenever I run the report in design mode but as soon as I try to create them from my VB applications all special fields that has anything to do with page numbers fail. Eg the Page N of M equals Page -1 of 1 which of couse is incorrect.
I've tried with a formula that I saw in a forum somewhere, it was something like:
shared numbervar PageNo;
PageNo := PageNo +1;
PageNo;
and put it in the Page Footer, however I have the same problem here, it works in design mode but not from VB6. Also, doesn't the declaration on the first line reset the variabel each time the formula runs or is it just a redeclaration?
Does anyone have any clues on what I can do? I'm stuck, seems like I've tried everything I can think of. Also, as far as I can see I don't reset the pagenumber after any section, so that shouldn't be an issue either..
Please help me with this one, I've tried searching every forum I've found but haven't come a cross a solution yet!
Regards,
neiden
edit::
I export the reports from VB6 to either a file in .rtf format or print it directly

