Home All Groups Group Topic Archive Search About
Author
1 May 2006 4:03 PM
James
Should be an easy one for you veterans.  Have a DataSet that I'm looping
through with a For Each loop.  There are 500+ records in this DataSet.  For
each record, I'm creating a PDF by exporting an ActiveReport.  So the basic
logic flow is:

Dim rpt As Main = New Main ' This is the activereport

For Each dr In dv.Table.Rows
<set rpt values here>
        rpt.Run(False)

        Dim xPDF As DataDynamics.ActiveReports.Export.Pdf.PdfExport = New
DataDynamics.ActiveReports.Export.Pdf.PdfExport
        xPDF.Export(rpt.Document, mStream)
        pdfPath = Request.PhysicalApplicationPath & "\collection\temppdfs\"
& dr("List_ID") & ".pdf"

        xPDF.Export(rpt.Document, pdfPath)
        xPDF.Dispose()
Next

I'm only able to get about 200 through before it gives me an Out of Memory
exception.  Seems like there is an obvious design flaw, and I'm just not
sure how to structure this so it "reuses" memory.  Any thoughts?

Thanks!

Author
1 May 2006 4:06 PM
Marina Levit [MVP]
To start off, I am not at all familiar with the DataDynamics library.

It looks like for every report, you are calling the Export method twice. Is
there a reason for that?

What is 'mStream'? Some sort of stream object? How is it being instantiated?
Are you closing it?

Show quote
"James" <minork***@gmail.com> wrote in message
news:%23zshThTbGHA.4060@TK2MSFTNGP02.phx.gbl...
> Should be an easy one for you veterans.  Have a DataSet that I'm looping
> through with a For Each loop.  There are 500+ records in this DataSet.
> For each record, I'm creating a PDF by exporting an ActiveReport.  So the
> basic logic flow is:
>
> Dim rpt As Main = New Main ' This is the activereport
>
> For Each dr In dv.Table.Rows
> <set rpt values here>
>        rpt.Run(False)
>
>        Dim xPDF As DataDynamics.ActiveReports.Export.Pdf.PdfExport = New
> DataDynamics.ActiveReports.Export.Pdf.PdfExport
>        xPDF.Export(rpt.Document, mStream)
>        pdfPath = Request.PhysicalApplicationPath & "\collection\temppdfs\"
> & dr("List_ID") & ".pdf"
>
>        xPDF.Export(rpt.Document, pdfPath)
>        xPDF.Dispose()
> Next
>
> I'm only able to get about 200 through before it gives me an Out of Memory
> exception.  Seems like there is an obvious design flaw, and I'm just not
> sure how to structure this so it "reuses" memory.  Any thoughts?
>
> Thanks!
>
Author
1 May 2006 4:15 PM
James
Whoops, 95% sure that's for exporting it to the browser where it actually
opens the PDF.  I "borrowed" the code from their site and I'm pretty sure
that line should be commented.  Running a test shortly to see if that has
anything to do with it.  Thanks for picking up on that!

Show quote
"Marina Levit [MVP]" <someone@nospam.com> wrote in message
news:urWHzkTbGHA.4116@TK2MSFTNGP05.phx.gbl...
> To start off, I am not at all familiar with the DataDynamics library.
>
> It looks like for every report, you are calling the Export method twice.
> Is there a reason for that?
>
> What is 'mStream'? Some sort of stream object? How is it being
> instantiated? Are you closing it?
>
> "James" <minork***@gmail.com> wrote in message
> news:%23zshThTbGHA.4060@TK2MSFTNGP02.phx.gbl...
>> Should be an easy one for you veterans.  Have a DataSet that I'm looping
>> through with a For Each loop.  There are 500+ records in this DataSet.
>> For each record, I'm creating a PDF by exporting an ActiveReport.  So the
>> basic logic flow is:
>>
>> Dim rpt As Main = New Main ' This is the activereport
>>
>> For Each dr In dv.Table.Rows
>> <set rpt values here>
>>        rpt.Run(False)
>>
>>        Dim xPDF As DataDynamics.ActiveReports.Export.Pdf.PdfExport = New
>> DataDynamics.ActiveReports.Export.Pdf.PdfExport
>>        xPDF.Export(rpt.Document, mStream)
>>        pdfPath = Request.PhysicalApplicationPath &
>> "\collection\temppdfs\" & dr("List_ID") & ".pdf"
>>
>>        xPDF.Export(rpt.Document, pdfPath)
>>        xPDF.Dispose()
>> Next
>>
>> I'm only able to get about 200 through before it gives me an Out of
>> Memory exception.  Seems like there is an obvious design flaw, and I'm
>> just not sure how to structure this so it "reuses" memory.  Any thoughts?
>>
>> Thanks!
>>
>
>
Author
1 May 2006 4:30 PM
James
Alas, no luck.  I can comment out that line and all references to the
mStream object...but I'm still getting the OOM Exception =/.  So, basically,
the code is the same, sans that one line you referenced.

