I can not work with Web Services

edited April 2017 in FastReport VCL 5
Hello,

I'm working on FR 4.15 and Delphi XE7.

I'm trying to export one report to JPG format and save it into a Webservice.
Please Help Me. I need sample code.


I can connect into a Webservic.

I Use Import WSDL .

Comments

  • gpigpi
    edited 6:17AM
    See a sample for IntraWeb
    procedure TformMain.IWButton1Click(Sender: TObject);
    begin
         frxReport1.Script.Variables['s']:=Trim(editText.Text);
         frxReport1.PrepareReport();
         frxPDFExport1.FileName:=WebApplication.URLBase + 'Files/test.pdf';
         frxReport1.Export(frxPDFExport1);
         AddToInitProc('NewWindow("' + WebApplication.URLBase + '/Files/test.pdf'+'", "","");');
    end;
    
    coinitialize(nil);
    usersession.frxReport1 := TfrxReport.Create(nil);
    usersession.frxReport1.EngineOptions.SilentMode:= true;
    usersession.frxReport1.EngineOptions.EnableThreadSafe:=true;
    usersession.frxReport1.EngineOptions.DestroyForms := false;
    usersession.frxReport1.EngineOptions.UseFileCache := false;
    usersession.frxReport1.ShowProgress:=False;
    usersession.frxDBDataset1 := tfrxDBDataset.Create(nil);
    usersession.frxDBDataset1.Clear;
    usersession.frxDBDataset1.DataSet:= usersession.repodataset;
    usersession.frxDBDataset1.GetData;
    usersession.frxReport1.Clear;
    usersession.frxReport1.DataSets.Add(usersession.frxDBDataset1);
    usersession.frxReport1.EnabledDataSets.Add(tfrxdbdataset(usersession.frxDBDataset1));
    
    usersession.frxReport1.LoadFromFile( WebApplication.ApplicationPath + 'wwwroot\files\trd.fr3');
    usersession.frxReport1.Variables['userid'] := '''' + usersession.wuserid + '''';
    usersession.frxReport1.Variables['from'] :=''''+ usersession.inidate +'''';
    usersession.frxReport1.Variables['to'] := ''''+ usersession.enddate +'''';
    
    usersession.frxReport1.PrepareReport;
    
    usersession.frxPDFExport1:=TfrxPDFExport.Create(nil);
    usersession.frxPDFExport1.ShowProgress:=False;
    usersession.frxPDFExport1.ShowDialog:=False;
    usersession.frxPDFExport1.FileName:=usersession.filenamepdf;
    usersession.frxReport1.Export(usersession.frxPDFExport1);
    couninitialize();
    usersession.LURL := webapplication.ApplicationURL + '/' + 'reports/' + trim(usersession.LFilepdf);
    webapplication.NewWindow( usersession.LURL);
    freeandnil(usersession.RPMemo);
    freeandnil(usersession.frxDBDataset1);
    usersession.frxPDFExport1.Destroy;
    freeandnil(usersession.frxReport1);
    
  • edited 6:17AM
    Oh , I'm Very Sorry.

    I'm trying to export one report to TByteDynArray and save it into a Webservice.
    Please Help Me. I need sample code.


    I can connect into a Webservic.

    I Use Import WSDL .

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.