locked
Report Export To Text File RRS feed

  • Question

  • Hi All, 

    I'm using VS 2005 C#. How can I export the Crystal Reports into a text file programatically? Even the export button in the report view does not have that option. But when I run the report inside vs 2005 env, it is one of the export options.

    I have been searching a lot but it seems not possible? The only things I can found is to export into pdf w/c I'm currently using now and to excel. I was required to export it in text file. It is not only 1 report that I have to export to text file and also in a complex format so I'm putting the manual creation of text (using streamreader) as last option. Exporting could be the easiest way.

     

    I hope you can help me. Thanks 

     

    Khrizz

     


    khrizz tell
    Monday, March 21, 2011 11:50 AM

Answers

  • Hi khrizz tell,

    Ah, that reminds me, there was a limitation within CR for VS even when coding, it was limited to only some formats. It's a CR Basic limitation only.

    The Report Viewer built into the IDE is old legacy RDC and uses the legacy ActiveX viewer CRViewer.dll and it's legacy export option abilities. Unfortunately that component is not distributable and is for use in the IDE only.

    All I can suggest is you upgrade to VS 2010 and CR for VS 2010 then you have full functionality. Only thing missing is an external Report Designer.

    You can get the CR for VS plug-in from this link. Also note, you can not use VS Express, it doesn't support plug-ins.

    Or upgrade to CR 2008, then you also have full functionality.

    Thank you

    Don

     


    Don Williams
    • Marked as answer by Mio_Miao Wednesday, March 30, 2011 11:50 AM
    Wednesday, March 23, 2011 5:35 PM

All replies

  • Hello, The viewer has limited exporting options in CR Basic.

    Create your own export button on the form and use the engine to do the exporting.

    Thank you

    Don


    Don Williams
    Monday, March 21, 2011 12:53 PM
  • Thanks Don. I've already done that, exporting CR to PDF in code. Something like this.

      expo = oRDoc.ExportOptions;
          
          expo.ExportDestinationType = ExportDestinationType.DiskFile;
          expo.ExportFormatType = ExportFormatType.PortableDocFormat;
           
          expo.DestinationOptions = oDfDopt;
        
    
          try
          {
            oRDoc.Export();
            //oRDoc.ExportToDisk(ExportFormatType.PortableDocFormat, strPdfFileDestinationPath);
          }
          catch (Exception ex)
          {
            throw ex;
          }
          finally {
            oRDoc.Dispose();
            oRDoc = null;
     
          }
    
    But I cannot do this to export CR to text file. Any idea?


    khrizz tell
    Monday, March 21, 2011 1:32 PM
  • Hi khrizz tell,

    Ah, that reminds me, there was a limitation within CR for VS even when coding, it was limited to only some formats. It's a CR Basic limitation only.

    The Report Viewer built into the IDE is old legacy RDC and uses the legacy ActiveX viewer CRViewer.dll and it's legacy export option abilities. Unfortunately that component is not distributable and is for use in the IDE only.

    All I can suggest is you upgrade to VS 2010 and CR for VS 2010 then you have full functionality. Only thing missing is an external Report Designer.

    You can get the CR for VS plug-in from this link. Also note, you can not use VS Express, it doesn't support plug-ins.

    Or upgrade to CR 2008, then you also have full functionality.

    Thank you

    Don

     


    Don Williams
    • Marked as answer by Mio_Miao Wednesday, March 30, 2011 11:50 AM
    Wednesday, March 23, 2011 5:35 PM