Show quote
"James" <minork***@gmail.com> wrote in message
news:eTzcrnTbGHA.3408@TK2MSFTNGP04.phx.gbl...
> Whoops, 95% sure that's for exporting it to the browser where it actually
> opens the PDF.  I "borrowed" the code from their site and I'm pretty sure
> that line should be commented.  Running a test shortly to see if that has
> anything to do with it.  Thanks for picking up on that!
>
> "Marina Levit [MVP]" <someone@nospam.com> wrote in message
> news:urWHzkTbGHA.4116@TK2MSFTNGP05.phx.gbl...
>> To start off, I am not at all familiar with the DataDynamics library.
>>
>> It looks like for every report, you are calling the Export method twice.
>> Is there a reason for that?
>>
>> What is 'mStream'? Some sort of stream object? How is it being
>> instantiated? Are you closing it?
>>
>> "James" <minork***@gmail.com> wrote in message
>> news:%23zshThTbGHA.4060@TK2MSFTNGP02.phx.gbl...
>>> Should be an easy one for you veterans.  Have a DataSet that I'm looping
>>> through with a For Each loop.  There are 500+ records in this DataSet.
>>> For each record, I'm creating a PDF by exporting an ActiveReport.  So
>>> the basic logic flow is:
>>>
>>> Dim rpt As Main = New Main ' This is the activereport
>>>
>>> For Each dr In dv.Table.Rows
>>> <set rpt values here>
>>>        rpt.Run(False)
>>>
>>>        Dim xPDF As DataDynamics.ActiveReports.Export.Pdf.PdfExport = New
>>> DataDynamics.ActiveReports.Export.Pdf.PdfExport
>>>        xPDF.Export(rpt.Document, mStream)
>>>        pdfPath = Request.PhysicalApplicationPath &
>>> "\collection\temppdfs\" & dr("List_ID") & ".pdf"
>>>
>>>        xPDF.Export(rpt.Document, pdfPath)
>>>        xPDF.Dispose()
>>> Next
>>>
>>> I'm only able to get about 200 through before it gives me an Out of
>>> Memory exception.  Seems like there is an obvious design flaw, and I'm
>>> just not sure how to structure this so it "reuses" memory.  Any
>>> thoughts?
>>>
>>> Thanks!
>>>
>>
>>
>
>
Author
1 May 2006 4:37 PM
Marina Levit [MVP]
First off, comment out all the lines of code that actuall export the
document.  See if it is running the report that is the problem.

If the OOM exception goes away when you do that, then I would contact the
component provider and talk to them about it. Otherwise, the memory problem
is with running the report.

