Monday, February 20, 2012

Page number problem when creating reports from VB6

Hi all,

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 directlytry using "Global" Instead of "Shared"|||doesn't seem to work either.. now it only displays 1 on each page|||Have another issue as well. I have a database field which is a number with two decimals, whenever I export the report to file or printer from my VB 6 GUI I loose the decimals (replaced by ,00). This is the samething as with page numbers, when I run the report in design mode it shows correct data. I've formatted the field as both 1,00 and System defualt none works..

any ideas on why the reports get messed up whenever I run and export them from VB6?

No comments:

Post a Comment