FAST REPORT GRAPH

edited 6:52PM in FastReport 4.0
I create a database in delphi saving my data in access tables and I constructed some reports in fast report. Now I want to insert some graph in my report but I have this problem. If I make a graph report (using data from access) and open it by double clicking the fast report file it works fine. But when I'm trying to open the same report by calling it via delphi with script:
procedure TfrmHDP.DAYReport();
var path : String;
begin
CheckForFlights();

if adoquery1.FieldCount>0 then
begin
Path := ExtractFilePath(ParamStr(0));
frxReport1.LoadFromFile(path + 'forms\DAYReport.fr3' );
frxReport1.Variables.Variables:= '''' + dateToStr(datetimepicker1.date) + '''';
frxReport1.Variables.Variables:= '''' + dateToStr(datetimepicker2.date) + '''';
frxReport1.Variables.Variables:= userId;
frxReport1.ShowReport();


the following message appears: The callout property does not exist, my report opens but nothing appear. Does anyone know what the problem is? Thanks.

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 6:52PM
    Try this:

    (..)
    frxReport1.Variables.Variables:= userId;
    frxReport1.PrepareReport;
    frxReport1.ShowReport();
    (...)
  • edited 6:52PM
    Unfortunatelly it does't work too. Any other idea?
  • gordkgordk St.Catherines On. Canada.
    edited 6:52PM
    check this line

    frxReport1.LoadFromFile(path + 'forms\DAYReport.fr3' );
    you may need a backslash before forms if it is a subfolder to the apps folder
    were your variables created as categorized variables or typed variables ?
    if categorized variables delete the second .Variables.
    frxReport1.Variables.Variables:= '''' + dateToStr(datetimepicker1.date) + '''';
  • edited 6:52PM
    Sorry but it didn't worked. Even if I use the following script
    procedure TfrmStatistic.BitBtn1Click(Sender: TObject);
    var path : String;
    begin
    Path := ExtractFilePath(ParamStr(0));
    frxReport1.LoadFromFile(path + 'forms\graph.fr3' );
    // frxReport1.PrepareReport;
    frxReport1.ShowReport();
    end;

    and call fast report via delphi my fast report file opens but no graph appears. I made a graph using as datasource ''fixed data'' option from the graph menu. When I open it by double clicking the fast report file the file opens and my graph appears. But when i call it via delphi ''stol.exe'' file using the above script my fast report file opens, everything appears (headers, footers, etc) exept my graph. Instand of it a white box appears in its position. I' m sure that the fault isn't the graph properties because my graph appears when I open the same fast report file directly.
  • gordkgordk St.Catherines On. Canada.
    edited 6:52PM
    In that case i would check to see if your app is calling the correct report.
  • edited 6:52PM
    I've just made a test using pure FR script in a simple report that had one purpose: load from file and save to file 2 other as simple as possible reports. One of them had a graph inside, while the other hadn't. The script is bellow (button OnClick event)
    procedure BitBtn1OnClick(Sender: TfrxComponent);
    var   MyReport1, MyReport2 :TfrxReport;                                                                       
    begin
       MyReport1 := TfrxReport.Create(Sender);
       MyReport1.LoadFromFile( 'c:\temp\graph report to load.fr3' );
       MyReport1.SaveToFile(   'c:\temp\graph report to load(2).fr3' );
    
       MyReport2 := TfrxReport.Create(Sender);
       MyReport2.LoadFromFile( 'c:\temp\report without a graph.fr3' );
       MyReport2.SaveToFile(   'c:\temp\report without a graph(2).fr3' );
    end;
    

    And what happend?
    The second report (the one with no graph) written to disk works as an original one - in fact it has a few bytes less.
    The first one (with graph based on 3 fixed data: 1, 2, 3) after writting to disk is completly broken. Instead of about 3kB (as original one) it is about 0,5 kB. When I open it I can see there is NO DialogPage1 and Page1 tab at all.

    Maybe this will show you the way of further tests.

    Mick


  • edited 6:52PM
    Sorry, but it didn't help. Any other idea???
  • edited 6:52PM
    In my opinion, the test I've done proved that there was something WRONG inside Fast Report.
    I mean the operation of loading report with graph may have a bug [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> You should send a support ticket to Fast Report. Mick[/img]
  • edited 6:52PM
    Thanks Mick, I'll contact to fast report but could you first send me the script example that you checked to compare it with mine? Thanks.
  • edited 6:52PM
    Strange things happen [img]style_emoticons/<#EMO_DIR#>/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" /> I did those tests again few minutes ago and it worked correctly. I used a compiled FR4 demo 4.10.14. Then I tested it with our compiled designer that we use to create reports - it worked correctly as well. The last try was made with an application made for customers (compiled exe with no designer). The application can load a report from disk. All those three tests ended with succes[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> And I couldn't get the wrong results I had few days ago. Both reports to be loaded (without a graph, and with graph) works fine. Here you have my examples. Mick[/img]

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.