Fast Report with Asp.Net with direct export


Hi,

As a long time Delphi developer, I was excited when I realized that FR is now available for .Net, and I decided to give it a try.

However, before I start using your product, I have a question regarding the Asp.Net implementation.

Now, I am using Crystal Reports for Asp.Net reporting tool, without using any preview component.
Instead I'm exporting the report to .xls or .pdf stream, and send the file stream as a byte array to the user as a file.

Sample code:

Stream st = null;
st = rpt.ExportToStream(ExportFormatType.PortableDocFormat);
string friendlyName = "Some friendly name";
friendlyName = reportTitle + ".pdf";

response.ClearContent();
response.ClearHeaders();
response.ContentType = "Application/PDF";
response.AddHeader("Content-Disposition", "attachment;filename=" + friendlyName);

Byte[] buffer = new Byte[st.Length];
st.Read(buffer, 0, (int)st.Length);
response.BinaryWrite(buffer);
response.End();


For this feature, I need ExportToStream method / capability. Is it available for FR ? If not, will it be available in the near future ?

Thanks, Trebor

P.S. I know that .pdf and .xls exporting is still in development, but for testing purposes, it's O.K. for me to use other export filters ( html or .jpeg ).

Comments

  • edited 8:09PM
    Hello,

    You can use the Report component (instead of WebReport) and call its Export method. It's described in the Programmer's Manual:

    - prepare a report using the Prepare method;
    - create an instance of export filter and set up its properties;
    - call the Export method of the Report object.

  • edited 8:09PM
    AlexTZ wrote: »
    Hello,

    You can use the Report component (instead of WebReport) and call its Export method. It's described in the Programmer's Manual:

    - prepare a report using the Prepare method;
    - create an instance of export filter and set up its properties;
    - call the Export method of the Report object.


    Will it behave well in Asp.Net environment (regarding the concurrent / multi user access ) ?

    Thanks, Robert
  • edited 8:09PM
    It should, as long as one Report component is used to build/export one report.
    The only thing you need to do is to set Config.WebMode property to true.
  •     protected void Button1_Click(object sender, EventArgs e)
        {
            Report rep = WebReport1.Report;
            rep.Prepare();
            FastReport.Export.ExportBase exp = new FastReport.Export.ExportBase();
            rep.Export(exp, "C:\\aa.xls");
        }
    
    hi alex
    how can i print report manually. i wrote these codes but aa.xls file was empty
    which exportfilter properties can i change it or set it
  • edited 8:09PM
    Hello,

    You should use XMLExport class instead of ExportBase.
  • edited 8:09PM
    AlexTZ wrote: »
    Hello,

    You should use XMLExport class instead of ExportBase.

    Hi Alex

    I want to export multiple pages to bmp and then later append that bmp pages to pdf file. Please help me to achieve this.

    Export to Bmp

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.