in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1Report.RenderToFilter(C1.Win.C1Report.TiffFilter): "A generic error occurred in GDI+."

Last post 05-14-2008 10:51 AM by estory. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-14-2008 10:51 AM

    • estory
    • Not Ranked
    • Joined on 05-14-2008
    • Posts 1

    C1Report.RenderToFilter(C1.Win.C1Report.TiffFilter): "A generic error occurred in GDI+."

    The following code produces this exception and the stack trace (to the last method in the stack before my method calling RenderToFilter) in footnote [1]:

    private Bitmap[] CreateTiffs(C1Report report) {

    MemoryStream ms = new MemoryStream();

    TiffFilter filter = new TiffFilter(ms);

    filter.Resolution = 210;

    report.RenderToFilter(filter);

    ...

    // create and populate myBitmapArray, create TIFFs, etc.

    ...

    ms.Close();

    ms.Dispose();

    filter.Dispose();

    return myBitmapArray;

    The only thing I can determine is that this exception occurs only when the number of calls to RenderToFilter is fairly-large (I have looped this method to create TIFFs from a set of over 500 reports, without error).  But the amount of data shouldn't matter...

    Has anybody seen this before?  Is this a bug (whether in .NET or in the C1Report class), and if so, is there a workaround?

     

    [1]

    System.Runtime.InteropServices.ExternalException was unhandled
      Message="A generic error occurred in GDI+."
      Source="System.Drawing"
      ErrorCode=-2147467259
      StackTrace:
           at System.Drawing.Image.SaveAdd(Image image, EncoderParameters encoderParams)
           at C1.Win.C1Report.TiffFilter.EndReport()
           at C1.Win.C1Report.Layout.ab()
           at C1.Win.C1Report.C1Report.x()
           at C1.Win.C1Report.C1Report.ad(ExportFilter A_0, Boolean A_1)
           at C1.Win.C1Report.C1Report.RenderToFilter(ExportFilter filter)

     

Page 1 of 1 (1 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.