When suggesting solutions for the Picture-problem in my blog about the OutOfMemoryException, I talked about a possibility to work with an extra dataset to provide a picture, separated from your invoice dataset.
People were interested, so I wrote a blog about it, but haven't published it yet. I'm going to .. but I felt forced in blogging this one first .. as in my opinion, my dataset-solution was too far-fetched, and I didn't want anyone to start implementing it, while there are better solutions.
First of all, I got the suggestion to "split the one big dataset" (one print of one report of multiple documents) into printing that one report multiple times (each document is a separate REPORT.RUN).. . That might work to solve the OutOfMemoryException .. but you're not quite sure, are you? If you still have many lines on the report, then you'll be running into the same problems .. . I hope I didn't misunderstand the proposed solution. At least many thanks to Craig!
But then I got this comment on that blog from a person where I don't know the name of (signed by "deV.ch"):
Wouldn't a simple clear on the blob field on the following dataitem (lets assume its sales line) be enough to have the picture only on the first row?
That actually made much sense, but seemed too simple to not have thought of it. For testing this, I took a small shortcut (didn't test too much, just went for the suggestion, rammed some code in the default code, didn't do anything for documenting this, ...). The picture fields are in the PageLoop-Header section, so I though I was safe to add the CLEARs on the SalesinvoiceLine-dataitem, like this:
And it does exactly what we were intending to do: only the picture in the first line of the dataset.
My dataset-solution was clearly too far-fetched!
Marvelous! I'm quite ashamed because most probably, I would have done it in a much more complex way, while there was no reason.. . . But i'm thankful to the community! :-)
Goh .. to be honest, when a report is using too much memory, I don't want to solve it with doing anything on Windows/hardware/infrastructure level.
It smells too much on something you have to adjust on the report itself..
One of my partner's cust. face with this error. So she found at one of forum said need to increase virtual memory. How do you think on that.
Thanks again, Marco! :-)
@Steven: you're very right indeed. And mostly, the simplest solutions are the hardest to find..
Hey waldo, i'am proud to be named in a blog post of you :).
BTW: my name is Marco
I must admit I didn't thought of that too ...
Great tip ! The simplest solutions are always the best :)