Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crystal Reports
#4
(09-15-2020, 09:22 AM)Alexandre Machado Wrote: Most developers create PDF based reports which are the standard for web reports.

There are a couple of demos that show how the basics should work when generating a report. More specifically, using the file cache.

You basically generate a PDF file using any report generator, including Crystal, and add it to the cache. Then you just use it as any PDF file in a web application.

For instance this one: https://github.com/Atozed/IntraWeb/tree/...eTimeCache

Also,

Just make sure that your report writer is set to be threadsafe. 

here is some example code for reportbuilder

Code:
procedure fxProcess_Report(ARBreport:TppReport;Output_type:string; Send_Stream:boolean=false;AFileName:string='';APdfPassword:string='');
var lFileName,
    lURL,
    lFileDir:string;
    lMS : TMemoryStream;
    lPDFDevice: TppPDFDevice;
begin

      lFileName := 'test';

      try
        with ARBreport do
          begin
            AllowPrintToFile := False;
            ShowPrintDialog := False;
            TextFileName := lFileDir;
            DeviceType := 'PDF';
            ModalCancelDialog := false;
            ModalPreview := false;
            ShowCancelDialog := false;
            lMS := TMemoryStream.Create;
            lPDFDevice := TppPDFDevice.Create(nil);
            try
              lPDFDevice.PDFSettings := ARBreport.PDFSettings;
              lPDFDevice.OutPutSTream := lMS;
              lPDFDevice.Publisher := ARBreport.publisher;
              ARBreport.PrintToDevices;
              lURL := IWappCache.TIWAppCache.StreamToCacheFile(WebApplication, lMS, TIWMimeTypes.GetAsString('.' + 'PDF'), ctOneTime);
//              WebApplication.SendStream(MS,false,HD.ContentType,Afilename);
              WebApplication.NewWindow( lURL
                                , 'Report'
                                , 0
                                , 0
                                , [woResizable, woDetectBlock]
                              );

            finally
              lPDFDevice.free;
              lMS.free;
            end;
          end;
      except
        raise;
      end;

end;
Reply


Messages In This Thread
Crystal Reports - by Blanca80 - 09-10-2020, 03:39 PM
RE: Crystal Reports - by kudzu - 09-11-2020, 03:10 PM
RE: Crystal Reports - by Alexandre Machado - 09-15-2020, 09:22 AM
RE: Crystal Reports - by joelcc - 09-18-2020, 01:30 PM
RE: Crystal Reports - by DanBarclay - 09-18-2020, 05:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)