Show quote
"James" <minork***@gmail.com> wrote in message
news:%234mYGwTbGHA.2368@TK2MSFTNGP03.phx.gbl...
> Alas, no luck.  I can comment out that line and all references to the
> mStream object...but I'm still getting the OOM Exception =/.  So,
> basically, the code is the same, sans that one line you referenced.
>
> "James" <minork***@gmail.com> wrote in message
> news:eTzcrnTbGHA.3408@TK2MSFTNGP04.phx.gbl...
>> Whoops, 95% sure that's for exporting it to the browser where it actually
>> opens the PDF.  I "borrowed" the code from their site and I'm pretty sure
>> that line should be commented.  Running a test shortly to see if that has
>> anything to do with it.  Thanks for picking up on that!
>>
>> "Marina Levit [MVP]" <someone@nospam.com> wrote in message
>> news:urWHzkTbGHA.4116@TK2MSFTNGP05.phx.gbl...
>>> To start off, I am not at all familiar with the DataDynamics library.
>>>
>>> It looks like for every report, you are calling the Export method twice.
>>> Is there a reason for that?
>>>
>>> What is 'mStream'? Some sort of stream object? How is it being
>>> instantiated? Are you closing it?
>>>
>>> "James" <minork***@gmail.com> wrote in message
>>> news:%23zshThTbGHA.4060@TK2MSFTNGP02.phx.gbl...
>>>> Should be an easy one for you veterans.  Have a DataSet that I'm
>>>> looping through with a For Each loop.  There are 500+ records in this
>>>> DataSet. For each record, I'm creating a PDF by exporting an
>>>> ActiveReport.  So the basic logic flow is:
>>>>
>>>> Dim rpt As Main = New Main ' This is the activereport
>>>>
>>>> For Each dr In dv.Table.Rows
>>>> <set rpt values here>
>>>>        rpt.Run(False)
>>>>
>>>>        Dim xPDF As DataDynamics.ActiveReports.Export.Pdf.PdfExport =
>>>> New DataDynamics.ActiveReports.Export.Pdf.PdfExport
>>>>        xPDF.Export(rpt.Document, mStream)
>>>>        pdfPath = Request.PhysicalApplicationPath &
>>>> "\collection\temppdfs\" & dr("List_ID") & ".pdf"
>>>>
>>>>        xPDF.Export(rpt.Document, pdfPath)
>>>>        xPDF.Dispose()
>>>> Next
>>>>
>>>> I'm only able to get about 200 through before it gives me an Out of
>>>> Memory exception.  Seems like there is an obvious design flaw, and I'm
>>>> just not sure how to structure this so it "reuses" memory.  Any
>>>> thoughts?
>>>>
>>>> Thanks!
>>>>
>>>
>>>
>>
>>
>
>
Author
1 May 2006 5:18 PM
Miha Markic [MVP C#]
I would suggest you to use a memory profiler to find the cause of the
problem.
You might also check .net performance counters.
But I think it has to be something with activereports becuase a DataSet with
500+ records doesn't mean anything to memory usage.
Perhaps a reasonable solution would be to create a simple sample that repros
the issue and send it to DD support.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"James" <minork***@gmail.com> wrote in message
news:%23zshThTbGHA.4060@TK2MSFTNGP02.phx.gbl...
> Should be an easy one for you veterans.  Have a DataSet that I'm looping
> through with a For Each loop.  There are 500+ records in this DataSet.
> For each record, I'm creating a PDF by exporting an ActiveReport.  So the
> basic logic flow is:
>
> Dim rpt As Main = New Main ' This is the activereport
>
> For Each dr In dv.Table.Rows
> <set rpt values here>
>        rpt.Run(False)
>
>        Dim xPDF As DataDynamics.ActiveReports.Export.Pdf.PdfExport = New
> DataDynamics.ActiveReports.Export.Pdf.PdfExport
>        xPDF.Export(rpt.Document, mStream)
>        pdfPath = Request.PhysicalApplicationPath & "\collection\temppdfs\"
> & dr("List_ID") & ".pdf"
>
>        xPDF.Export(rpt.Document, pdfPath)
>        xPDF.Dispose()
> Next
>
> I'm only able to get about 200 through before it gives me an Out of Memory
> exception.  Seems like there is an obvious design flaw, and I'm just not
> sure how to structure this so it "reuses" memory.  Any thoughts?
>
> Thanks!
>

AddThis Social Bookmark Button