Hi everyone,
I've created a marketing tool in Navision 4 SP3 with the attempt to generate an Excel file which can be used in other tools. The result of a selection within this marketing tool is kept in a regular database table. When the user start the export function, this information is send to the Excel buffer and exported to Excel using the Navision standard functions.
My problem is that "Error 131 - An attempt was made to move file pointer before beginning of file" occurs when the number of records exceeds a certain limit. I've already searched the forum and found similar problems, mainly due to the limitation of 2 GB for the temporary files in Navision, but no solution.
I've set the Excel Buffer table to "permanently" to make my export work. In that case, the completely filled Excel Buffer table has a size of only a little more than 160 MB based on 32.000 records, so I can't imagine why a temporary file should exceed 2 GB.
I'm a little bit lost here but would like to avoid marking the Excel Buffer permanently. Therefore all answers and suggestions are welcome! :-)
Thanks in advance!
Sascha
0
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You're right that the size of the table doesn't directly refer to the size of the Excel file. But the final Excle file (after exporting the Excel Buffer table with more than 160 MB) is less than 18 MB. I guess that's due to the large number of records in the buffer table as it contains one record per Excel cell.
Besides the fact that I still can't imagine that the limit of 2 GB can be reached by this export, I don't think that the Navision limitation of 2 GB would apply to the Excel file as this would be a (temporary) file created by the Excel process, not Navision.
Did anyone ever hear of other limitations like the number of records in a temporary table which might explain this error message in my case? I'm looking for ways to create a workaround but currently I don't know around what I have to work around. :?
Thanks in advance for your support ...
Sascha
2) If 1 is "yes", are you using some sections to print some data?
3) If 2 is "no", did you set the property "Processing only" on the report to "True"?
If you are using report and you didn't remove empty sections for your dataitems and you didn't changed the report to "processing only", the report is "printing" to many pages. These pages are generated into temp file first, and size of this file may be the problem.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The basic function of that report is that it first transfers the data from my result table to the Navision table Excel Buffer. After that the Excel function is used to transfer this data to Excel. The error already occurs in the first part of the report (where Excel isn't involved yet) when the data from the result table is transfered to the temporary table Excel Buffer.
Is there a way to verify the size of the Navision temp file (to be honest I've got no idea where this is supposed to be, I guess somewhere in local settings\temp ...)? I'm still not willing to believe that this file exceeds 2 GB in my sitatuation as the table size (when I turn the temporary property off) is only 160 MB.
Thanks again in advance for all contributions :-)
I couldn't believe it but indeed the problem is caused by the 2 GB limit of the temporary file! I've just watched the temp folder while running my report and the size of the temp file which is created then goes up to 2 GB. I would be quite curious to know in what kind of structure the data is stored there (as pointed before, in a "real" table only 160 MB are required including all keys).
Nevertheless, I guess I've got to accept that as this obviously is the reason for my problem, too.
I guess I'll use a regular table and take care of cleaning up this "temp" table myself. ](*,)
Thanks for your help kine and matttrax!
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I guess having the table structure in a plain file creates some kind of overhead ... I just couldn't imagine it was that much :-)
Thanks again.